[Pkg-cli-apps-commits] [SCM] docky branch, master, updated. debian/2.0.3.1-1-6-gc51ac71

Iain Lane laney at ubuntu.com
Sat May 15 12:07:19 UTC 2010


The following commit has been merged in the master branch:
commit 47b5066108c266791262cbba5f827975390cda4c
Author: Iain Lane <laney at ubuntu.com>
Date:   Fri May 14 09:39:18 2010 +0100

    Add patch to improve reliability of window grouping
    
    * debian/patches/window_grouping_reliability: Add patch cherrypicked from
      upstream to improve the window grouping reliability. Previously some
      applications, particularly OOo, would show two icons when the windows
      should have been grouped into one.

diff --git a/debian/changelog b/debian/changelog
index ed47626..d5b68ca 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,11 @@
 docky (2.0.3.1-2) UNRELEASED; urgency=low
 
   * debian/patches/mail_label_crash: Add patch cherrypicked from upstream to
-    fix a crash bug when deleting mail labels
+    fix a crash bug when deleting mail labels.
+  * debian/patches/window_grouping_reliability: Add patch cherrypicked from
+    upstream to improve the window grouping reliability. Previously some
+    applications, particularly OOo, would show two icons when the windows
+    should have been grouped into one. 
 
  -- Iain Lane <laney at ubuntu.com>  Fri, 14 May 2010 09:32:56 +0100
 
diff --git a/debian/patches/series b/debian/patches/series
index f04545e..530dee8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 mail_label_crash
+window_grouping_reliability
diff --git a/debian/patches/window_grouping_reliability b/debian/patches/window_grouping_reliability
new file mode 100644
index 0000000..0844eb1
--- /dev/null
+++ b/debian/patches/window_grouping_reliability
@@ -0,0 +1,104 @@
+Description: Fix "Two Icons Showing for Two Openoffice Writer Windows"
+Origin: upstream, commit: 1329
+
+=== modified file 'Docky.Items/Docky.Items/ApplicationDockItem.cs'
+Index: docky.git/Docky.Items/Docky.Items/ApplicationDockItem.cs
+===================================================================
+--- docky.git.orig/Docky.Items/Docky.Items/ApplicationDockItem.cs	2010-05-15 12:27:32.186709859 +0100
++++ docky.git/Docky.Items/Docky.Items/ApplicationDockItem.cs	2010-05-15 12:29:41.696710648 +0100
+@@ -142,6 +142,12 @@
+ 				Windows = Enumerable.Empty<Wnck.Window> ();
+ 		}
+ 		
++		public void RecollectWindows () 
++		{
++			UpdateWindows ();
++			OnPaintNeeded ();
++		}
++		
+ 		protected override MenuList OnGetMenuItems ()
+ 		{
+ 			MenuList list = base.OnGetMenuItems ();
+Index: docky.git/Docky.Items/Docky.Items/FileApplicationProvider.cs
+===================================================================
+--- docky.git.orig/Docky.Items/Docky.Items/FileApplicationProvider.cs	2010-05-15 12:27:32.216710159 +0100
++++ docky.git/Docky.Items/Docky.Items/FileApplicationProvider.cs	2010-05-15 12:29:41.696710648 +0100
+@@ -117,23 +117,33 @@
+ 			if (args.Window.IsSkipTasklist)
+ 				return;
+ 			
+-			if (!WindowMatcher.Default.WindowIsReadyForMatch (args.Window)) {
+-				int i = 0;
+-				// try to give open office enough time to open and set its title
+-				GLib.Timeout.Add (150, delegate {
+-					if (!WindowMatcher.Default.WindowIsReadyForMatch (args.Window) && i < 20) {
+-						i++;
+-						return true;
+-					}
+-					UpdateTransientItems ();
+-					return false;
+-				});
+-			} else {
+-				// ensure we run last (more or less) so that all icons can update first
+-				GLib.Timeout.Add (150, delegate {
++			// ensure we run last (more or less) so that all icons can update first
++			GLib.Timeout.Add (150, delegate {
++				if (WindowMatcher.Default.WindowIsReadyForMatch (args.Window)) {
+ 					UpdateTransientItems ();
+-					return false;
+-				});
++				} else {
++					// handle applications which set their proper (matchable) window title very late,
++					// like OpenOffice
++					// their windows will be monitored for name changes (give up after 5 seconds)
++					args.Window.NameChanged += HandleUnmatchedWindowNameChanged;
++					GLib.Timeout.Add (5000, delegate {
++						if (!WindowMatcher.Default.WindowIsReadyForMatch (args.Window)) {
++							args.Window.NameChanged -= HandleUnmatchedWindowNameChanged;
++							UpdateTransientItems ();
++						}
++						return false;
++					});
++				}
++				return false;
++			});
++		}
++
++		void HandleUnmatchedWindowNameChanged (object sender, EventArgs e)
++		{
++			Wnck.Window window = (sender as Wnck.Window);
++			if (WindowMatcher.Default.WindowIsReadyForMatch (window)) {
++				window.NameChanged -= HandleUnmatchedWindowNameChanged;
++				UpdateTransientItems ();
+ 			}
+ 		}
+ 
+@@ -175,6 +185,19 @@
+ 				desktopFile = WindowMatcher.Default.DesktopFileForWindow (window);
+ 				
+ 				if (!string.IsNullOrEmpty (desktopFile)) {
++					//This fixes WindowMatching for OpenOffice which is a bit slow setting up its window title
++					//Check if a existing ApplicationDockItem already uses this DesktopItem
++					ApplicationDockItem appdi;
++					if ((appdi = transient_items
++						.Where (adi => (adi is ApplicationDockItem && (adi as ApplicationDockItem).OwnedItem.Location == desktopFile))
++						.Cast<ApplicationDockItem> ()
++						.FirstOrDefault ()) != null) {
++						
++						//Try again to gain this missing window
++						appdi.RecollectWindows ();
++						continue;
++					}
++					
+ 					item = ApplicationDockItem.NewFromUri (new Uri (desktopFile).AbsoluteUri);
+ 				} else {
+ 					item = new WindowDockItem (window);
+Index: docky.git/po/POTFILES.skip
+===================================================================
+--- docky.git.orig/po/POTFILES.skip	2010-05-15 12:29:48.057960634 +0100
++++ docky.git/po/POTFILES.skip	2010-05-15 12:29:51.267958750 +0100
+@@ -1,2 +1,4 @@
+ data/docky.desktop.in
+ Docky.Windowing/Windowing/WindowMatcher.cs
++.pc/window_grouping_reliability/Docky.Items/Docky.Items/ApplicationDockItem.cs
++.pc/window_grouping_reliability/Docky.Items/Docky.Items/FileApplicationProvider.cs

-- 
docky



More information about the Pkg-cli-apps-commits mailing list