Added _gtk_widget_get_wmclass() internal function

Needed by GtkPlug
This commit is contained in:
Javier Jardón 2010-08-29 18:53:39 +02:00
parent 6250627d9e
commit 304b1a1f56
3 changed files with 21 additions and 3 deletions

View File

@ -33,6 +33,7 @@
#include "gtkintl.h" #include "gtkintl.h"
#include "gtkprivate.h" #include "gtkprivate.h"
#include "gtkplugprivate.h" #include "gtkplugprivate.h"
#include "gtkwindow.h"
/** /**
* SECTION:gtkplug * SECTION:gtkplug
@ -634,16 +635,20 @@ gtk_plug_realize (GtkWidget *widget)
GtkWindow *window = GTK_WINDOW (widget); GtkWindow *window = GTK_WINDOW (widget);
GdkWindow *gdk_window; GdkWindow *gdk_window;
GdkWindowAttr attributes; GdkWindowAttr attributes;
const gchar *title;
gchar *wmclass_name, *wmclass_class;
gint attributes_mask; gint attributes_mask;
gtk_widget_set_realized (widget, TRUE); 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); gtk_widget_get_allocation (widget, &allocation);
attributes.window_type = GDK_WINDOW_CHILD; /* XXX GDK_WINDOW_PLUG ? */ attributes.window_type = GDK_WINDOW_CHILD; /* XXX GDK_WINDOW_PLUG ? */
attributes.title = window->title; attributes.title = (gchar *) title;
attributes.wmclass_name = window->wmclass_name; attributes.wmclass_name = wmclass_name;
attributes.wmclass_class = window->wmclass_class; attributes.wmclass_class = wmclass_class;
attributes.width = allocation.width; attributes.width = allocation.width;
attributes.height = allocation.height; attributes.height = allocation.height;
attributes.wclass = GDK_INPUT_OUTPUT; attributes.wclass = GDK_INPUT_OUTPUT;

View File

@ -8784,3 +8784,12 @@ gtk_window_set_mnemonics_visible (GtkWindow *window,
priv->mnemonics_visible_set = TRUE; 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;
}

View File

@ -433,6 +433,10 @@ void _gtk_window_set_is_active (GtkWindow *window,
void _gtk_window_set_is_toplevel (GtkWindow *window, void _gtk_window_set_is_toplevel (GtkWindow *window,
gboolean is_toplevel); gboolean is_toplevel);
void _gtk_window_get_wmclass (GtkWindow *window,
gchar **wmclass_name,
gchar **wmclass_class);
typedef void (*GtkWindowKeysForeachFunc) (GtkWindow *window, typedef void (*GtkWindowKeysForeachFunc) (GtkWindow *window,
guint keyval, guint keyval,
GdkModifierType modifiers, GdkModifierType modifiers,