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
=== modified file 'Docky/Docky.csproj'
--- Docky/Docky.csproj 2010-11-04 21:16:22 +0000
+++ Docky/Docky.csproj 2010-12-19 17:42:12 +0000
@@ -93,6 +93,9 @@
93 <SpecificVersion>False</SpecificVersion>93 <SpecificVersion>False</SpecificVersion>
94 <Package>gtk-sharp-2.0</Package>94 <Package>gtk-sharp-2.0</Package>
95 </Reference>95 </Reference>
96 <Reference Include="notify-sharp, Version=0.4.0.0, Culture=neutral, PublicKeyToken=2df29c54e245917a">
97 <Package>notify-sharp</Package>
98 </Reference>
96 <Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">99 <Reference Include="glib-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
97 <SpecificVersion>False</SpecificVersion>100 <SpecificVersion>False</SpecificVersion>
98 <Package>glib-sharp-2.0</Package>101 <Package>glib-sharp-2.0</Package>
99102
=== modified file 'Docky/Docky/Docky.cs'
--- Docky/Docky/Docky.cs 2010-11-09 18:59:00 +0000
+++ Docky/Docky/Docky.cs 2010-12-19 17:42:12 +0000
@@ -21,6 +21,7 @@
2121
22using DBus;22using DBus;
23using Gtk;23using Gtk;
24using Notifications;
2425
25using Docky.DBus;26using Docky.DBus;
26using Docky.Services;27using Docky.Services;
@@ -77,7 +78,7 @@
77 DockServices.System.MainThread = Thread.CurrentThread;78 DockServices.System.MainThread = Thread.CurrentThread;
78 79
79 // check compositing80 // check compositing
80 CheckComposite ();81 CheckComposite (8);
81 Gdk.Screen.Default.CompositedChanged += delegate {82 Gdk.Screen.Default.CompositedChanged += delegate {
82 CheckComposite ();83 CheckComposite ();
83 };84 };
@@ -109,17 +110,37 @@
109 }110 }
110 111
111 static uint checkCompositeTimer = 0;112 static uint checkCompositeTimer = 0;
113 static Notification compositeNotify = null;
112 static void CheckComposite ()114 static void CheckComposite ()
113 {115 {
116 CheckComposite (2);
117 }
118
119 static void CheckComposite (uint timeout)
120 {
114 if (checkCompositeTimer != 0) {121 if (checkCompositeTimer != 0) {
115 GLib.Source.Remove (checkCompositeTimer);122 GLib.Source.Remove (checkCompositeTimer);
116 checkCompositeTimer = 0;123 checkCompositeTimer = 0;
117 }124 }
118 125
119 checkCompositeTimer = GLib.Timeout.Add (2000, delegate {126 // compositing is enabled and we are still showing a notify, so close it
127 if (Gdk.Screen.Default.IsComposited && compositeNotify != null) {
128 compositeNotify.Close ();
129 compositeNotify = null;
130 return;
131 }
132
133 checkCompositeTimer = GLib.Timeout.Add (timeout * 1000, delegate {
134 // no matter what, close any notify open
135 if (compositeNotify != null) {
136 compositeNotify.Close ();
137 compositeNotify = null;
138 }
139
120 if (!Gdk.Screen.Default.IsComposited)140 if (!Gdk.Screen.Default.IsComposited)
121 Log.Notify (Catalog.GetString ("Docky requires compositing to work properly. " +141 compositeNotify = Log.Notify (Catalog.GetString ("Docky requires compositing to work properly. " +
122 "Certain options are disabled and themes/animations will look incorrect. "));142 "Certain options are disabled and themes/animations will look incorrect. "));
143
123 checkCompositeTimer = 0;144 checkCompositeTimer = 0;
124 return false;145 return false;
125 });146 });
126147
=== modified file 'Docky/Makefile.am'
--- Docky/Makefile.am 2010-11-04 21:16:22 +0000
+++ Docky/Makefile.am 2010-12-19 17:42:12 +0000
@@ -72,6 +72,7 @@
72 $(GNOME_DESKTOP_SHARP_20_LIBS) \72 $(GNOME_DESKTOP_SHARP_20_LIBS) \
73 $(WNCK_SHARP_10_LIBS) \73 $(WNCK_SHARP_10_LIBS) \
74 $(LIBRSVG_SHARP_LIBS) \74 $(LIBRSVG_SHARP_LIBS) \
75 $(NOTIFY_SHARP_LIBS) \
75 $(DBUS_SHARP_10_LIBS) \76 $(DBUS_SHARP_10_LIBS) \
76 $(DBUS_SHARP_GLIB_10_LIBS) \77 $(DBUS_SHARP_GLIB_10_LIBS) \
77 $(MONO_ADDINS_LIBS) \78 $(MONO_ADDINS_LIBS) \

Subscribers

People subscribed via source and target branches

to status/vote changes: