Merge lp:~laney/notify-osd/no-dnd-screensaver-test into lp:notify-osd

Proposed by Iain Lane
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 493
Merged at revision: 495
Proposed branch: lp:~laney/notify-osd/no-dnd-screensaver-test
Merge into: lp:notify-osd
Diff against target: 231 lines (+76/-59)
5 files modified
debian/changelog (+17/-0)
src/bubble.c (+6/-1)
src/dnd.c (+52/-41)
src/dnd.h (+1/-1)
tests/test-dnd.c (+0/-16)
To merge this branch: bzr merge lp:~laney/notify-osd/no-dnd-screensaver-test
Reviewer Review Type Date Requested Status
Sebastien Bacher Approve
Indicator Applet Developers Pending
Review via email: mp+274367@code.launchpad.net

Commit message

Don't run test_dnd_screensaver - we can't dbus activate gnome-session and it's not practical to run a full session in autopkgtest currently

Description of the change

Since we now run under gnome-session, which is not dbus activatable, we can't run this test in headless environments any more...

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

gut!

review: Approve
494. By Iain Lane

Merge the wily-proposed branch

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-10-05 14:27:28 +0000
3+++ debian/changelog 2015-10-14 09:48:39 +0000
4@@ -1,3 +1,13 @@
5+notify-osd (0.9.35+15.10.20151013.1-0ubuntu1) wily; urgency=medium
6+
7+ [ CI Train Bot ]
8+ * New rebuild forced.
9+
10+ [ Lars Uebernickel ]
11+ * Only request rgba visuals on composited screens (LP: #1473269)
12+
13+ -- Sebastien Bacher <seb128@ubuntu.com> Tue, 13 Oct 2015 15:50:35 +0000
14+
15 notify-osd (0.9.35+15.10.20151005-0ubuntu1) wily; urgency=medium
16
17 * Remove leftover debug statement and fix identation issue
18@@ -11,6 +21,13 @@
19
20 -- Sebastien Bacher <seb128@ubuntu.com> Tue, 15 Sep 2015 09:24:19 +0000
21
22+notify-osd (0.9.35+15.04.20150126-0ubuntu2) UNRELEASED; urgency=medium
23+
24+ * dnd_is_screensaver_inhibited no longer works due to obsoleted dbus
25+ method. replace it by an equivalent dbus call, LP: #1440825
26+
27+ -- Nobuto Murata <nobuto@ubuntu.com> Tue, 07 Apr 2015 17:47:18 +0900
28+
29 notify-osd (0.9.35+15.04.20150126-0ubuntu1) vivid; urgency=low
30
31 [ Alberts Muktupāvels ]
32
33=== modified file 'src/bubble.c'
34--- src/bubble.c 2015-09-22 15:59:50 +0000
35+++ src/bubble.c 2015-10-14 09:48:39 +0000
36@@ -1643,7 +1643,12 @@
37 gpointer data)
38 {
39 GdkScreen* screen = gtk_widget_get_screen (GTK_WIDGET (window));
40- GdkVisual* visual = gdk_screen_get_rgba_visual (screen);
41+ GdkVisual* visual;
42+
43+ if (!gdk_screen_is_composited (screen))
44+ return;
45+
46+ visual = gdk_screen_get_rgba_visual (screen);
47
48 if (!visual)
49 visual = gdk_screen_get_system_visual (screen);
50
51=== modified file 'src/dnd.c'
52--- src/dnd.c 2012-01-24 08:14:04 +0000
53+++ src/dnd.c 2015-10-14 09:48:39 +0000
54@@ -45,6 +45,7 @@
55 #include "dbus.h"
56
57 static DBusGProxy *gsmgr = NULL;
58+static DBusGProxy *gscrsvr = NULL;
59
60 gboolean
61 dnd_is_xscreensaver_active ()
62@@ -98,55 +99,65 @@
63 }
64
65 static DBusGProxy*
66-get_screensaver_proxy (void)
67+get_gnomesession_proxy (void)
68 {
69 if (gsmgr == NULL)
70 {
71 DBusGConnection *connection = dbus_get_connection ();
72 gsmgr = dbus_g_proxy_new_for_name (connection,
73+ "org.gnome.SessionManager",
74+ "/org/gnome/SessionManager",
75+ "org.gnome.SessionManager");
76+ }
77+
78+ return gsmgr;
79+}
80+
81+gboolean
82+dnd_is_idle_inhibited ()
83+{
84+ GError *error = NULL;
85+ gboolean inhibited = FALSE;
86+ guint idle = 8; // 8: Inhibit the session being marked as idle
87+
88+ if (! get_gnomesession_proxy ())
89+ return FALSE;
90+
91+ dbus_g_proxy_call_with_timeout (
92+ gsmgr, "IsInhibited", 2000, &error,
93+ G_TYPE_UINT, idle,
94+ G_TYPE_INVALID,
95+ G_TYPE_BOOLEAN, &inhibited,
96+ G_TYPE_INVALID);
97+
98+ if (error)
99+ {
100+ g_warning ("dnd_is_idle_inhibited(): "
101+ "got error \"%s\"\n",
102+ error->message);
103+ g_error_free (error);
104+ error = NULL;
105+ }
106+
107+ if (inhibited)
108+ g_debug ("Session idleness has been inhibited");
109+
110+ return inhibited;
111+}
112+
113+static DBusGProxy*
114+get_screensaver_proxy (void)
115+{
116+ if (gscrsvr == NULL)
117+ {
118+ DBusGConnection *connection = dbus_get_connection ();
119+ gscrsvr = dbus_g_proxy_new_for_name (connection,
120 "org.gnome.ScreenSaver",
121 "/org/gnome/ScreenSaver",
122 "org.gnome.ScreenSaver");
123 }
124
125- return gsmgr;
126-}
127-
128-gboolean
129-dnd_is_screensaver_inhibited ()
130-{
131- GError *error = NULL;
132- gboolean inhibited = FALSE;
133- char **list;
134-
135- if (! get_screensaver_proxy ())
136- return FALSE;
137-
138- if (dbus_g_proxy_call_with_timeout (
139- gsmgr, "GetInhibitors", 2000, &error,
140- G_TYPE_INVALID,
141- G_TYPE_STRV, &list,
142- G_TYPE_INVALID))
143- {
144- if (error)
145- {
146- g_warning ("dnd_is_screensaver_inhibited(): "
147- "got error \"%s\"\n",
148- error->message);
149- g_error_free (error);
150- error = NULL;
151- }
152-
153- /* if the list is not empty, the screensaver is inhibited */
154- if (*list)
155- {
156- inhibited = TRUE;
157- g_debug ("Screensaver has been inhibited");
158- }
159- g_strfreev (list);
160- }
161-
162- return inhibited;
163+ return gscrsvr;
164 }
165
166 gboolean
167@@ -159,7 +170,7 @@
168 return FALSE;
169
170 dbus_g_proxy_call_with_timeout (
171- gsmgr, "GetActive", 2000, &error,
172+ gscrsvr, "GetActive", 2000, &error,
173 G_TYPE_INVALID,
174 G_TYPE_BOOLEAN, &active,
175 G_TYPE_INVALID);
176@@ -222,7 +233,7 @@
177 return (dnd_is_online_presence_dnd()
178 || dnd_is_xscreensaver_active()
179 || dnd_is_screensaver_active()
180- || dnd_is_screensaver_inhibited()
181+ || dnd_is_idle_inhibited()
182 || dnd_has_one_fullscreen_window()
183 );
184 }
185
186=== modified file 'src/dnd.h'
187--- src/dnd.h 2009-06-02 16:28:26 +0000
188+++ src/dnd.h 2015-10-14 09:48:39 +0000
189@@ -39,7 +39,7 @@
190 dnd_is_xscreensaver_active (void);
191
192 gboolean
193-dnd_is_screensaver_inhibited (void);
194+dnd_is_idle_inhibited (void);
195
196 gboolean
197 dnd_is_screensaver_active (void);
198
199=== modified file 'tests/test-dnd.c'
200--- tests/test-dnd.c 2011-07-01 18:23:39 +0000
201+++ tests/test-dnd.c 2015-10-14 09:48:39 +0000
202@@ -38,21 +38,6 @@
203 #define TEST_DBUS_NAME "org.freedesktop.Notificationstest"
204
205 static
206-void
207-test_dnd_screensaver (gpointer fixture, gconstpointer user_data)
208-{
209- gboolean test = dnd_is_screensaver_inhibited();
210-
211- if (test)
212- g_debug ("screensaver is inhibited");
213-
214- test = dnd_is_screensaver_active();
215-
216- if (test)
217- g_debug ("screensaver is active");
218-}
219-
220-static
221 gboolean
222 check_fullscreen (GMainLoop *loop)
223 {
224@@ -122,7 +107,6 @@
225
226 ts = g_test_create_suite ("dnd");
227 #define TC(x) g_test_create_case(#x, 0, NULL, NULL, x, NULL)
228- g_test_suite_add (ts, TC(test_dnd_screensaver));
229
230 // FIXME: test_dnd_fullscreen() fails under compiz because of it using
231 // viewports instead of workspaces

Subscribers

People subscribed via source and target branches