[Sawfish] For what it's worth: GTK4 popup menus

[ Thread Index | Date Index | More lists.tuxfamily.org/sawfish Archives ]


https://github.com/derek-upham/sawfish/tree/upgrade-menu-gtk4

That branch has a commit that replaces the GTK2 popup menus with GTK4 popup menus (the menus that show up on the root window, or as context menus for other windows).  It solves a particular problem for me: My system's GTK2 libraries had started crashing for any menus with horizontal separators.

It's worth recapping the architecture.

   Sawfish       ⇒       runner
 (X11 calls)

                           ↓

      ↓                 rep-gtk
                      (GTK2 calls)

                           ↓

     rep                  rep
(system calls)       (system calls)

When Sawfish wants to run a popup menu, or run a configuration widget, it spawns a separate process.  That separate process happens to be a rep application as well, built alongside the window manager.  That application interprets s-expr inputs, presents whatever it needs to present using GTK2, and then prints a response for Sawfish to read.

The new popup code completely bypasses the existing runner.  It invokes a dedicated C program that presents a GTK4 popup menu.  It doesn't even send an s-expr; the runner expects a "normal" GTK4 menu definition in XML.


The new code doesn't touch the "Customize" components at all ("Appearance", "Bindings", and so on).  Sawfish's existing code for the customization widgets does far more work than the popup code does.  Replacing the popup code was cheap.  But this does open the possibility of breaking the dependency on GTK2 by just…deleting the customization widgets and dropping the rep-gtk2 dependency entirely.

Derek



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/