Make tracking the on_all_desktops state work better.

2005-08-01  Matthias Clasen  <mclasen@redhat.com>

	* gdk/x11/gdkevents-x11.c (gdk_check_wm_desktop_changed): Make
	tracking the on_all_desktops state work better.

	* gdk/x11/gdkwindow-x11.c (gdk_x11_window_move_to_current_desktop):
	Don't do anything if the window is on all desktops.  (#311803,
	Elijah Newren)
This commit is contained in:
Matthias Clasen 2005-08-01 16:01:24 +00:00 committed by Matthias Clasen
parent fbf6c8175d
commit 5d7b721b27
5 changed files with 56 additions and 26 deletions

View File

@ -1,3 +1,12 @@
2005-08-01 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkevents-x11.c (gdk_check_wm_desktop_changed): Make
tracking the on_all_desktops state work better.
* gdk/x11/gdkwindow-x11.c (gdk_x11_window_move_to_current_desktop):
Don't do anything if the window is on all desktops. (#311803,
Elijah Newren)
2005-08-01 Dom Lachowicz <cinamod@hotmail.com> 2005-08-01 Dom Lachowicz <cinamod@hotmail.com>
* modules/engines/ms-windows/Theme/gtk-2.0/gtkrc: Part of #168326 * modules/engines/ms-windows/Theme/gtk-2.0/gtkrc: Part of #168326

View File

@ -1,3 +1,12 @@
2005-08-01 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkevents-x11.c (gdk_check_wm_desktop_changed): Make
tracking the on_all_desktops state work better.
* gdk/x11/gdkwindow-x11.c (gdk_x11_window_move_to_current_desktop):
Don't do anything if the window is on all desktops. (#311803,
Elijah Newren)
2005-08-01 Dom Lachowicz <cinamod@hotmail.com> 2005-08-01 Dom Lachowicz <cinamod@hotmail.com>
* modules/engines/ms-windows/Theme/gtk-2.0/gtkrc: Part of #168326 * modules/engines/ms-windows/Theme/gtk-2.0/gtkrc: Part of #168326

View File

@ -1,3 +1,12 @@
2005-08-01 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkevents-x11.c (gdk_check_wm_desktop_changed): Make
tracking the on_all_desktops state work better.
* gdk/x11/gdkwindow-x11.c (gdk_x11_window_move_to_current_desktop):
Don't do anything if the window is on all desktops. (#311803,
Elijah Newren)
2005-08-01 Dom Lachowicz <cinamod@hotmail.com> 2005-08-01 Dom Lachowicz <cinamod@hotmail.com>
* modules/engines/ms-windows/Theme/gtk-2.0/gtkrc: Part of #168326 * modules/engines/ms-windows/Theme/gtk-2.0/gtkrc: Part of #168326

View File

@ -409,7 +409,7 @@ do_net_wm_state_changes (GdkWindow *window)
} }
else else
{ {
if (toplevel->have_sticky && toplevel->on_all_desktops) if (toplevel->have_sticky || toplevel->on_all_desktops)
gdk_synthesize_window_state (window, gdk_synthesize_window_state (window,
0, 0,
GDK_WINDOW_STATE_STICKY); GDK_WINDOW_STATE_STICKY);
@ -459,33 +459,29 @@ gdk_check_wm_desktop_changed (GdkWindow *window)
gint format; gint format;
gulong nitems; gulong nitems;
gulong bytes_after; gulong bytes_after;
guchar *data;
gulong *desktop;
if (toplevel->have_sticky) type = None;
gdk_error_trap_push ();
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_DESKTOP"),
0, G_MAXLONG, False, XA_CARDINAL, &type,
&format, &nitems,
&bytes_after, &data);
gdk_error_trap_pop ();
if (type != None)
{ {
guchar *data; desktop = (gulong *)data;
gulong *desktop; toplevel->on_all_desktops = (*desktop == 0xFFFFFFFF);
XFree (desktop);
type = None;
gdk_error_trap_push ();
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
GDK_WINDOW_XID (window),
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_DESKTOP"),
0, G_MAXLONG, False, XA_CARDINAL, &type,
&format, &nitems,
&bytes_after, &data);
gdk_error_trap_pop ();
if (type != None)
{
desktop = (gulong *)data;
toplevel->on_all_desktops = (*desktop == 0xFFFFFFFF);
XFree (desktop);
}
else
toplevel->on_all_desktops = FALSE;
do_net_wm_state_changes (window);
} }
else
toplevel->on_all_desktops = FALSE;
do_net_wm_state_changes (window);
} }
static void static void

View File

@ -2027,13 +2027,20 @@ gdk_window_lower (GdkWindow *window)
* Moves the window to the correct workspace when running under a * Moves the window to the correct workspace when running under a
* window manager that supports multiple workspaces, as described * window manager that supports multiple workspaces, as described
* in the <ulink url="http://www.freedesktop.org/Standards/wm-spec">Extended * in the <ulink url="http://www.freedesktop.org/Standards/wm-spec">Extended
* Window Manager Hints</ulink>. * Window Manager Hints</ulink>. Will not do anything if the
* window is already on all workspaces.
* *
* Since: 2.8 * Since: 2.8
*/ */
void void
gdk_x11_window_move_to_current_desktop (GdkWindow *window) gdk_x11_window_move_to_current_desktop (GdkWindow *window)
{ {
GdkToplevelX11 *toplevel;
toplevel = _gdk_x11_window_get_toplevel (window);
if (toplevel->on_all_desktops)
return;
if (gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window), if (gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window),
gdk_atom_intern ("_NET_WM_DESKTOP", FALSE))) gdk_atom_intern ("_NET_WM_DESKTOP", FALSE)))
{ {