[gtk+] wayland: Set title on shell surfaces to window title



commit 89b1947631f5721c88abd8d44023072efaca384b
Author: Scott Moreau <oreaus gmail com>
Date:   Sat Mar 16 17:57:17 2013 -0600

    wayland: Set title on shell surfaces to window title
    
    We currently use this information to display the title
    string in the window list of the desktop shell.
    
    Signed-off-by: Rob Bradford <rob linux intel com>

 gdk/wayland/gdkwindow-wayland.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index 6f7e744..a0ae294 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -115,6 +115,8 @@ struct _GdkWindowImplWayland
    */
   cairo_surface_t *server_surface;
 
+  gchar *title;
+
   uint32_t resize_edges;
 
   int focus_count;
@@ -282,6 +284,8 @@ _gdk_wayland_display_create_window_impl (GdkDisplay    *display,
 
   g_object_ref (window);
 
+  impl->title = NULL;
+
   switch (GDK_WINDOW_TYPE (window))
     {
     case GDK_WINDOW_TOPLEVEL:
@@ -727,6 +731,9 @@ gdk_wayland_window_show (GdkWindow *window, gboolean already_mapped)
 
   if (impl->cairo_surface)
     gdk_wayland_window_attach_image (window);
+
+  if (impl->shell_surface && impl->title)
+    wl_shell_surface_set_title (impl->shell_surface, impl->title);
 }
 
 static void
@@ -1158,10 +1165,15 @@ static void
 gdk_wayland_window_set_title (GdkWindow   *window,
                              const gchar *title)
 {
+  GdkWindowImplWayland *impl;
   g_return_if_fail (title != NULL);
 
   if (GDK_WINDOW_DESTROYED (window))
     return;
+
+  impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+
+  impl->title = strdup (title);
 }
 
 static void


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