Merge lp:~pitti/notify-osd/wnck_shutdown-precise into lp:~canonical-dx-team/notify-osd/precise

Proposed by Martin Pitt
Status: Merged
Merged at revision: 449
Proposed branch: lp:~pitti/notify-osd/wnck_shutdown-precise
Merge into: lp:~canonical-dx-team/notify-osd/precise
Diff against target: 39 lines (+12/-1)
2 files modified
configure.in (+5/-0)
src/dnd.c (+7/-1)
To merge this branch: bzr merge lp:~pitti/notify-osd/wnck_shutdown-precise
Reviewer Review Type Date Requested Status
Canonical Desktop Experience Team Pending
Review via email: mp+91258@code.launchpad.net

Description of the change

Use wnck_shutdown() if available.

dnd_has_one_fullscreen_window() initializes libwnck, which causes notify-osd to
unnecessarily wake up on each focus change and keyboard event, even if there
are no notification bubbles for a long time.

To fix this, check if libwnck has the new wnck_shutdown() function and use it
if available. This function is available in Ubuntu Precise's libwnck3 now, and
will soon go upstream as well (already talked to Vincent Untz).

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=642692
Bug-Ubuntu: https://launchpad.net/bugs/915389

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'configure.in'
--- configure.in 2012-01-31 10:25:17 +0000
+++ configure.in 2012-02-02 12:35:22 +0000
@@ -37,6 +37,11 @@
37# libwnck used by the dnd code37# libwnck used by the dnd code
38#38#
39PKG_CHECK_MODULES([WNCK], [libwnck-3.0])39PKG_CHECK_MODULES([WNCK], [libwnck-3.0])
40AC_CHECK_LIB(wnck-3,wnck_shutdown, have_wnck_shutdown=yes,)
41if test "$have_wnck_shutdown" = "yes"; then
42 AC_DEFINE(HAVE_WNCK_SHUTDOWN, 1, [Define to 1 if libwnck provides wnck_shutdown()])
43fi
44
4045
41#46#
42# libnotify, used unit-tests 47# libnotify, used unit-tests
4348
=== modified file 'src/dnd.c'
--- src/dnd.c 2011-07-08 08:34:52 +0000
+++ src/dnd.c 2012-02-02 12:35:22 +0000
@@ -201,12 +201,18 @@
201gboolean201gboolean
202dnd_has_one_fullscreen_window (void)202dnd_has_one_fullscreen_window (void)
203{203{
204 gboolean result;
205
204 WnckScreen *screen = wnck_screen_get_default ();206 WnckScreen *screen = wnck_screen_get_default ();
205 wnck_screen_force_update (screen);207 wnck_screen_force_update (screen);
206 WnckWorkspace *workspace = wnck_screen_get_active_workspace (screen);208 WnckWorkspace *workspace = wnck_screen_get_active_workspace (screen);
207 GList *list = wnck_screen_get_windows (screen);209 GList *list = wnck_screen_get_windows (screen);
208 GList *item = g_list_find_custom (list, workspace, (GCompareFunc) is_fullscreen_cb);210 GList *item = g_list_find_custom (list, workspace, (GCompareFunc) is_fullscreen_cb);
209 return item != NULL;211 result = item != NULL;
212#ifdef HAVE_WNCK_SHUTDOWN
213 wnck_shutdown ();
214#endif
215 return result;
210}216}
211217
212/* Tries to determine whether the user is in "do not disturb" mode */218/* Tries to determine whether the user is in "do not disturb" mode */

Subscribers

People subscribed via source and target branches