Merge lp:~larsu/gtk/lp1443273 into lp:~ubuntu-desktop/gtk/ubuntugtk3

Proposed by Lars Karlitski
Status: Merged
Approved by: Didier Roche-Tolomelli
Approved revision: 423
Merged at revision: 423
Proposed branch: lp:~larsu/gtk/lp1443273
Merge into: lp:~ubuntu-desktop/gtk/ubuntugtk3
Diff against target: 84 lines (+64/-0)
3 files modified
debian/changelog (+8/-0)
debian/patches/allow-overriding-WM_CLASS-from-the-command-line.patch (+55/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~larsu/gtk/lp1443273
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli Approve
Review via email: mp+255930@code.launchpad.net

Description of the change

Allow overriding WM_CLASS from the command line

Even when the program itself calls gdk_set_program_class(). There's currently no way for this function to be called without breaking gdk's --class command line option, because you cannot call it before gtk_init().

To post a comment you must log in.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

Looking good to me, works for my use case at least, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2015-04-13 06:07:25 +0000
3+++ debian/changelog 2015-04-13 06:43:15 +0000
4@@ -1,3 +1,11 @@
5+gtk+3.0 (3.14.12-0ubuntu2) UNRELEASED; urgency=medium
6+
7+ * debian/patches/allow-overriding-WM_CLASS-from-the-command-line.patch:
8+ support --class even when the program calls gdk_set_program_class().
9+ Needed for gnome-terminal profile-as-app backwards compat (LP: #1443273)
10+
11+ -- Lars Uebernickel <lars.uebernickel@ubuntu.com> Mon, 13 Apr 2015 08:31:13 +0200
12+
13 gtk+3.0 (3.14.12-0ubuntu1) vivid; urgency=medium
14
15 * New upstream release 3.14.12, fixing bugs:
16
17=== added file 'debian/patches/allow-overriding-WM_CLASS-from-the-command-line.patch'
18--- debian/patches/allow-overriding-WM_CLASS-from-the-command-line.patch 1970-01-01 00:00:00 +0000
19+++ debian/patches/allow-overriding-WM_CLASS-from-the-command-line.patch 2015-04-13 06:43:15 +0000
20@@ -0,0 +1,55 @@
21+From f261b3d59fd9ac1adb044457ec98a622fca1e3c0 Mon Sep 17 00:00:00 2001
22+From: Lars Uebernickel <lars.uebernickel@canonical.com>
23+Date: Fri, 10 Apr 2015 17:18:50 +0200
24+Subject: [PATCH] Allow overriding WM_CLASS from the command line
25+
26+Even when the program itself calls gdk_set_program_class(). There's
27+currently no way for this function to be called without breaking gdk's
28+--class command line option, because you cannot call it before
29+gtk_init().
30+
31+https://bugzilla.gnome.org/show_bug.cgi?id=747634
32+---
33+ gdk/gdk.c | 8 ++++++++
34+ 1 file changed, 8 insertions(+)
35+
36+diff --git a/gdk/gdk.c b/gdk/gdk.c
37+index 81f5427..c416abf 100644
38+--- a/gdk/gdk.c
39++++ b/gdk/gdk.c
40+@@ -128,6 +128,7 @@ static int gdk_initialized = 0; /* 1 if the library is initi
41+ */
42+
43+ static gchar *gdk_progclass = NULL;
44++static gboolean gdk_progclass_overridden;
45+
46+ static GMutex gdk_threads_mutex;
47+
48+@@ -196,6 +197,7 @@ static gboolean
49+ gdk_arg_class_cb (const char *key, const char *value, gpointer user_data, GError **error)
50+ {
51+ gdk_set_program_class (value);
52++ gdk_progclass_overridden = TRUE;
53+
54+ return TRUE;
55+ }
56+@@ -962,10 +964,16 @@ gdk_get_program_class (void)
57+ * Sets the program class. The X11 backend uses the program class to set
58+ * the class name part of the `WM_CLASS` property on
59+ * toplevel windows; see the ICCCM.
60++ *
61++ * The program class can still be overridden with the --class command
62++ * line option.
63+ */
64+ void
65+ gdk_set_program_class (const char *program_class)
66+ {
67++ if (gdk_progclass_overridden)
68++ return;
69++
70+ g_free (gdk_progclass);
71+
72+ gdk_progclass = g_strdup (program_class);
73+--
74+2.1.4
75+
76
77=== modified file 'debian/patches/series'
78--- debian/patches/series 2015-04-13 06:06:44 +0000
79+++ debian/patches/series 2015-04-13 06:43:15 +0000
80@@ -23,3 +23,4 @@
81 mir-backend-unmerged.patch
82 0001-gtk-reftest-Force-icon-theme-to-Adwaita.patch
83 0001-GtkApplication-Prevent-more-crashes-around-shutdown.patch
84+allow-overriding-WM_CLASS-from-the-command-line.patch

Subscribers

People subscribed via source and target branches

to all changes: