Commit 5d7b721b authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

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)
parent fbf6c817
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>
* modules/engines/ms-windows/Theme/gtk-2.0/gtkrc: Part of #168326
......
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>
* modules/engines/ms-windows/Theme/gtk-2.0/gtkrc: Part of #168326
......
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>
* modules/engines/ms-windows/Theme/gtk-2.0/gtkrc: Part of #168326
......
......@@ -409,7 +409,7 @@ do_net_wm_state_changes (GdkWindow *window)
}
else
{
if (toplevel->have_sticky && toplevel->on_all_desktops)
if (toplevel->have_sticky || toplevel->on_all_desktops)
gdk_synthesize_window_state (window,
0,
GDK_WINDOW_STATE_STICKY);
......@@ -459,33 +459,29 @@ gdk_check_wm_desktop_changed (GdkWindow *window)
gint format;
gulong nitems;
gulong bytes_after;
guchar *data;
gulong *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 (toplevel->have_sticky)
if (type != None)
{
guchar *data;
gulong *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);
desktop = (gulong *)data;
toplevel->on_all_desktops = (*desktop == 0xFFFFFFFF);
XFree (desktop);
}
else
toplevel->on_all_desktops = FALSE;
do_net_wm_state_changes (window);
}
static void
......
......@@ -2027,13 +2027,20 @@ gdk_window_lower (GdkWindow *window)
* Moves the window to the correct workspace when running under a
* window manager that supports multiple workspaces, as described
* 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
*/
void
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),
gdk_atom_intern ("_NET_WM_DESKTOP", FALSE)))
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment