Re: [gtk-list] Re: found a patch for wm_class



Raph's patch for WM_CLASS works fine with fvwm95, but it's not enough for window managers that implement a bigger subset of the ICCCM conventions like WindowMaker does. I've worked through the ICCCM document and reworked my original patch (the one Raph referred to) after that.

[For WMaker fans: the patch makes GTK applications dockable and iconified windows will have an correct title line.]


My proposal is that all windows of an GTK app are grouped in one `window group'. Then, we have one empty, unmapped `leader window' gdk_leader_window with WM_COMMAND and WM_CLASS set, and all other top-level windows will inherit these properties (with this additional hint, an window manager can e.g. hide all windows of the app at once).

Furthermore, AFAIK, WM_CLASS does denote the class of the app, not of the window. Therefore, it makes no sense to set WM_CLASS per window. I have removed gtk_window_set_wmclass() and introduced a global variable gdk_progclass. I would map gdk_progname on WM_CLASS.resname and gdk_progclass on WM_CLASS.classname. gdk_progname should be set in gtk_init() or shortly after or before the gtk_init call in main() (perhaps we need gtk_set_progclass() ??? gtk_init(argc, argv, progclass) looks ugly). Look at my sample in gtk/simple.c.


The XSetCommand() call sets the WM_COMMAND property. This property hints session managers on how to restart the application. Full session management looks like way to go, but this is enough to support WMaker's docking facility.


New command line options "-name NAME" (according to ICCCM) and "-class CLASS" let the user override the Instance and Class properties.


Finally, I have set the icon title property WM_ICON_NAME whereever WM_NAME is set. I think it's a reasonable assumption that they are the same. ICCCM specifies that WM_ICON_NAME should be set as an fallback.



The proposed changes have the advantage that the hints default to reasonable values for all cases I could think of, i.e. developers don't have to code a single additional line. The only addition is that gdk_progclass should be set to a reasonable value somewhere in main() somehow.

The patch attached and will also be uploaded to ftp.gimp.org as gtk-flight-970923.patch.

Gregor


gtk-flight-970923.patch;x-unix-mode=0644




Peter Mattis wrote:
Raph Levien writes:
>With due respect, my patch is quite a bit better, as it allows
>applications to set their own wm name and class hints. The one posted
>above simply hardcodes the class to "GDK_App".
>
>I can't the patch find it quickly now, but if anyone wants it, let me
>know and I'll track it down.


I've installed Raph's patch in my source tree.


---
| Gregor Hoffleit admin MATHInet / contact HeidelNeXT |
| MAIL: Mathematisches Institut PHONE: (49)6221 56-5771 |
| INF 288, 69120 Heidelberg / Germany FAX: 56-3812 |
| EMAIL: flight@mathi.uni-heidelberg.de (NeXTmail) |


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]