diff options
author | Benjamin Otte <otte@redhat.com> | 2016-09-29 22:23:51 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2016-10-16 18:17:21 +0200 |
commit | 2fd5048943fdb3e9ceccb77fdd4839ad217c5b08 (patch) | |
tree | d851bf8bd09f262997c2a8573c18f5c867c9f65a /gtk | |
parent | fe24fcbc3e71bcf7e222a4106bf6e3f7ec114e28 (diff) | |
download | gtk+-2fd5048943fdb3e9ceccb77fdd4839ad217c5b08.tar.gz |
API: window: Remove suppport for changing wmclass_name/group
X11 was the only backend to support it and people can just override it
using XSetClassHint() directly.
The docs already advertised the function as "Do not use".
Keep the existing call to XSetClassHint() in place, so that we keep
setting the same values as in GTK3.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkplug.c | 5 | ||||
-rw-r--r-- | gtk/gtkwin32embedwidget.c | 2 | ||||
-rw-r--r-- | gtk/gtkwindow.c | 57 | ||||
-rw-r--r-- | gtk/gtkwindow.h | 4 | ||||
-rw-r--r-- | gtk/gtkwindowprivate.h | 4 |
5 files changed, 0 insertions, 72 deletions
diff --git a/gtk/gtkplug.c b/gtk/gtkplug.c index 4e72543baa..de56b4234d 100644 --- a/gtk/gtkplug.c +++ b/gtk/gtkplug.c @@ -1009,7 +1009,6 @@ gtk_plug_realize (GtkWidget *widget) GdkWindow *gdk_window; GdkWindowAttr attributes; const gchar *title; - gchar *wmclass_name, *wmclass_class; gint attributes_mask; GdkScreen *screen; @@ -1020,13 +1019,10 @@ gtk_plug_realize (GtkWidget *widget) g_warning ("GtkPlug only works under X11"); 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 = (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; @@ -1044,7 +1040,6 @@ gtk_plug_realize (GtkWidget *widget) attributes_mask = GDK_WA_VISUAL; attributes_mask |= (title ? GDK_WA_TITLE : 0); - attributes_mask |= (wmclass_name ? GDK_WA_WMCLASS : 0); if (gtk_widget_is_toplevel (widget)) { diff --git a/gtk/gtkwin32embedwidget.c b/gtk/gtkwin32embedwidget.c index c4e6aff897..f6ddfa1b96 100644 --- a/gtk/gtkwin32embedwidget.c +++ b/gtk/gtkwin32embedwidget.c @@ -203,7 +203,6 @@ gtk_win32_embed_widget_realize (GtkWidget *widget) attributes.window_type = GDK_WINDOW_CHILD; attributes.title = (gchar *) gtk_window_get_title (window); - _gtk_window_get_wmclass (window, &attributes.wmclass_name, &attributes.wmclass_class); attributes.width = allocation.width; attributes.height = allocation.height; attributes.wclass = GDK_INPUT_OUTPUT; @@ -222,7 +221,6 @@ gtk_win32_embed_widget_realize (GtkWidget *widget) attributes_mask = GDK_WA_VISUAL; attributes_mask |= (attributes.title ? GDK_WA_TITLE : 0); - attributes_mask |= (attributes.wmclass_name ? GDK_WA_WMCLASS : 0); gdk_window = gdk_window_new (embed_widget->parent_window, &attributes, attributes_mask); diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 937d42b758..205f471b62 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -192,8 +192,6 @@ struct _GtkWindowPrivate gchar *startup_id; gchar *title; - gchar *wmclass_class; - gchar *wmclass_name; gchar *wm_role; guint keys_changed_handler; @@ -1649,8 +1647,6 @@ gtk_window_init (GtkWindow *window) gtk_container_set_default_resize_mode (GTK_CONTAINER (window), GTK_RESIZE_QUEUE); priv->title = NULL; - priv->wmclass_name = g_strdup (g_get_prgname ()); - priv->wmclass_class = g_strdup (gdk_get_program_class ()); priv->wm_role = NULL; priv->geometry_info = NULL; priv->type = GTK_WINDOW_TOPLEVEL; @@ -2382,43 +2378,6 @@ gtk_window_get_title (GtkWindow *window) } /** - * gtk_window_set_wmclass: - * @window: a #GtkWindow - * @wmclass_name: window name hint - * @wmclass_class: window class hint - * - * Don’t use this function. It sets the X Window System “class” and - * “name” hints for a window. According to the ICCCM, you should - * always set these to the same value for all windows in an - * application, and GTK+ sets them to that value by default, so calling - * this function is sort of pointless. However, you may want to call - * gtk_window_set_role() on each window in your application, for the - * benefit of the session manager. Setting the role allows the window - * manager to restore window positions when loading a saved session. - * - **/ -void -gtk_window_set_wmclass (GtkWindow *window, - const gchar *wmclass_name, - const gchar *wmclass_class) -{ - GtkWindowPrivate *priv; - - g_return_if_fail (GTK_IS_WINDOW (window)); - - priv = window->priv; - - g_free (priv->wmclass_name); - priv->wmclass_name = g_strdup (wmclass_name); - - g_free (priv->wmclass_class); - priv->wmclass_class = g_strdup (wmclass_class); - - if (_gtk_widget_get_realized (GTK_WIDGET (window))) - g_warning ("gtk_window_set_wmclass: shouldn't set wmclass after window is realized!"); -} - -/** * gtk_window_set_role: * @window: a #GtkWindow * @role: unique identifier for the window to be used when restoring a session @@ -5820,8 +5779,6 @@ gtk_window_finalize (GObject *object) GtkMnemonicHash *mnemonic_hash; g_free (priv->title); - g_free (priv->wmclass_name); - g_free (priv->wmclass_class); g_free (priv->wm_role); gtk_window_release_application (window); @@ -7139,8 +7096,6 @@ gtk_window_realize (GtkWidget *widget) #endif attributes.title = priv->title; - attributes.wmclass_name = priv->wmclass_name; - attributes.wmclass_class = priv->wmclass_class; attributes.wclass = GDK_INPUT_OUTPUT; attributes.visual = gtk_widget_get_visual (widget); @@ -7169,7 +7124,6 @@ gtk_window_realize (GtkWidget *widget) attributes_mask |= GDK_WA_VISUAL | GDK_WA_TYPE_HINT; attributes_mask |= (priv->title ? GDK_WA_TITLE : 0); - attributes_mask |= (priv->wmclass_name ? GDK_WA_WMCLASS : 0); gdk_window = gdk_window_new (parent_window, &attributes, attributes_mask); } @@ -11553,17 +11507,6 @@ gtk_window_set_focus_visible (GtkWindow *window, } } -void -_gtk_window_get_wmclass (GtkWindow *window, - gchar **wmclass_name, - gchar **wmclass_class) -{ - GtkWindowPrivate *priv = window->priv; - - *wmclass_name = priv->wmclass_name; - *wmclass_class = priv->wmclass_class; -} - /** * gtk_window_set_has_user_ref_count: * @window: a #GtkWindow diff --git a/gtk/gtkwindow.h b/gtk/gtkwindow.h index 34b7681376..1f1197a135 100644 --- a/gtk/gtkwindow.h +++ b/gtk/gtkwindow.h @@ -151,10 +151,6 @@ void gtk_window_set_title (GtkWindow *window, GDK_AVAILABLE_IN_ALL const gchar * gtk_window_get_title (GtkWindow *window); GDK_AVAILABLE_IN_ALL -void gtk_window_set_wmclass (GtkWindow *window, - const gchar *wmclass_name, - const gchar *wmclass_class); -GDK_AVAILABLE_IN_ALL void gtk_window_set_role (GtkWindow *window, const gchar *role); GDK_AVAILABLE_IN_ALL diff --git a/gtk/gtkwindowprivate.h b/gtk/gtkwindowprivate.h index 5cb5a72db2..20dbbda2a6 100644 --- a/gtk/gtkwindowprivate.h +++ b/gtk/gtkwindowprivate.h @@ -57,10 +57,6 @@ 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); - void _gtk_window_set_allocation (GtkWindow *window, const GtkAllocation *allocation, GtkAllocation *allocation_out); |