[gtk/x11-props: 6/6] Drop GdkToplevel:keep-above/below
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/x11-props: 6/6] Drop GdkToplevel:keep-above/below
- Date: Sat, 14 Mar 2020 05:54:49 +0000 (UTC)
commit e71a0964c0a7a550ba7a3f7c27a2f55300f49c6b
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Mar 14 01:52:19 2020 -0400
Drop GdkToplevel:keep-above/below
Move these properties to the X11 backend, which is
the only place where they are implemented.
gdk/broadway/gdksurface-broadway.c | 12 --------
gdk/gdktoplevel.c | 46 -----------------------------
gdk/gdktoplevel.h | 7 -----
gdk/gdktoplevelprivate.h | 2 --
gdk/wayland/gdksurface-wayland.c | 12 --------
gdk/x11/gdksurface-x11.c | 60 +++++++++++++++++++++++++-------------
6 files changed, 39 insertions(+), 100 deletions(-)
---
diff --git a/gdk/broadway/gdksurface-broadway.c b/gdk/broadway/gdksurface-broadway.c
index 66e3d3bbf6..4cf1a111b5 100644
--- a/gdk/broadway/gdksurface-broadway.c
+++ b/gdk/broadway/gdksurface-broadway.c
@@ -1494,12 +1494,6 @@ gdk_broadway_toplevel_set_property (GObject *object,
case LAST_PROP + GDK_TOPLEVEL_PROP_ICON_LIST:
break;
- case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_ABOVE:
- break;
-
- case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_BELOW:
- break;
-
case LAST_PROP + GDK_TOPLEVEL_PROP_ACCEPT_FOCUS:
break;
@@ -1548,12 +1542,6 @@ gdk_broadway_toplevel_get_property (GObject *object,
g_value_set_pointer (value, NULL);
break;
- case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_ABOVE:
- break;
-
- case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_BELOW:
- break;
-
case LAST_PROP + GDK_TOPLEVEL_PROP_ACCEPT_FOCUS:
break;
diff --git a/gdk/gdktoplevel.c b/gdk/gdktoplevel.c
index d7ee9bff2d..4f4f1dace8 100644
--- a/gdk/gdktoplevel.c
+++ b/gdk/gdktoplevel.c
@@ -118,18 +118,6 @@ gdk_toplevel_default_init (GdkToplevelInterface *iface)
"Icon List",
"The list of icon textures",
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",
- FALSE,
- G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
- g_object_interface_install_property (iface,
- g_param_spec_boolean ("keep-below",
- "Keep below",
- "Whether the surface is below all other surfaces",
- FALSE,
- G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
g_object_interface_install_property (iface,
g_param_spec_boolean ("accept-focus",
"Accept focus",
@@ -173,8 +161,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_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");
g_object_class_override_property (object_class, first_prop + GDK_TOPLEVEL_PROP_FOCUS_ON_MAP,
"focus-on-map");
g_object_class_override_property (object_class, first_prop + GDK_TOPLEVEL_PROP_DECORATED, "decorated");
@@ -415,38 +401,6 @@ gdk_toplevel_show_window_menu (GdkToplevel *toplevel,
return GDK_TOPLEVEL_GET_IFACE (toplevel)->show_window_menu (toplevel, event);
}
-/**
- * gdk_toplevel_set_keep_above:
- * @toplevel: a #GdkToplevel
- * @above: whether to keep @toplevel above other surfaces
- *
- * Set if @surface must be kept above other surfaces.
- **/
-void
-gdk_toplevel_set_keep_above (GdkToplevel *toplevel,
- gboolean above)
-{
- g_return_if_fail (GDK_IS_TOPLEVEL (toplevel));
-
- g_object_set (toplevel, "keep-above", above, NULL);
-}
-
-/**
- * gdk_toplevel_set_keep_below:
- * @toplevel: a #GdkToplevel
- * @below: whether to keep @toplevel below other surfaces
- *
- * Set if @surface must be kept below other surfaces.
- **/
-void
-gdk_toplevel_set_keep_below (GdkToplevel *toplevel,
- gboolean below)
-{
- g_return_if_fail (GDK_IS_TOPLEVEL (toplevel));
-
- g_object_set (toplevel, "keep-below", below, NULL);
-}
-
/**
* gdk_toplevel_set_accept_focus:
* @toplevel: a #GdkToplevel
diff --git a/gdk/gdktoplevel.h b/gdk/gdktoplevel.h
index b98ce60a5d..e1ad1f228e 100644
--- a/gdk/gdktoplevel.h
+++ b/gdk/gdktoplevel.h
@@ -77,13 +77,6 @@ GDK_AVAILABLE_IN_ALL
gboolean gdk_toplevel_show_window_menu (GdkToplevel *toplevel,
GdkEvent *event);
-GDK_AVAILABLE_IN_ALL
-void gdk_toplevel_set_keep_above (GdkToplevel *toplevel,
- gboolean above);
-GDK_AVAILABLE_IN_ALL
-void gdk_toplevel_set_keep_below (GdkToplevel *toplevel,
- gboolean below);
-
GDK_AVAILABLE_IN_ALL
void gdk_toplevel_set_accept_focus (GdkToplevel *toplevel,
gboolean accept_focus);
diff --git a/gdk/gdktoplevelprivate.h b/gdk/gdktoplevelprivate.h
index b465e154ce..92e37b18cd 100644
--- a/gdk/gdktoplevelprivate.h
+++ b/gdk/gdktoplevelprivate.h
@@ -31,8 +31,6 @@ typedef enum
GDK_TOPLEVEL_PROP_TRANSIENT_FOR,
GDK_TOPLEVEL_PROP_MODAL,
GDK_TOPLEVEL_PROP_ICON_LIST,
- GDK_TOPLEVEL_PROP_KEEP_ABOVE,
- GDK_TOPLEVEL_PROP_KEEP_BELOW,
GDK_TOPLEVEL_PROP_ACCEPT_FOCUS,
GDK_TOPLEVEL_PROP_FOCUS_ON_MAP,
GDK_TOPLEVEL_PROP_DECORATED,
diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c
index 40ae00b415..a4a421bb90 100644
--- a/gdk/wayland/gdksurface-wayland.c
+++ b/gdk/wayland/gdksurface-wayland.c
@@ -4349,12 +4349,6 @@ gdk_wayland_toplevel_set_property (GObject *object,
case LAST_PROP + GDK_TOPLEVEL_PROP_ICON_LIST:
break;
- case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_ABOVE:
- break;
-
- case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_BELOW:
- break;
-
case LAST_PROP + GDK_TOPLEVEL_PROP_ACCEPT_FOCUS:
break;
@@ -4413,12 +4407,6 @@ gdk_wayland_toplevel_get_property (GObject *object,
g_value_set_pointer (value, NULL);
break;
- case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_ABOVE:
- break;
-
- case LAST_PROP + GDK_TOPLEVEL_PROP_KEEP_BELOW:
- break;
-
case LAST_PROP + GDK_TOPLEVEL_PROP_ACCEPT_FOCUS:
break;
diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c
index 9a4a326639..2e1283913e 100644
--- a/gdk/x11/gdksurface-x11.c
+++ b/gdk/x11/gdksurface-x11.c
@@ -4831,6 +4831,8 @@ static void gdk_x11_toplevel_iface_init (GdkToplevelInterface *iface);
enum
{
PROP_STICKY = 1,
+ PROP_KEEP_ABOVE,
+ PROP_KEEP_BELOW,
LAST_TOPLEVEL_PROP
};
@@ -4860,6 +4862,16 @@ gdk_wayland_toplevel_set_property (GObject *object,
g_object_notify_by_pspec (G_OBJECT (surface), pspec);
break;
+ case PROP_KEEP_ABOVE:
+ gdk_x11_surface_set_keep_above (surface, g_value_get_boolean (value));
+ g_object_notify_by_pspec (G_OBJECT (surface), pspec);
+ break;
+
+ case PROP_KEEP_BELOW:
+ gdk_x11_surface_set_keep_below (surface, g_value_get_boolean (value));
+ g_object_notify_by_pspec (G_OBJECT (surface), pspec);
+ break;
+
case LAST_TOPLEVEL_PROP + GDK_TOPLEVEL_PROP_TITLE:
gdk_x11_surface_set_title (surface, g_value_get_string (value));
g_object_notify_by_pspec (G_OBJECT (surface), pspec);
@@ -4885,16 +4897,6 @@ gdk_wayland_toplevel_set_property (GObject *object,
g_object_notify_by_pspec (G_OBJECT (surface), pspec);
break;
- case LAST_TOPLEVEL_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);
- break;
-
- case LAST_TOPLEVEL_PROP + GDK_TOPLEVEL_PROP_KEEP_BELOW:
- gdk_x11_surface_set_keep_below (surface, g_value_get_boolean (value));
- g_object_notify_by_pspec (G_OBJECT (surface), pspec);
- break;
-
case LAST_TOPLEVEL_PROP + GDK_TOPLEVEL_PROP_ACCEPT_FOCUS:
gdk_x11_surface_set_accept_focus (surface, g_value_get_boolean (value));
g_object_notify_by_pspec (G_OBJECT (surface), pspec);
@@ -4942,6 +4944,17 @@ gdk_wayland_toplevel_get_property (GObject *object,
g_value_set_boolean (value, impl->toplevel->have_sticky);
break;
+ case PROP_KEEP_ABOVE:
+ g_value_set_boolean (value, (surface->state & GDK_SURFACE_STATE_ABOVE) != 0);
+ break;
+
+ case PROP_KEEP_BELOW:
+ g_value_set_boolean (value, (surface->state & GDK_SURFACE_STATE_BELOW) != 0);
+ break;
+
+ case LAST_TOPLEVEL_PROP + GDK_TOPLEVEL_PROP_ACCEPT_FOCUS:
+ break;
+
case LAST_TOPLEVEL_PROP + GDK_TOPLEVEL_PROP_STATE:
g_value_set_flags (value, surface->state);
break;
@@ -4966,17 +4979,6 @@ gdk_wayland_toplevel_get_property (GObject *object,
g_value_set_pointer (value, NULL);
break;
- case LAST_TOPLEVEL_PROP + GDK_TOPLEVEL_PROP_KEEP_ABOVE:
- g_value_set_boolean (value, (surface->state & GDK_SURFACE_STATE_ABOVE) != 0);
- break;
-
- case LAST_TOPLEVEL_PROP + GDK_TOPLEVEL_PROP_KEEP_BELOW:
- g_value_set_boolean (value, (surface->state & GDK_SURFACE_STATE_BELOW) != 0);
- break;
-
- case LAST_TOPLEVEL_PROP + GDK_TOPLEVEL_PROP_ACCEPT_FOCUS:
- break;
-
case LAST_TOPLEVEL_PROP + GDK_TOPLEVEL_PROP_FOCUS_ON_MAP:
break;
@@ -5022,6 +5024,22 @@ gdk_x11_toplevel_class_init (GdkX11ToplevelClass *class)
FALSE,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
+ g_object_class_install_property (object_class,
+ PROP_KEEP_ABOVE,
+ g_param_spec_boolean ("keep-above",
+ "Keep above",
+ "Whether the surface is on above all other surfaces",
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
+ g_object_class_install_property (object_class,
+ PROP_KEEP_BELOW,
+ g_param_spec_boolean ("keep-below",
+ "Keep below",
+ "Whether the surface is below all other surfaces",
+ FALSE,
+ G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
+
+
gdk_toplevel_install_properties (object_class, LAST_TOPLEVEL_PROP);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]