[gtk/x11-props: 10/10] Drop GdkToplevel:accept-focus/:focus-on-map



commit a6e65d74d9fbb37239212ed7804ec6958897c4c9
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Mar 14 10:06:57 2020 -0400

    Drop GdkToplevel:accept-focus/:focus-on-map
    
    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                  | 50 --------------------------------------
 gdk/gdktoplevel.h                  |  8 ------
 gdk/gdktoplevelprivate.h           |  2 --
 gdk/wayland/gdksurface-wayland.c   | 12 ---------
 gdk/win32/gdksurface-win32.c       | 12 ---------
 gdk/x11/gdksurface-x11.c           | 45 ++++++++++++++++++++++------------
 7 files changed, 30 insertions(+), 111 deletions(-)
---
diff --git a/gdk/broadway/gdksurface-broadway.c b/gdk/broadway/gdksurface-broadway.c
index 4cf1a111b5..8b60438039 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_ACCEPT_FOCUS:
-      break;
-
-    case LAST_PROP + GDK_TOPLEVEL_PROP_FOCUS_ON_MAP:
-      break;
-
     case LAST_PROP + GDK_TOPLEVEL_PROP_DECORATED:
       break;
 
@@ -1542,12 +1536,6 @@ gdk_broadway_toplevel_get_property (GObject    *object,
       g_value_set_pointer (value, NULL);
       break;
 
-    case LAST_PROP + GDK_TOPLEVEL_PROP_ACCEPT_FOCUS:
-      break;
-
-    case LAST_PROP + GDK_TOPLEVEL_PROP_FOCUS_ON_MAP:
-      break;
-
     case LAST_PROP + GDK_TOPLEVEL_PROP_DECORATED:
       break;
 
diff --git a/gdk/gdktoplevel.c b/gdk/gdktoplevel.c
index 4f4f1dace8..35ea7f52f6 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 ("accept-focus",
-                            "Accept focus",
-                            "Whether the surface should accept keyboard focus",
-                            TRUE,
-                            G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
-  g_object_interface_install_property (iface,
-      g_param_spec_boolean ("focus-on-map",
-                            "Focus on map",
-                            "Whether the surface should receive keyboard focus on map",
-                            TRUE,
-                            G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
   g_object_interface_install_property (iface,
       g_param_spec_boolean ("decorated",
                             "Decorated",
@@ -161,8 +149,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_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");
   g_object_class_override_property (object_class, first_prop + GDK_TOPLEVEL_PROP_DELETABLE, "deletable");
   g_object_class_override_property (object_class, first_prop + GDK_TOPLEVEL_PROP_FULLSCREEN_MODE, 
"fullscreen-mode");
@@ -401,42 +387,6 @@ gdk_toplevel_show_window_menu (GdkToplevel *toplevel,
   return GDK_TOPLEVEL_GET_IFACE (toplevel)->show_window_menu (toplevel, event);
 }
 
-/**
- * gdk_toplevel_set_accept_focus:
- * @toplevel: a #GdkToplevel
- * @accept_focus: whether @toplevel should accept keyboard focus
- *
- * Setting @accept_focus to %FALSE hints the desktop environment
- * that the surface doesn’t want to receive input focus.
- */
-void
-gdk_toplevel_set_accept_focus (GdkToplevel *toplevel,
-                               gboolean     accept_focus)
-{
-  g_return_if_fail (GDK_IS_TOPLEVEL (toplevel));
-
-  g_object_set (toplevel, "accept-focus", accept_focus, NULL);
-}
-
-/**
- * gdk_toplevel_set_focus_on_map:
- * @toplevel: a #GdkToplevel
- * @focus_on_map: whether @toplevel should receive input focus when mapped
- *
- * Setting @focus_on_map to %FALSE hints the desktop environment that the
- * surface doesn’t want to receive input focus when it is mapped.
- * focus_on_map should be turned off for surfaces that aren’t triggered
- * interactively (such as popups from network activity).
- */
-void
-gdk_toplevel_set_focus_on_map (GdkToplevel *toplevel,
-                               gboolean     focus_on_map)
-{
-  g_return_if_fail (GDK_IS_TOPLEVEL (toplevel));
-
-  g_object_set (toplevel, "focus-on-map", focus_on_map, NULL);
-}
-
 /**
  * gdk_toplevel_set_decorated:
  * @toplevel: a #GdkToplevel
diff --git a/gdk/gdktoplevel.h b/gdk/gdktoplevel.h
index e1ad1f228e..720d0dea72 100644
--- a/gdk/gdktoplevel.h
+++ b/gdk/gdktoplevel.h
@@ -77,14 +77,6 @@ GDK_AVAILABLE_IN_ALL
 gboolean        gdk_toplevel_show_window_menu   (GdkToplevel       *toplevel,
                                                  GdkEvent          *event);
 
-GDK_AVAILABLE_IN_ALL
-void          gdk_toplevel_set_accept_focus      (GdkToplevel      *toplevel,
-                                                  gboolean          accept_focus);
-
-GDK_AVAILABLE_IN_ALL
-void          gdk_toplevel_set_focus_on_map      (GdkToplevel      *toplevel,
-                                                  gboolean          focus_on_map);
-
 GDK_AVAILABLE_IN_ALL
 void          gdk_toplevel_set_decorated         (GdkToplevel      *toplevel,
                                                   gboolean          decorated);
diff --git a/gdk/gdktoplevelprivate.h b/gdk/gdktoplevelprivate.h
index 92e37b18cd..ac3c5a4ab3 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_ACCEPT_FOCUS,
-  GDK_TOPLEVEL_PROP_FOCUS_ON_MAP,
   GDK_TOPLEVEL_PROP_DECORATED,
   GDK_TOPLEVEL_PROP_DELETABLE,
   GDK_TOPLEVEL_PROP_FULLSCREEN_MODE,
diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c
index a4a421bb90..12f88990c8 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_ACCEPT_FOCUS:
-      break;
-
-    case LAST_PROP + GDK_TOPLEVEL_PROP_FOCUS_ON_MAP:
-      break;
-
     case LAST_PROP + GDK_TOPLEVEL_PROP_DECORATED:
       break;
 
@@ -4407,12 +4401,6 @@ gdk_wayland_toplevel_get_property (GObject    *object,
       g_value_set_pointer (value, NULL);
       break;
 
-    case LAST_PROP + GDK_TOPLEVEL_PROP_ACCEPT_FOCUS:
-      break;
-
-    case LAST_PROP + GDK_TOPLEVEL_PROP_FOCUS_ON_MAP:
-      break;
-
     case LAST_PROP + GDK_TOPLEVEL_PROP_DECORATED:
       break;
 
diff --git a/gdk/win32/gdksurface-win32.c b/gdk/win32/gdksurface-win32.c
index 778c7c75c6..83f4b9a10b 100644
--- a/gdk/win32/gdksurface-win32.c
+++ b/gdk/win32/gdksurface-win32.c
@@ -4907,12 +4907,6 @@ gdk_win32_toplevel_set_property (GObject      *object,
     case LAST_PROP + GDK_TOPLEVEL_PROP_ICON_LIST:
       break;
 
-    case LAST_PROP + GDK_TOPLEVEL_PROP_ACCEPT_FOCUS:
-      break;
-
-    case LAST_PROP + GDK_TOPLEVEL_PROP_FOCUS_ON_MAP:
-      break;
-
     case LAST_PROP + GDK_TOPLEVEL_PROP_DECORATED:
       break;
 
@@ -4960,12 +4954,6 @@ gdk_win32_toplevel_get_property (GObject    *object,
       g_value_set_pointer (value, NULL);
       break;
 
-    case LAST_PROP + GDK_TOPLEVEL_PROP_ACCEPT_FOCUS:
-      break;
-
-    case LAST_PROP + GDK_TOPLEVEL_PROP_FOCUS_ON_MAP:
-      break;
-
     case LAST_PROP + GDK_TOPLEVEL_PROP_DECORATED:
       break;
 
diff --git a/gdk/x11/gdksurface-x11.c b/gdk/x11/gdksurface-x11.c
index 2e1283913e..3b10d47584 100644
--- a/gdk/x11/gdksurface-x11.c
+++ b/gdk/x11/gdksurface-x11.c
@@ -4833,6 +4833,8 @@ enum
   PROP_STICKY = 1,
   PROP_KEEP_ABOVE,
   PROP_KEEP_BELOW,
+  PROP_ACCEPT_FOCUS,
+  PROP_FOCUS_ON_MAP,
   LAST_TOPLEVEL_PROP
 };
 
@@ -4872,6 +4874,16 @@ gdk_wayland_toplevel_set_property (GObject      *object,
       g_object_notify_by_pspec (G_OBJECT (surface), pspec);
       break;
 
+    case PROP_ACCEPT_FOCUS:
+      gdk_x11_surface_set_accept_focus (surface, g_value_get_boolean (value));
+      g_object_notify_by_pspec (G_OBJECT (surface), pspec);
+      break;
+
+    case PROP_FOCUS_ON_MAP:
+      gdk_x11_surface_set_focus_on_map (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);
@@ -4897,16 +4909,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_ACCEPT_FOCUS:
-      gdk_x11_surface_set_accept_focus (surface, g_value_get_boolean (value));
-      g_object_notify_by_pspec (G_OBJECT (surface), pspec);
-      break;
-
-    case LAST_TOPLEVEL_PROP + GDK_TOPLEVEL_PROP_FOCUS_ON_MAP:
-      gdk_x11_surface_set_focus_on_map (surface, g_value_get_boolean (value));
-      g_object_notify_by_pspec (G_OBJECT (surface), pspec);
-      break;
-
     case LAST_TOPLEVEL_PROP + GDK_TOPLEVEL_PROP_DECORATED:
       gdk_x11_surface_set_decorations (surface, g_value_get_boolean (value) ? GDK_DECOR_ALL : 0);
       g_object_notify_by_pspec (G_OBJECT (surface), pspec);
@@ -4952,7 +4954,10 @@ gdk_wayland_toplevel_get_property (GObject    *object,
       g_value_set_boolean (value, (surface->state & GDK_SURFACE_STATE_BELOW) != 0);
       break;
 
-    case LAST_TOPLEVEL_PROP + GDK_TOPLEVEL_PROP_ACCEPT_FOCUS:
+    case PROP_ACCEPT_FOCUS:
+      break;
+
+    case PROP_FOCUS_ON_MAP:
       break;
 
     case LAST_TOPLEVEL_PROP + GDK_TOPLEVEL_PROP_STATE:
@@ -4979,9 +4984,6 @@ gdk_wayland_toplevel_get_property (GObject    *object,
       g_value_set_pointer (value, NULL);
       break;
 
-    case LAST_TOPLEVEL_PROP + GDK_TOPLEVEL_PROP_FOCUS_ON_MAP:
-      break;
-
     case LAST_TOPLEVEL_PROP + GDK_TOPLEVEL_PROP_DECORATED:
       {
         GdkWMDecoration decorations = GDK_DECOR_ALL;
@@ -5038,7 +5040,20 @@ gdk_x11_toplevel_class_init (GdkX11ToplevelClass *class)
                             "Whether the surface is below all other surfaces",
                             FALSE,
                             G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
-
+  g_object_class_install_property (object_class,
+      PROP_ACCEPT_FOCUS,
+      g_param_spec_boolean ("accept-focus",
+                            "Accept focus",
+                            "Whether the surface should accept keyboard focus",
+                            TRUE,
+                            G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
+  g_object_class_install_property (object_class,
+      PROP_FOCUS_ON_MAP,
+      g_param_spec_boolean ("focus-on-map",
+                            "Focus on map",
+                            "Whether the surface should receive keyboard focus on map",
+                            TRUE,
+                            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]