GNOME Bugzilla – Bug 113602
Provide 'roles' for WM memory.
Last modified: 2004-12-22 21:47:04 UTC
The following patch adds gtk_window_set_role calls for the "post" and "reply" pop-up windows, so that ICCCM compliant window managers can use the named 'roles' as keys for remembering the size and placement of these windows as being distinct from that of the main window. In the patch I used different role strings for the two windows, thus providing different WM "memories" for them, though I can't see why anyone would complain if they were the same. YMMV! You might want to provide roles for other windows too, though these are the ones that I find particularly annoying. --- pan/message-window.c~ 2003-04-23 15:55:33.000000000 -0600 +++ pan/message-window.c 2003-05-23 10:41:38.000000000 -0600 @@ -2191,6 +2191,8 @@ pan_lock(); compose->window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW(compose->window), _("New Message")); + gtk_window_set_role (GTK_WINDOW(compose->window), + _("pan-post-window")); v = gtk_vbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER(compose->window), v); @@ -2273,6 +2275,8 @@ pan_lock (); compose->window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW(compose->window), title); + gtk_window_set_role (GTK_WINDOW(compose->window), + _("pan-reply-window")); v = gtk_vbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER(compose->window), v); Note: Sawfish users will find that Sawfish incorrectly (as I understand it) remembers the size and placement based on the 'class' rather than the 'role'. But I don't want to ask application programmers to program their applications wrong on that account, so I'm suggesting the above instead, which AIUI is correct by the ICCCM. Sawfish can be fixed by changing a single line of code, and I'll be trying to get them to do that. Hopefully some other WMs are already working correctly. A short, inflammatory discussion of the use of roles and classes can be found at http://mail.gnome.org/archives/gtk-app-devel-list/2001-December/msg00067.html Thanks, BB
Fixed in CVS: http://cvs.gnome.org/bonsai/cvsview2.cgi?diff_mode=context&whitespace_mode=show&subdir=pan/pan&command=DIFF_FRAMESET&file=log-ui.c&rev1=1.2&rev2=1.3&root=/cvs/gnome http://cvs.gnome.org/bonsai/cvsview2.cgi?diff_mode=context&whitespace_mode=show&subdir=pan/pan&command=DIFF_FRAMESET&file=gui.c&rev1=1.579&rev2=1.580&root=/cvs/gnome http://cvs.gnome.org/bonsai/cvsview2.cgi?diff_mode=context&whitespace_mode=show&subdir=pan/pan&command=DIFF_FRAMESET&file=message-window.c&rev1=1.361&rev2=1.362&root=/cvs/gnome http://cvs.gnome.org/bonsai/cvsview2.cgi?diff_mode=context&whitespace_mode=show&subdir=pan/pan&command=DIFF_FRAMESET&file=task-manager.c&rev1=1.96&rev2=1.97&root=/cvs/gnome