[gtk+] Added _gtk_widget_get_wmclass() internal function



commit 304b1a1f5668c167f3c45e9262db7cbb4b57c027
Author: Javier Jardón <jjardon gnome org>
Date:   Sun Aug 29 18:53:39 2010 +0200

    Added _gtk_widget_get_wmclass() internal function
    
    Needed by GtkPlug

 gtk/gtkplug.c   |   11 ++++++++---
 gtk/gtkwindow.c |    9 +++++++++
 gtk/gtkwindow.h |    4 ++++
 3 files changed, 21 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkplug.c b/gtk/gtkplug.c
index 79554c2..96f274a 100644
--- a/gtk/gtkplug.c
+++ b/gtk/gtkplug.c
@@ -33,6 +33,7 @@
 #include "gtkintl.h"
 #include "gtkprivate.h"
 #include "gtkplugprivate.h"
+#include "gtkwindow.h"
 
 /**
  * SECTION:gtkplug
@@ -634,16 +635,20 @@ gtk_plug_realize (GtkWidget *widget)
   GtkWindow *window = GTK_WINDOW (widget);
   GdkWindow *gdk_window;
   GdkWindowAttr attributes;
+  const gchar *title;
+  gchar *wmclass_name, *wmclass_class;
   gint attributes_mask;
 
   gtk_widget_set_realized (widget, TRUE);
 
+  title = gtk_window_get_title (window);
+  _gtk_window_get_wmclass (window, &wmclass_name, &wmclass_class);
   gtk_widget_get_allocation (widget, &allocation);
 
   attributes.window_type = GDK_WINDOW_CHILD;	/* XXX GDK_WINDOW_PLUG ? */
-  attributes.title = window->title;
-  attributes.wmclass_name = window->wmclass_name;
-  attributes.wmclass_class = window->wmclass_class;
+  attributes.title = (gchar *) title;
+  attributes.wmclass_name = wmclass_name;
+  attributes.wmclass_class = wmclass_class;
   attributes.width = allocation.width;
   attributes.height = allocation.height;
   attributes.wclass = GDK_INPUT_OUTPUT;
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index b6095bb..5fa4e35 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -8784,3 +8784,12 @@ gtk_window_set_mnemonics_visible (GtkWindow *window,
 
   priv->mnemonics_visible_set = TRUE;
 }
+
+void
+_gtk_window_get_wmclass (GtkWindow  *window,
+                         gchar     **wmclass_name,
+                         gchar     **wmclass_class)
+{
+  *wmclass_name = window->wmclass_name;
+  *wmclass_class = window->wmclass_class;
+}
diff --git a/gtk/gtkwindow.h b/gtk/gtkwindow.h
index b9ba108..7631ea9 100644
--- a/gtk/gtkwindow.h
+++ b/gtk/gtkwindow.h
@@ -433,6 +433,10 @@ void            _gtk_window_set_is_active          (GtkWindow *window,
 void            _gtk_window_set_is_toplevel        (GtkWindow *window,
 						    gboolean   is_toplevel);
 
+void            _gtk_window_get_wmclass            (GtkWindow  *window,
+                                                    gchar     **wmclass_name,
+                                                    gchar     **wmclass_class);
+
 typedef void (*GtkWindowKeysForeachFunc) (GtkWindow      *window,
 					  guint           keyval,
 					  GdkModifierType modifiers,



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