diff options
author | Elijah Newren <newren gmail com> | 2007-04-01 03:38:34 +0000 |
---|---|---|
committer | Elijah Newren <newren@src.gnome.org> | 2007-04-01 03:38:34 +0000 |
commit | 9384ea655c2513105ec2a633b28c3c9fc44744ac (patch) | |
tree | b1b4db9984197df5deccdf1e1d52df22f39e156c /gdk/x11 | |
parent | edb9f10aadbddd8a6d7ad652b02a5d9fa9227b6d (diff) | |
download | gdk-pixbuf-9384ea655c2513105ec2a633b28c3c9fc44744ac.tar.gz |
Patch from Matthias to add support for the _NET_WM_USER_TIME_WINDOW EWMH
2007-03-31 Elijah Newren <newren gmail com>
* gdk/x11/gdkwindow-x11.c (setup_toplevel_window,
gdk_x11_window_set_user_time):
Patch from Matthias to add support for the
_NET_WM_USER_TIME_WINDOW EWMH protocol; see #354213.
WARNING: This patch will make metacity <= 2.18.0 freeze on
workspace switch. This is due to a weird problem that should only
affect window managers using gdk in-process for decoration drawing
and which make an unsafe assumption relating to doing so (i.e. it
should only affect metacity). Upgrade your version of metacity if
you hit this bug.
svn path=/trunk/; revision=17574
Diffstat (limited to 'gdk/x11')
-rw-r--r-- | gdk/x11/gdkwindow-x11.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c index c0226a681..533387fc6 100644 --- a/gdk/x11/gdkwindow-x11.c +++ b/gdk/x11/gdkwindow-x11.c @@ -614,6 +614,12 @@ setup_toplevel_window (GdkWindow *window, XA_WINDOW, 32, PropModeReplace, (guchar *) &GDK_DISPLAY_X11 (screen_x11->display)->leader_window, 1); + if (toplevel->focus_window != None) + XChangeProperty (xdisplay, xid, + gdk_x11_get_xatom_by_name_for_display (screen_x11->display, "_NET_WM_USER_TIME_WINDOW"), + XA_WINDOW, 32, PropModeReplace, + (guchar *) &toplevel->focus_window, 1); + if (!obj->focus_on_map) gdk_x11_window_set_user_time (window, 0); else if (GDK_DISPLAY_X11 (screen_x11->display)->user_time != 0) @@ -4256,6 +4262,7 @@ gdk_x11_window_set_user_time (GdkWindow *window, GdkDisplayX11 *display_x11; GdkToplevelX11 *toplevel; glong timestamp_long = (glong)timestamp; + Window xid; g_return_if_fail (GDK_IS_WINDOW (window)); @@ -4266,7 +4273,20 @@ gdk_x11_window_set_user_time (GdkWindow *window, display_x11 = GDK_DISPLAY_X11 (display); toplevel = _gdk_x11_window_get_toplevel (window); - XChangeProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window), + if (!toplevel) + { + g_warning ("gdk_window_set_user_time called on non-toplevel\n"); + return; + } + + if (toplevel->focus_window != None && + gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window), + gdk_atom_intern_static_string ("_NET_WM_USER_TIME_WINDOW"))) + xid = toplevel->focus_window; + else + xid = GDK_WINDOW_XID (window); + + XChangeProperty (GDK_DISPLAY_XDISPLAY (display), xid, gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_USER_TIME"), XA_CARDINAL, 32, PropModeReplace, (guchar *)×tamp_long, 1); |