[gtk/present-toplevel-2: 50/71] implement new toplevel api



commit 50470d7c2ea6721c6037e016ce93b2d0119e460f
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Mar 3 10:05:26 2020 -0800

    implement new toplevel api

 gdk/gdksurface.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index 3dbd06b0a6..22122d2d29 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -2091,6 +2091,17 @@ gdk_toplevel_surface_minimize (GdkToplevel *toplevel)
   return TRUE;
 }
 
+static void
+gdk_toplevel_surface_focus (GdkToplevel *toplevel,
+                            guint32      timestamp)
+{
+  GdkSurface *surface = GDK_SURFACE (toplevel);
+
+  g_return_if_fail (surface->surface_type == GDK_SURFACE_TOPLEVEL);
+  
+  GDK_SURFACE_GET_CLASS (surface)->focus (surface, timestamp);
+}
+
 static gboolean
 gdk_toplevel_surface_show_window_menu (GdkToplevel *toplevel,
                                        GdkEvent    *event)
@@ -2107,6 +2118,7 @@ gdk_surface_toplevel_init (GdkToplevelInterface *iface)
 {
   iface->present = gdk_toplevel_surface_present;
   iface->minimize = gdk_toplevel_surface_minimize;
+  iface->focus = gdk_toplevel_surface_focus;
   iface->show_window_menu = gdk_toplevel_surface_show_window_menu;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]