Merge lp:~docky-core/docky/composite-notify into lp:docky

Proposed by Robert Dyer
Status: Merged
Merged at revision: 1737
Proposed branch: lp:~docky-core/docky/composite-notify
Merge into: lp:docky
Diff against target: 86 lines (+28/-3)
3 files modified
Docky/Docky.csproj (+3/-0)
Docky/Docky/Docky.cs (+24/-3)
Docky/Makefile.am (+1/-0)
To merge this branch: bzr merge lp:~docky-core/docky/composite-notify
Reviewer Review Type Date Requested Status
Rico Tzschichholz Approve
Docky Core Pending
Review via email: mp+42423@code.launchpad.net

Description of the change

This branch does 2 things:

1) Waits 8 seconds during Docky startup to look for compositing, which might help work around all the complaints we get regarding the notify showing on startup (because Docky starts before compositing is enabled). In all other cases when compositing 'changes' it waits 2 seconds then checks (same as before).

2) When compositing is checked on a change, it immediately looks if a notify is shown and if so it closes it. Thus, if we notify that compositing is not available and it suddenly comes available it will immediately request to close that notify (instead of waiting for it to time out).

To post a comment you must log in.
Revision history for this message
Robert Dyer (psybers) wrote :

Note that I have not tested this. We would need to test it still, assuming the code 'looks' fine.

Revision history for this message
Rico Tzschichholz (ricotz) wrote :

> Note that I have not tested this. We would need to test it still, assuming
> the code 'looks' fine.

So test it ;-)
Code looks fine. but I would hand over the timeout as milliseconds to CheckComposite.

1708. By Rico Tzschichholz

small optimization

Revision history for this message
Rico Tzschichholz (ricotz) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Docky/Docky.csproj'
2--- Docky/Docky.csproj 2010-11-04 21:16:22 +0000
3+++ Docky/Docky.csproj 2010-12-19 17:42:12 +0000
4@@ -93,6 +93,9 @@
5 <SpecificVersion>False</SpecificVersion>
6 <Package>gtk-sharp-2.0</Package>
7 </Reference>
8+ <Reference Include="notify-sharp, Version=0.4.0.0, Culture=neutral, PublicKeyToken=2df29c54e245917a">
9+ <Package>notify-sharp</Package>
10+ </Reference>
11 <Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
12 <SpecificVersion>False</SpecificVersion>
13 <Package>glib-sharp-2.0</Package>
14
15=== modified file 'Docky/Docky/Docky.cs'
16--- Docky/Docky/Docky.cs 2010-11-09 18:59:00 +0000
17+++ Docky/Docky/Docky.cs 2010-12-19 17:42:12 +0000
18@@ -21,6 +21,7 @@
19
20 using DBus;
21 using Gtk;
22+using Notifications;
23
24 using Docky.DBus;
25 using Docky.Services;
26@@ -77,7 +78,7 @@
27 DockServices.System.MainThread = Thread.CurrentThread;
28
29 // check compositing
30- CheckComposite ();
31+ CheckComposite (8);
32 Gdk.Screen.Default.CompositedChanged += delegate {
33 CheckComposite ();
34 };
35@@ -109,17 +110,37 @@
36 }
37
38 static uint checkCompositeTimer = 0;
39+ static Notification compositeNotify = null;
40 static void CheckComposite ()
41 {
42+ CheckComposite (2);
43+ }
44+
45+ static void CheckComposite (uint timeout)
46+ {
47 if (checkCompositeTimer != 0) {
48 GLib.Source.Remove (checkCompositeTimer);
49 checkCompositeTimer = 0;
50 }
51
52- checkCompositeTimer = GLib.Timeout.Add (2000, delegate {
53+ // compositing is enabled and we are still showing a notify, so close it
54+ if (Gdk.Screen.Default.IsComposited && compositeNotify != null) {
55+ compositeNotify.Close ();
56+ compositeNotify = null;
57+ return;
58+ }
59+
60+ checkCompositeTimer = GLib.Timeout.Add (timeout * 1000, delegate {
61+ // no matter what, close any notify open
62+ if (compositeNotify != null) {
63+ compositeNotify.Close ();
64+ compositeNotify = null;
65+ }
66+
67 if (!Gdk.Screen.Default.IsComposited)
68- Log.Notify (Catalog.GetString ("Docky requires compositing to work properly. " +
69+ compositeNotify = Log.Notify (Catalog.GetString ("Docky requires compositing to work properly. " +
70 "Certain options are disabled and themes/animations will look incorrect. "));
71+
72 checkCompositeTimer = 0;
73 return false;
74 });
75
76=== modified file 'Docky/Makefile.am'
77--- Docky/Makefile.am 2010-11-04 21:16:22 +0000
78+++ Docky/Makefile.am 2010-12-19 17:42:12 +0000
79@@ -72,6 +72,7 @@
80 $(GNOME_DESKTOP_SHARP_20_LIBS) \
81 $(WNCK_SHARP_10_LIBS) \
82 $(LIBRSVG_SHARP_LIBS) \
83+ $(NOTIFY_SHARP_LIBS) \
84 $(DBUS_SHARP_10_LIBS) \
85 $(DBUS_SHARP_GLIB_10_LIBS) \
86 $(MONO_ADDINS_LIBS) \

Subscribers

People subscribed via source and target branches

to status/vote changes: