Merge lp:~3v1n0/ubuntu/oneiric/libwnck/fix-800946 into lp:~ubuntu-desktop/libwnck/ubuntu

Proposed by Marco Trevisan (Treviño)
Status: Rejected
Rejected by: Sebastien Bacher
Proposed branch: lp:~3v1n0/ubuntu/oneiric/libwnck/fix-800946
Merge into: lp:~ubuntu-desktop/libwnck/ubuntu
Diff against target: 178 lines (+158/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/03_Added_APIs_to_get_WM_CLASS_group_name_and_instance_name.patch (+150/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~3v1n0/ubuntu/oneiric/libwnck/fix-800946
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Abstain
Michael Vogt Needs Fixing
Review via email: mp+65659@code.launchpad.net

Description of the change

Added the patch to fix the bug #800946

To post a comment you must log in.
Revision history for this message
Michael Vogt (mvo) wrote :

The patch itself looks fine, but we should make sure that upstream also has it in order to avoid incompatible APIs.

Revision history for this message
Michael Vogt (mvo) wrote :

<vuntz> seb128: Trevinho and I discussed the patch and agreed on naming, he'll update the patch soon

Setting to "needs fixing" until this update happend.

review: Needs Fixing
41. By Marco Trevisan (Treviño)

Updated the libwnck WM_CLASS APIs patch accordingly to the lib developers

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Patch updated according to what Vuntz told me. ;)

review: Needs Resubmitting
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) :
review: Abstain
Revision history for this message
Sebastien Bacher (seb128) wrote :

setting to rejected, that got upstream and is going to land in Oneiric with the new version of the library

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

Ok, this is cool reject! :P

Unmerged revisions

41. By Marco Trevisan (Treviño)

Updated the libwnck WM_CLASS APIs patch accordingly to the lib developers

40. By Marco Trevisan (Treviño)

Add support for WM_CLASS instance getter API

See Launchpad bug #800946 for more informations.

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 2011-06-07 18:45:49 +0000
3+++ debian/changelog 2011-07-30 01:41:34 +0000
4@@ -1,3 +1,10 @@
5+libwnck (1:2.30.6-0ubuntu5) oneiric; urgency=low
6+
7+ * debian/patches/03_Added_APIs_to_get_WM_CLASS_group_name_and_instance_name.patch
8+ - Add support for WM_CLASS instance getter API (LP: #800946)
9+
10+ -- Marco Trevisan (Treviño) <mail@3v1n0.net> Sat, 30 Jul 2011 03:38:44 +0200
11+
12 libwnck (1:2.30.6-0ubuntu4) oneiric; urgency=low
13
14 * debian/libwnck-dev.install:
15
16=== added file 'debian/patches/03_Added_APIs_to_get_WM_CLASS_group_name_and_instance_name.patch'
17--- debian/patches/03_Added_APIs_to_get_WM_CLASS_group_name_and_instance_name.patch 1970-01-01 00:00:00 +0000
18+++ debian/patches/03_Added_APIs_to_get_WM_CLASS_group_name_and_instance_name.patch 2011-07-30 01:41:34 +0000
19@@ -0,0 +1,150 @@
20+From 45504d9b179244892aab7b35de9013a92b03cbe4 Mon Sep 17 00:00:00 2001
21+From: =?UTF-8?q?"Marco=20Trevisan=20(Trevi=C3=B1o)"?= <mail@3v1n0.net>
22+Date: Sat, 30 Jul 2011 03:27:17 +0200
23+Subject: [PATCH] Added APIs to get WM_CLASS group name and instance name of a
24+ wnkWindow
25+
26+The old private getters for getting a window WM_CLASS name or WM_CLASS are now in
27+wnck_window_get_class_group_name and wnck_window_get_class_instance_name
28+
29+With the previous libwnck implementation was impossible to retrive the wm_class
30+instance, but only the class name (and just using a redundant Group-class struct)
31+Now, for each window is possible to get also its WM_CLASS instance name that could
32+differ for special windows or for sub-applications (i.e. chromium web-apps).
33+
34+This patch includes also an improvement to wnckprop, that now prints out also
35+the window class instance.
36+---
37+ libwnck/private.h | 3 ---
38+ libwnck/screen.c | 2 +-
39+ libwnck/tasklist.c | 4 ++--
40+ libwnck/window.c | 26 ++++++++++++++++++++++++--
41+ libwnck/window.h | 5 ++++-
42+ libwnck/wnckprop.c | 8 ++++++++
43+ 6 files changed, 39 insertions(+), 9 deletions(-)
44+
45+diff --git a/libwnck/private.h b/libwnck/private.h
46+index 97207fd..b4d6572 100644
47+--- a/libwnck/private.h
48++++ b/libwnck/private.h
49+@@ -61,9 +61,6 @@ char* _wnck_window_get_name_for_display (WnckWindow *window,
50+ gboolean use_state_decorations);
51+ const char* _wnck_window_get_startup_id (WnckWindow *window);
52+
53+-const char* _wnck_window_get_resource_class (WnckWindow *window);
54+-const char* _wnck_window_get_resource_name (WnckWindow *window);
55+-
56+ time_t _wnck_window_get_needs_attention_time (WnckWindow *window);
57+ time_t _wnck_window_or_transient_get_needs_attention_time (WnckWindow *window);
58+
59+diff --git a/libwnck/screen.c b/libwnck/screen.c
60+index 07d66cf..fabbac0 100644
61+--- a/libwnck/screen.c
62++++ b/libwnck/screen.c
63+@@ -1530,7 +1530,7 @@ update_client_list (WnckScreen *screen)
64+
65+ /* Class group */
66+
67+- res_class = _wnck_window_get_resource_class (window);
68++ res_class = wnck_window_get_class_group_name (window);
69+
70+ class_group = wnck_class_group_get (res_class);
71+ if (class_group == NULL)
72+diff --git a/libwnck/tasklist.c b/libwnck/tasklist.c
73+index 7e74d47..bf887cc 100644
74+--- a/libwnck/tasklist.c
75++++ b/libwnck/tasklist.c
76+@@ -4228,8 +4228,8 @@ wnck_tasklist_check_end_sequence (WnckTasklist *tasklist,
77+ if (tasklist->priv->startup_sequences == NULL)
78+ return;
79+
80+- res_class = _wnck_window_get_resource_class (window);
81+- res_name = _wnck_window_get_resource_name (window);
82++ res_class = wnck_window_get_class_group_name (window);
83++ res_name = wnck_window_get_class_instance_name (window);
84+
85+ if (res_class == NULL && res_name == NULL)
86+ return;
87+diff --git a/libwnck/window.c b/libwnck/window.c
88+index a6fcb81..ced342d 100644
89+--- a/libwnck/window.c
90++++ b/libwnck/window.c
91+@@ -1172,16 +1172,38 @@ _wnck_window_get_startup_id (WnckWindow *window)
92+ return window->priv->startup_id;
93+ }
94+
95++/**
96++ * wnck_window_get_class_group_name:
97++ * @window: a #WnckWindow.
98++ *
99++ * Gets class group name parameter of the <ulink
100++ * url="http://tronche.com/gui/x/icccm/sec-4.html&num;WM_CLASS">WM_CLASS Property</ulink>
101++ * for the window @window.
102++ * Note that using this function is actually like doing wnck_window_get_class_group()
103++ * and then wnck_class_group_get_res_class()
104++ *
105++ * Return value: the class name for @window, or %NULL if @window has no class.
106++ **/
107+ const char*
108+-_wnck_window_get_resource_class (WnckWindow *window)
109++wnck_window_get_class_group_name (WnckWindow *window)
110+ {
111+ g_return_val_if_fail (WNCK_IS_WINDOW (window), NULL);
112+
113+ return window->priv->res_class;
114+ }
115+
116++/**
117++ * wnck_window_get_class_instance_name:
118++ * @window: a #WnckWindow.
119++ *
120++ * Gets class instance name parameter of the <ulink
121++ * url="http://tronche.com/gui/x/icccm/sec-4.html&num;WM_CLASS">WM_CLASS Property</ulink>
122++ * for the window @window.
123++ *
124++ * Return value: the class instance for @window, or %NULL if @window has no class instance.
125++ **/
126+ const char*
127+-_wnck_window_get_resource_name (WnckWindow *window)
128++wnck_window_get_class_instance_name (WnckWindow *window)
129+ {
130+ g_return_val_if_fail (WNCK_IS_WINDOW (window), NULL);
131+
132+diff --git a/libwnck/window.h b/libwnck/window.h
133+index 673f44a..dbdb529 100644
134+--- a/libwnck/window.h
135++++ b/libwnck/window.h
136+@@ -299,7 +299,10 @@ WnckWindow* wnck_window_get_transient (WnckWindow *window);
137+ gulong wnck_window_get_group_leader (WnckWindow *window);
138+ gulong wnck_window_get_xid (WnckWindow *window);
139+
140+-WnckClassGroup *wnck_window_get_class_group (WnckWindow *window);
141++WnckClassGroup *wnck_window_get_class_group (WnckWindow *window);
142++
143++const char* wnck_window_get_class_group_name (WnckWindow *window);
144++const char* wnck_window_get_class_instance_name (WnckWindow *window);
145+
146+ const char* wnck_window_get_session_id (WnckWindow *window);
147+ const char* wnck_window_get_session_id_utf8 (WnckWindow *window);
148+diff --git a/libwnck/wnckprop.c b/libwnck/wnckprop.c
149+index 81810fd..b8f363d 100644
150+--- a/libwnck/wnckprop.c
151++++ b/libwnck/wnckprop.c
152+@@ -1507,6 +1507,14 @@ print_window (WnckWindow *window)
153+ * same class. */
154+ g_print (_("Class Group: %s\n"), buf);
155+
156++ if (wnck_window_get_class_instance_name (window))
157++ buf = wnck_window_get_class_instance_name (window);
158++ else
159++ /* Translators: 'unset' in the sense of "something has not been set". */
160++ buf = _("<unset>");
161++
162++ g_print (_("Class Instance: %s\n"), buf);
163++
164+ g_print (_("XID: %lu\n"), wnck_window_get_xid (window));
165+
166+ if (wnck_window_get_pid (window) != 0)
167+--
168+1.7.5.4
169+
170
171=== modified file 'debian/patches/series'
172--- debian/patches/series 2011-01-04 06:20:37 +0000
173+++ debian/patches/series 2011-07-30 01:41:34 +0000
174@@ -1,3 +1,4 @@
175 01_tasklist_orientation.patch
176 02_moveresize_static_gravity.patch
177+03_Added_APIs_to_get_WM_CLASS_group_name_and_instance_name.patch
178 99_ltmain_as-needed.patch

Subscribers

People subscribed via source and target branches