search for the window role "gimp-toolbox", since the app sets that instead

2003-11-17  Manish Singh  <yosh@gimp.org>

        * tools/gimp-remote.c (gimp_remote_find_window): search for the
        window role "gimp-toolbox", since the app sets that instead of
        the class now.
This commit is contained in:
Manish Singh
2003-11-17 08:46:51 +00:00
committed by Manish Singh
parent 133949f990
commit 05ece027fa
2 changed files with 15 additions and 11 deletions

View File

@ -1,3 +1,9 @@
2003-11-17 Manish Singh <yosh@gimp.org>
* tools/gimp-remote.c (gimp_remote_find_window): search for the
window role "gimp-toolbox", since the app sets that instead of
the class now.
2003-11-17 Sven Neumann <sven@gimp.org>
* app/config/gimprc.c (gimp_rc_new): simplified.

View File

@ -65,7 +65,7 @@ gimp_remote_find_window (GdkDisplay *display,
Display *xdisplay;
Window root, parent;
Window *children;
Atom class_atom;
Atom role_atom;
Atom string_atom;
guint nchildren;
gint i;
@ -81,7 +81,7 @@ gimp_remote_find_window (GdkDisplay *display,
if (! (children && nchildren))
return NULL;
class_atom = XInternAtom (xdisplay, "WM_CLASS", TRUE);
role_atom = XInternAtom (xdisplay, "WM_WINDOW_ROLE", TRUE);
string_atom = XInternAtom (xdisplay, "STRING", TRUE);
for (i = nchildren - 1; i >= 0; i--)
@ -101,14 +101,14 @@ gimp_remote_find_window (GdkDisplay *display,
window = XmuClientWindow (xdisplay, children[i]);
/* We are searching the Gimp toolbox: Its WM_CLASS Property
* has the values "toolbox\0Gimp\0". This is pretty relieable,
* it is more reliable when we ask a special property, explicitely
* set from the gimp. See below... :-)
/* We are searching for the Gimp toolbox: Its WM_WINDOW_ROLE Property
* (as set by gtk_window_set_role ()) has the value "gimp-toolbox".
* This is pretty reliable, since ask for a special property,
* explicitly set by the gimp. See below... :-)
*/
if (XGetWindowProperty (xdisplay, window,
class_atom,
role_atom,
0, 32,
FALSE,
string_atom,
@ -116,9 +116,7 @@ gimp_remote_find_window (GdkDisplay *display,
&data) == Success &&
ret_type)
{
if (nitems > 12 &&
strcmp (data, "toolbox") == 0 &&
strcmp (data + 8, "Gimp") == 0)
if (nitems > 11 && strcmp (data, "gimp-toolbox") == 0)
{
XFree (data);
result = gdk_window_foreign_new_for_display (display, window);