diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-03-14 01:39:35 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-03-14 15:16:18 -0400 |
commit | 60ea97187acbb5fdc7ce0ededc1f05ee4eb19354 (patch) | |
tree | 1b732d94f2d5f3edef462f554743efa2ad0cf94b /gdk | |
parent | fb7ef8f62cf607b9af2b121a76de0858201c65f3 (diff) | |
download | gtk+-60ea97187acbb5fdc7ce0ededc1f05ee4eb19354.tar.gz |
Drop GdkToplevel:sticky
This was only ever implemented on X11. If you
want to use it there, just use the X properties
yourself.
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/broadway/gdksurface-broadway.c | 6 | ||||
-rw-r--r-- | gdk/gdktoplevel.c | 23 | ||||
-rw-r--r-- | gdk/gdktoplevel.h | 4 | ||||
-rw-r--r-- | gdk/gdktoplevelprivate.h | 1 | ||||
-rw-r--r-- | gdk/wayland/gdksurface-wayland.c | 6 | ||||
-rw-r--r-- | gdk/win32/gdksurface-win32.c | 6 | ||||
-rw-r--r-- | gdk/x11/gdkdisplay-x11.c | 30 | ||||
-rw-r--r-- | gdk/x11/gdksurface-x11.c | 93 | ||||
-rw-r--r-- | gdk/x11/gdksurface-x11.h | 1 |
9 files changed, 2 insertions, 168 deletions
diff --git a/gdk/broadway/gdksurface-broadway.c b/gdk/broadway/gdksurface-broadway.c index 738d40c606..66e3d3bbf6 100644 --- a/gdk/broadway/gdksurface-broadway.c +++ b/gdk/broadway/gdksurface-broadway.c @@ -1494,9 +1494,6 @@ gdk_broadway_toplevel_set_property (GObject *object, case LAST_PROP + GDK_TOPLEVEL_PROP_ICON_LIST: break; - case LAST_PROP + GDK_TOPLEVEL_PROP_STICKY: - break; - case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_ABOVE: break; @@ -1551,9 +1548,6 @@ gdk_broadway_toplevel_get_property (GObject *object, g_value_set_pointer (value, NULL); break; - case LAST_PROP + GDK_TOPLEVEL_PROP_STICKY: - break; - case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_ABOVE: break; diff --git a/gdk/gdktoplevel.c b/gdk/gdktoplevel.c index 7544b673a2..d7ee9bff2d 100644 --- a/gdk/gdktoplevel.c +++ b/gdk/gdktoplevel.c @@ -119,12 +119,6 @@ gdk_toplevel_default_init (GdkToplevelInterface *iface) "The list of icon textures", G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY)); g_object_interface_install_property (iface, - g_param_spec_boolean ("sticky", - "Sticky", - "Whether the surface is on all workspaces", - FALSE, - G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY)); - g_object_interface_install_property (iface, g_param_spec_boolean ("keep-above", "Keep above", "Whether the surface is on above all other surfaces", @@ -179,7 +173,6 @@ gdk_toplevel_install_properties (GObjectClass *object_class, g_object_class_override_property (object_class, first_prop + GDK_TOPLEVEL_PROP_TRANSIENT_FOR, "transient-for"); g_object_class_override_property (object_class, first_prop + GDK_TOPLEVEL_PROP_MODAL, "modal"); g_object_class_override_property (object_class, first_prop + GDK_TOPLEVEL_PROP_ICON_LIST, "icon-list"); - g_object_class_override_property (object_class, first_prop + GDK_TOPLEVEL_PROP_STICKY, "sticky"); g_object_class_override_property (object_class, first_prop + GDK_TOPLEVEL_PROP_KEEP_ABOVE, "keep-above"); g_object_class_override_property (object_class, first_prop + GDK_TOPLEVEL_PROP_KEEP_BELOW, "keep-below"); g_object_class_override_property (object_class, first_prop + GDK_TOPLEVEL_PROP_ACCEPT_FOCUS, "accept-focus"); @@ -423,22 +416,6 @@ gdk_toplevel_show_window_menu (GdkToplevel *toplevel, } /** - * gdk_toplevel_set_sticky: - * @toplevel: a #GdkToplevel - * @sticky: whether to make @toplevel show on all workspaces - * - * Set if @surface is sticky. - **/ -void -gdk_toplevel_set_sticky (GdkToplevel *toplevel, - gboolean sticky) -{ - g_return_if_fail (GDK_IS_TOPLEVEL (toplevel)); - - g_object_set (toplevel, "sticky", sticky, NULL); -} - -/** * gdk_toplevel_set_keep_above: * @toplevel: a #GdkToplevel * @above: whether to keep @toplevel above other surfaces diff --git a/gdk/gdktoplevel.h b/gdk/gdktoplevel.h index 0827c5bf38..b98ce60a5d 100644 --- a/gdk/gdktoplevel.h +++ b/gdk/gdktoplevel.h @@ -78,10 +78,6 @@ gboolean gdk_toplevel_show_window_menu (GdkToplevel *toplevel, GdkEvent *event); GDK_AVAILABLE_IN_ALL -void gdk_toplevel_set_sticky (GdkToplevel *toplevel, - gboolean sticky); - -GDK_AVAILABLE_IN_ALL void gdk_toplevel_set_keep_above (GdkToplevel *toplevel, gboolean above); GDK_AVAILABLE_IN_ALL diff --git a/gdk/gdktoplevelprivate.h b/gdk/gdktoplevelprivate.h index 711b114da6..b465e154ce 100644 --- a/gdk/gdktoplevelprivate.h +++ b/gdk/gdktoplevelprivate.h @@ -31,7 +31,6 @@ typedef enum GDK_TOPLEVEL_PROP_TRANSIENT_FOR, GDK_TOPLEVEL_PROP_MODAL, GDK_TOPLEVEL_PROP_ICON_LIST, - GDK_TOPLEVEL_PROP_STICKY, GDK_TOPLEVEL_PROP_KEEP_ABOVE, GDK_TOPLEVEL_PROP_KEEP_BELOW, GDK_TOPLEVEL_PROP_ACCEPT_FOCUS, diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c index d7bfbfb5ef..40ae00b415 100644 --- a/gdk/wayland/gdksurface-wayland.c +++ b/gdk/wayland/gdksurface-wayland.c @@ -4349,9 +4349,6 @@ gdk_wayland_toplevel_set_property (GObject *object, case LAST_PROP + GDK_TOPLEVEL_PROP_ICON_LIST: break; - case LAST_PROP + GDK_TOPLEVEL_PROP_STICKY: - break; - case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_ABOVE: break; @@ -4416,9 +4413,6 @@ gdk_wayland_toplevel_get_property (GObject *object, g_value_set_pointer (value, NULL); break; - case LAST_PROP + GDK_TOPLEVEL_PROP_STICKY: - break; - case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_ABOVE: break; diff --git a/gdk/win32/gdksurface-win32.c b/gdk/win32/gdksurface-win32.c index a4c5d671b2..fbfffd4a88 100644 --- a/gdk/win32/gdksurface-win32.c +++ b/gdk/win32/gdksurface-win32.c @@ -4907,9 +4907,6 @@ gdk_win32_toplevel_set_property (GObject *object, case LAST_PROP + GDK_TOPLEVEL_PROP_ICON_LIST: break; - case LAST_PROP + GDK_TOPLEVEL_PROP_STICKY: - break; - case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_ABOVE: break; @@ -4969,9 +4966,6 @@ gdk_win32_toplevel_get_property (GObject *object, g_value_set_pointer (value, NULL); break; - case LAST_PROP + GDK_TOPLEVEL_PROP_STICKY: - break; - case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_ABOVE: break; diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c index 7d0786eb48..5108a06e1d 100644 --- a/gdk/x11/gdkdisplay-x11.c +++ b/gdk/x11/gdkdisplay-x11.c @@ -382,20 +382,6 @@ do_net_wm_state_changes (GdkSurface *surface) set = unset = 0; - /* For found_sticky to remain TRUE, we have to also be on desktop - * 0xFFFFFFFF - */ - if (old_state & GDK_SURFACE_STATE_STICKY) - { - if (!(toplevel->have_sticky && toplevel->on_all_desktops)) - unset |= GDK_SURFACE_STATE_STICKY; - } - else - { - if (toplevel->have_sticky && toplevel->on_all_desktops) - set |= GDK_SURFACE_STATE_STICKY; - } - if (old_state & GDK_SURFACE_STATE_FULLSCREEN) { if (!toplevel->have_fullscreen) @@ -499,9 +485,6 @@ gdk_check_wm_state_changed (GdkSurface *surface) Atom *atoms = NULL; gulong i; - gboolean had_sticky = toplevel->have_sticky; - - toplevel->have_sticky = FALSE; toplevel->have_maxvert = FALSE; toplevel->have_maxhorz = FALSE; toplevel->have_fullscreen = FALSE; @@ -518,7 +501,6 @@ gdk_check_wm_state_changed (GdkSurface *surface) if (type != None) { - Atom sticky_atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE_STICKY"); Atom maxvert_atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE_MAXIMIZED_VERT"); Atom maxhorz_atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE_MAXIMIZED_HORZ"); Atom fullscreen_atom = gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_STATE_FULLSCREEN"); @@ -530,9 +512,7 @@ gdk_check_wm_state_changed (GdkSurface *surface) i = 0; while (i < nitems) { - if (atoms[i] == sticky_atom) - toplevel->have_sticky = TRUE; - else if (atoms[i] == maxvert_atom) + if (atoms[i] == maxvert_atom) toplevel->have_maxvert = TRUE; else if (atoms[i] == maxhorz_atom) toplevel->have_maxhorz = TRUE; @@ -553,13 +533,7 @@ gdk_check_wm_state_changed (GdkSurface *surface) g_intern_static_string ("_NET_WM_STATE_FOCUSED"))) toplevel->have_focused = TRUE; - /* When have_sticky is turned on, we have to check the DESKTOP property - * as well. - */ - if (toplevel->have_sticky && !had_sticky) - gdk_check_wm_desktop_changed (surface); - else - do_net_wm_state_changes (surface); + do_net_wm_state_changes (surface); } static void diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c index 24de04d00f..d190fb2c7a 100644 --- a/gdk/x11/gdksurface-x11.c +++ b/gdk/x11/gdksurface-x11.c @@ -1158,14 +1158,6 @@ set_initial_hints (GdkSurface *surface) ++i; } - if (surface->state & GDK_SURFACE_STATE_STICKY) - { - atoms[i] = gdk_x11_get_xatom_by_name_for_display (display, - "_NET_WM_STATE_STICKY"); - ++i; - toplevel->have_sticky = TRUE; - } - if (surface->state & GDK_SURFACE_STATE_FULLSCREEN) { atoms[i] = gdk_x11_get_xatom_by_name_for_display (display, @@ -3058,78 +3050,6 @@ gdk_x11_surface_unminimize (GdkSurface *surface) } static void -gdk_x11_surface_stick (GdkSurface *surface) -{ - if (GDK_SURFACE_DESTROYED (surface)) - return; - - if (GDK_SURFACE_IS_MAPPED (surface)) - { - /* "stick" means stick to all desktops _and_ do not scroll with the - * viewport. i.e. glue to the monitor glass in all cases. - */ - - XClientMessageEvent xclient; - - /* Request stick during viewport scroll */ - gdk_wmspec_change_state (TRUE, surface, - "_NET_WM_STATE_STICKY", - NULL); - - /* Request desktop 0xFFFFFFFF */ - memset (&xclient, 0, sizeof (xclient)); - xclient.type = ClientMessage; - xclient.window = GDK_SURFACE_XID (surface); - xclient.display = GDK_SURFACE_XDISPLAY (surface); - xclient.message_type = gdk_x11_get_xatom_by_name_for_display (GDK_SURFACE_DISPLAY (surface), - "_NET_WM_DESKTOP"); - xclient.format = 32; - - xclient.data.l[0] = 0xFFFFFFFF; - xclient.data.l[1] = 0; - xclient.data.l[2] = 0; - xclient.data.l[3] = 0; - xclient.data.l[4] = 0; - - XSendEvent (GDK_SURFACE_XDISPLAY (surface), GDK_SURFACE_XROOTWIN (surface), False, - SubstructureRedirectMask | SubstructureNotifyMask, - (XEvent *)&xclient); - } - else - { - /* Flip our client side flag, the real work happens on map. */ - gdk_synthesize_surface_state (surface, - 0, - GDK_SURFACE_STATE_STICKY); - } -} - -static void -gdk_x11_surface_unstick (GdkSurface *surface) -{ - if (GDK_SURFACE_DESTROYED (surface)) - return; - - if (GDK_SURFACE_IS_MAPPED (surface)) - { - /* Request unstick from viewport */ - gdk_wmspec_change_state (FALSE, surface, - "_NET_WM_STATE_STICKY", - NULL); - - move_to_current_desktop (surface); - } - else - { - /* Flip our client side flag, the real work happens on map. */ - gdk_synthesize_surface_state (surface, - GDK_SURFACE_STATE_STICKY, - 0); - - } -} - -static void gdk_x11_surface_maximize (GdkSurface *surface) { if (GDK_SURFACE_DESTROYED (surface)) @@ -4871,14 +4791,6 @@ gdk_wayland_toplevel_set_property (GObject *object, g_object_notify_by_pspec (G_OBJECT (surface), pspec); break; - case LAST_PROP + GDK_TOPLEVEL_PROP_STICKY: - if (g_value_get_boolean (value)) - gdk_x11_surface_stick (surface); - else - gdk_x11_surface_unstick (surface); - g_object_notify_by_pspec (G_OBJECT (surface), pspec); - break; - case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_ABOVE: gdk_x11_surface_set_keep_above (surface, g_value_get_boolean (value)); g_object_notify_by_pspec (G_OBJECT (surface), pspec); @@ -4928,7 +4840,6 @@ gdk_wayland_toplevel_get_property (GObject *object, GParamSpec *pspec) { GdkSurface *surface = GDK_SURFACE (object); - GdkX11Surface *impl = GDK_X11_SURFACE (surface); switch (prop_id) { @@ -4956,10 +4867,6 @@ gdk_wayland_toplevel_get_property (GObject *object, g_value_set_pointer (value, NULL); break; - case LAST_PROP + GDK_TOPLEVEL_PROP_STICKY: - g_value_set_boolean (value, impl->toplevel->have_sticky); - break; - case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_ABOVE: g_value_set_boolean (value, (surface->state & GDK_SURFACE_STATE_ABOVE) != 0); break; diff --git a/gdk/x11/gdksurface-x11.h b/gdk/x11/gdksurface-x11.h index 29f9cf6a6d..609181f59a 100644 --- a/gdk/x11/gdksurface-x11.h +++ b/gdk/x11/gdksurface-x11.h @@ -116,7 +116,6 @@ struct _GdkToplevelX11 guint on_all_desktops : 1; /* _NET_WM_STICKY == 0xFFFFFFFF */ - guint have_sticky : 1; /* _NET_WM_STATE_STICKY */ guint have_maxvert : 1; /* _NET_WM_STATE_MAXIMIZED_VERT */ guint have_maxhorz : 1; /* _NET_WM_STATE_MAXIMIZED_HORZ */ guint have_fullscreen : 1; /* _NET_WM_STATE_FULLSCREEN */ |