Do

Merge lp:~niklas-komani/do/docky_changes into lp:do

Proposed by Niklas Schnelle
Status: Rejected
Rejected by: Chris Halse Rogers
Proposed branch: lp:~niklas-komani/do/docky_changes
Merge into: lp:do
Diff against target: 143 lines
2 files modified
Do.Interface.Wink/src/Do.Interface.Wink/WindowControl.cs (+31/-0)
Do.Interface.Wink/src/Do.Interface.Wink/WindowUtils.cs (+39/-35)
To merge this branch: bzr merge lp:~niklas-komani/do/docky_changes
Reviewer Review Type Date Requested Status
Robert Dyer (community) Disapprove
Review via email: mp+12489@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Niklas Schnelle (niklas-komani) wrote :

Sorry for creating yet another branch and starting/deleting a merge proposal, had it based on 0.8 instead of trunk, this is now changed.

Changes in this branch include:
- Elimination of several redundant LINQ queries in the GetClickAction Code
- Reworked GetClick Action to work on one window at a time to enable it to make better decisions
- Reworked PerformLogicalClick to have a more elegant struture with less Queries and to work at every window seperately to allow better decisions
- Added restore/minimize function overloads to WindowControl to make it possible to work on one window at a time

Revision history for this message
Robert Dyer (psybers) wrote :

Thank you for your effort, but we have started work on Docky 2 which is a standalone program. A lot of code was completely rewritten and the original Docky code will be leaving the GNOME Do codebase.

If youre still interested in Docky, try checking out lp:docky and submit patches against that. Note however that at this early state the codebase will be changing *very* rapidly, so merge proposals against it most likely will be outdated before we can even review them.

It's also possible the functionality you wanted exists already. :-)

review: Disapprove
Revision history for this message
Niklas Schnelle (niklas-komani) wrote :

Does it make sense to try to merge these changes in the 0.8 branch? If
not, how long do you guess will Docky 2 take to get to the level where
Docky is now?
I think GNOME Do and Docky are both absolutely awesome software, will
Docky 2 still integrate the GNOME Do functionality? I think this feature
is what really made Docky different then all those other Docks.
greetings Niklas

Revision history for this message
Jason Smith (jassmith) wrote :

Docky 2 will reach feature parity with Docky very shortly

On Sun, 2009-09-27 at 16:39 +0000, Niklas Schnelle wrote:
> Does it make sense to try to merge these changes in the 0.8 branch? If
> not, how long do you guess will Docky 2 take to get to the level where
> Docky is now?
> I think GNOME Do and Docky are both absolutely awesome software, will
> Docky 2 still integrate the GNOME Do functionality? I think this feature
> is what really made Docky different then all those other Docks.
> greetings Niklas
>

Revision history for this message
Chris Halse Rogers (raof) wrote :

Docky has been removed from the Do codebase.

Unmerged revisions

1304. By Niklas Schnelle <niklas@niklas-iMac>

- Changed Window group minimizing/restoring to be more sane, especially
  if different windows of an application have a differing status
