Astal icon indicating copy to clipboard operation
Astal copied to clipboard

Add Cairo or GLArea to GTK4

Open rice7th opened this issue 7 months ago • 3 comments

Is your feature request related to a problem? Please describe. I am building a bar with GTK4 and I wanted to have an animated battery visualization, which can only be done with cairo as far as I know.

Describe the solution you'd like As stated by #80 , it seems like Cairo isn't really going to be ported to GTK4, so what about porting GLArea instead? This would enable GPU shaders instead to be run, which can be a nice alternative.

Describe alternatives you've considered Either GLArea, Cairo or any other vectory rendering library would be good enough, but I am not sure if the last is even feasable.

Additional context Nothing else to add for now

rice7th avatar Apr 30 '25 10:04 rice7th

I'm not sure what you are asking here. You can still draw with cairo in GTK4 using Gtk.DrawingArea. Or use Gtk.GLArea, although you can't use it from language bindings such as GJS.

Aylur avatar May 12 '25 23:05 Aylur

@Aylur thanks for the response. Maybe I've read the docs wrong, but in my build of ags Gtk.DrawingArea is not defined anywhere, hence I thought it just wasn't possible, as stated by #80. As for Gtk.GLArea, I'm not sure how working with it outside typescript bindings would work.

rice7th avatar May 13 '25 05:05 rice7th

@Aylur any advice on how to implement Gtk.GlArea within Astal?

andrwui avatar Jun 27 '25 03:06 andrwui