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
1=== modified file 'Do.Interface.Wink/src/Do.Interface.Wink/WindowControl.cs'
2--- Do.Interface.Wink/src/Do.Interface.Wink/WindowControl.cs 2009-05-14 05:23:53 +0000
3+++ Do.Interface.Wink/src/Do.Interface.Wink/WindowControl.cs 2009-09-27 15:45:22 +0000
4@@ -61,6 +61,21 @@
5 }
6
7 /// <summary>
8+ /// Minimizes this window if it is not minimized
9+ /// </summary>
10+ /// <param name="window">
11+ /// A <see cref="Window"/>
12+ /// </param>
13+ public static void MinimizeWindows (Window window)
14+ {
15+ if (window.IsInViewport (window.Screen.ActiveWorkspace) && !window.IsMinimized) {
16+ window.Minimize ();
17+ System.Threading.Thread.Sleep (SleepTime);
18+ }
19+ }
20+
21+
22+ /// <summary>
23 /// Minimizes every window in the list if it is not minimized
24 /// </summary>
25 /// <param name="windows">
26@@ -77,6 +92,22 @@
27 }
28
29 /// <summary>
30+ /// Restores this window if it is minimized
31+ /// </summary>
32+ /// <param name="window">
33+ /// A <see cref="Window"/>
34+ /// </param>
35+ public static void RestoreWindows (Window window)
36+ {
37+ if (window.IsInViewport (window.Screen.ActiveWorkspace) && window.IsMinimized) {
38+ window.Unminimize (Gtk.Global.CurrentEventTime);
39+ System.Threading.Thread.Sleep (SleepTime);
40+ }
41+ }
42+
43+
44+
45+ /// <summary>
46 /// Restores every window in the list that is minimized
47 /// </summary>
48 /// <param name="windows">
49
50=== modified file 'Do.Interface.Wink/src/Do.Interface.Wink/WindowUtils.cs'
51--- Do.Interface.Wink/src/Do.Interface.Wink/WindowUtils.cs 2009-06-21 02:20:30 +0000
52+++ Do.Interface.Wink/src/Do.Interface.Wink/WindowUtils.cs 2009-09-27 15:45:22 +0000
53@@ -219,18 +219,19 @@
54 last_update = DateTime.UtcNow;
55 }
56
57- static ClickAction GetClickAction (IEnumerable<Window> windows)
58+ static ClickAction GetClickAction (Window window)
59 {
60- if (!windows.Any ())
61+ if (window==null)
62 return ClickAction.None;
63
64- if (windows.Any (w => w.IsMinimized && w.IsInViewport (Wnck.Screen.Default.ActiveWorkspace)))
65- return ClickAction.Restore;
66-
67- if (windows.Any (w => w.IsActive && w.IsInViewport (Wnck.Screen.Default.ActiveWorkspace)))
68- return ClickAction.Minimize;
69-
70- return ClickAction.Focus;
71+ if(window.IsInViewport (Wnck.Screen.Default.ActiveWorkspace)) {
72+ if (window.IsMinimized )
73+ return ClickAction.Restore;
74+ else if (window.IsActive)
75+ return ClickAction.Minimize;
76+ else return ClickAction.Focus;
77+ }
78+ return ClickAction.None;
79 }
80 #endregion
81
82@@ -421,32 +422,35 @@
83 {
84 List<Window> stack = new List<Window> (Wnck.Screen.Default.WindowsStacked);
85 windows = windows.OrderByDescending (w => stack.IndexOf (w));
86-
87- bool not_in_viewport = !windows.Any (w => !w.IsSkipTasklist && w.IsInViewport (w.Screen.ActiveWorkspace));
88- bool urgent = windows.Any (w => w.NeedsAttention ());
89-
90- if (not_in_viewport || urgent) {
91- foreach (Wnck.Window window in windows) {
92- if (urgent && !window.NeedsAttention ())
93- continue;
94- if (!window.IsSkipTasklist) {
95- WindowControl.IntelligentFocusOffViewportWindow (window, windows);
96- return;
97- }
98- }
99- }
100-
101- switch (GetClickAction (windows)) {
102- case ClickAction.Focus:
103- WindowControl.FocusWindows (windows);
104- break;
105- case ClickAction.Minimize:
106- WindowControl.MinimizeWindows (windows);
107- break;
108- case ClickAction.Restore:
109- WindowControl.RestoreWindows (windows);
110- break;
111- }
112+
113+
114+ foreach (Wnck.Window window in windows) {
115+ if (window.NeedsAttention ())
116+ WindowControl.FocusWindows (window);
117+
118+ if (!window.IsSkipTasklist && !window.IsInViewport (window.Screen.ActiveWorkspace)) {
119+ WindowControl.IntelligentFocusOffViewportWindow (window, windows);
120+ return;
121+ }
122+
123+ switch (GetClickAction (window)) {
124+ case ClickAction.Focus:
125+ WindowControl.FocusWindows (window);
126+ break;
127+ case ClickAction.Minimize:
128+ //We want to minimize all windows of the app if a window was focused
129+ WindowControl.MinimizeWindows (windows);
130+ return;
131+ case ClickAction.Restore:
132+ //We want to restore all windows of the app if a window was minimizes
133+ WindowControl.RestoreWindows (windows);
134+ //After restoring we want one of the windows to get the focus
135+ //this will be the first in the descending stack
136+ WindowControl.FocusWindows(windows);
137+ return;
138+ }
139+ }
140+
141 }
142
143 #endregion