- Eliminated some LINQ queries on the way and added overloaded functions
  for restoring/minimizing a single window

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Do.Interface.Wink/src/Do.Interface.Wink/WindowControl.cs'
--- Do.Interface.Wink/src/Do.Interface.Wink/WindowControl.cs 2009-05-14 05:23:53 +0000
+++ Do.Interface.Wink/src/Do.Interface.Wink/WindowControl.cs 2009-09-27 15:45:22 +0000
@@ -61,6 +61,21 @@
61 }61 }
62 62
63 /// <summary>63 /// <summary>
64 /// Minimizes this window if it is not minimized
65 /// </summary>
66 /// <param name="window">
67 /// A <see cref="Window"/>
68 /// </param>
69 public static void MinimizeWindows (Window window)
70 {
71 if (window.IsInViewport (window.Screen.ActiveWorkspace) && !window.IsMinimized) {
72 window.Minimize ();
73 System.Threading.Thread.Sleep (SleepTime);
74 }
75 }
76
77
78 /// <summary>
64 /// Minimizes every window in the list if it is not minimized79 /// Minimizes every window in the list if it is not minimized
65 /// </summary>80 /// </summary>
66 /// <param name="windows">81 /// <param name="windows">
@@ -77,6 +92,22 @@
77 }92 }
78 93
79 /// <summary>94 /// <summary>
95 /// Restores this window if it is minimized
96 /// </summary>
97 /// <param name="window">
98 /// A <see cref="Window"/>
99 /// </param>
100 public static void RestoreWindows (Window window)
101 {
102 if (window.IsInViewport (window.Screen.ActiveWorkspace) && window.IsMinimized) {
103 window.Unminimize (Gtk.Global.CurrentEventTime);
104 System.Threading.Thread.Sleep (SleepTime);
105 }
106 }
107
108
109
110 /// <summary>
80 /// Restores every window in the list that is minimized111 /// Restores every window in the list that is minimized
81 /// </summary>112 /// </summary>
82 /// <param name="windows">113 /// <param name="windows">
83114
=== modified file 'Do.Interface.Wink/src/Do.Interface.Wink/WindowUtils.cs'
--- Do.Interface.Wink/src/Do.Interface.Wink/WindowUtils.cs 2009-06-21 02:20:30 +0000
+++ Do.Interface.Wink/src/Do.Interface.Wink/WindowUtils.cs 2009-09-27 15:45:22 +0000
@@ -219,18 +219,19 @@
219 last_update = DateTime.UtcNow;219 last_update = DateTime.UtcNow;
220 }220 }
221 221
222 static ClickAction GetClickAction (IEnumerable<Window> windows)222 static ClickAction GetClickAction (Window window)
223 {223 {
224 if (!windows.Any ())224 if (window==null)
225 return ClickAction.None;225 return ClickAction.None;
226 226
227 if (windows.Any (w => w.IsMinimized && w.IsInViewport (Wnck.Screen.Default.ActiveWorkspace)))227 if(window.IsInViewport (Wnck.Screen.Default.ActiveWorkspace)) {
228 return ClickAction.Restore;228 if (window.IsMinimized )
229 229 return ClickAction.Restore;
230 if (windows.Any (w => w.IsActive && w.IsInViewport (Wnck.Screen.Default.ActiveWorkspace)))230 else if (window.IsActive)
231 return ClickAction.Minimize;231 return ClickAction.Minimize;
232 232 else return ClickAction.Focus;
233 return ClickAction.Focus;233 }
234 return ClickAction.None;
234 }235 }
235 #endregion236 #endregion
236 237
@@ -421,32 +422,35 @@
421 {422 {
422 List<Window> stack = new List<Window> (Wnck.Screen.Default.WindowsStacked);423 List<Window> stack = new List<Window> (Wnck.Screen.Default.WindowsStacked);
423 windows = windows.OrderByDescending (w => stack.IndexOf (w));424 windows = windows.OrderByDescending (w => stack.IndexOf (w));
424 425
425 bool not_in_viewport = !windows.Any (w => !w.IsSkipTasklist && w.IsInViewport (w.Screen.ActiveWorkspace));426
426 bool urgent = windows.Any (w => w.NeedsAttention ());427 foreach (Wnck.Window window in windows) {
427 428 if (window.NeedsAttention ())
428 if (not_in_viewport || urgent) {429 WindowControl.FocusWindows (window);
429 foreach (Wnck.Window window in windows) {430
430 if (urgent && !window.NeedsAttention ())431 if (!window.IsSkipTasklist && !window.IsInViewport (window.Screen.ActiveWorkspace)) {
431 continue;432 WindowControl.IntelligentFocusOffViewportWindow (window, windows);
432 if (!window.IsSkipTasklist) {433 return;
433 WindowControl.IntelligentFocusOffViewportWindow (window, windows);434 }
434 return;435
435 }436 switch (GetClickAction (window)) {
436 }437 case ClickAction.Focus:
437 }438 WindowControl.FocusWindows (window);
438 439 break;
439 switch (GetClickAction (windows)) {440 case ClickAction.Minimize:
440 case ClickAction.Focus:441 //We want to minimize all windows of the app if a window was focused
441 WindowControl.FocusWindows (windows);442 WindowControl.MinimizeWindows (windows);
442 break;443 return;
443 case ClickAction.Minimize:444 case ClickAction.Restore:
444 WindowControl.MinimizeWindows (windows);445 //We want to restore all windows of the app if a window was minimizes
445 break;446 WindowControl.RestoreWindows (windows);
446 case ClickAction.Restore:447 //After restoring we want one of the windows to get the focus
447 WindowControl.RestoreWindows (windows);448 //this will be the first in the descending stack
448 break;449 WindowControl.FocusWindows(windows);
449 }450 return;
451 }
452 }
453
450 }454 }
451 455
452 #endregion456 #endregion