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

Proposed by Martin Pitt on 2012-02-02
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 2012-02-02 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
1=== modified file 'configure.in'
2--- configure.in 2012-01-31 10:25:17 +0000
3+++ configure.in 2012-02-02 12:35:22 +0000
4@@ -37,6 +37,11 @@
5 # libwnck used by the dnd code
6 #
7 PKG_CHECK_MODULES([WNCK], [libwnck-3.0])
8+AC_CHECK_LIB(wnck-3,wnck_shutdown, have_wnck_shutdown=yes,)
9+if test "$have_wnck_shutdown" = "yes"; then
10+ AC_DEFINE(HAVE_WNCK_SHUTDOWN, 1, [Define to 1 if libwnck provides wnck_shutdown()])
11+fi
12+
13
14 #
15 # libnotify, used unit-tests
16
17=== modified file 'src/dnd.c'
18--- src/dnd.c 2011-07-08 08:34:52 +0000
19+++ src/dnd.c 2012-02-02 12:35:22 +0000
20@@ -201,12 +201,18 @@
21 gboolean
22 dnd_has_one_fullscreen_window (void)
23 {
24+ gboolean result;
25+
26 WnckScreen *screen = wnck_screen_get_default ();
27 wnck_screen_force_update (screen);
28 WnckWorkspace *workspace = wnck_screen_get_active_workspace (screen);
29 GList *list = wnck_screen_get_windows (screen);
30 GList *item = g_list_find_custom (list, workspace, (GCompareFunc) is_fullscreen_cb);
31- return item != NULL;
32+ result = item != NULL;
33+#ifdef HAVE_WNCK_SHUTDOWN
34+ wnck_shutdown ();
35+#endif
36+ return result;
37 }
38
39 /* Tries to determine whether the user is in "do not disturb" mode */

Subscribers

People subscribed via source and target branches