Do

Merge lp:~jassmith/do/intellihide into lp:do

Proposed by Jason Smith
Status: Merged
Merged at revision: not available
Proposed branch: lp:~jassmith/do/intellihide
Merge into: lp:do
Diff against target: None lines
To merge this branch: bzr merge lp:~jassmith/do/intellihide
Reviewer Review Type Date Requested Status
Do Core Team Pending
Review via email: mp+6132@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jason Smith (jassmith) wrote :

Re-propose merge

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Do.Interface.Linux.Docky/Do.Interface.Linux.Docky.mdp'
2--- Do.Interface.Linux.Docky/Do.Interface.Linux.Docky.mdp 2009-04-20 04:49:28 +0000
3+++ Do.Interface.Linux.Docky/Do.Interface.Linux.Docky.mdp 2009-05-01 17:36:24 +0000
4@@ -90,6 +90,8 @@
5 <File name="gtk-gui/generated.cs" subtype="Code" buildaction="Compile" />
6 <File name="src/Docky.Interface/DockyConfigurationWidget.cs" subtype="Code" buildaction="Compile" />
7 <File name="gtk-gui/Docky.Interface.DockyConfigurationWidget.cs" subtype="Code" buildaction="Compile" />
8+ <File name="src/Docky.Utilities/AutohideType.cs" subtype="Code" buildaction="Compile" />
9+ <File name="src/Docky.Interface/AutohideTracker.cs" subtype="Code" buildaction="Compile" />
10 </Contents>
11 <References>
12 <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
13
14=== modified file 'Do.Interface.Linux.Docky/Makefile.am'
15--- Do.Interface.Linux.Docky/Makefile.am 2009-04-20 04:49:28 +0000
16+++ Do.Interface.Linux.Docky/Makefile.am 2009-05-01 17:36:24 +0000
17@@ -22,6 +22,7 @@
18 src/Docky.Core/Docky.Core.Default/DoInteropService.cs \
19 src/Docky.Core/Docky.Core.Default/DockletService.cs \
20 src/Docky.Core/Docky.Core.Default/PainterService.cs \
21+ src/Docky.Interface/AutohideTracker.cs \
22 src/Docky.Interface/ClickAnimationType.cs \
23 src/Docky.Interface/DockArea.cs \
24 src/Docky.Interface/DockArea_Rendering.cs \
25@@ -68,6 +69,7 @@
26 src/Docky.Interface/TextRenderContext.cs \
27 src/Docky.Interface/UpdateRequestArgs.cs \
28 src/Docky.Interface/Util.cs \
29+ src/Docky.Utilities/AutohideType.cs \
30 src/Docky.Utilities/DockOrientation.cs \
31 src/Docky.Utilities/DockPreferences.cs \
32 src/Docky.Utilities/GtkUtils.cs
33
34=== modified file 'Do.Interface.Linux.Docky/gtk-gui/Docky.Interface.DockyConfigurationWidget.cs'
35--- Do.Interface.Linux.Docky/gtk-gui/Docky.Interface.DockyConfigurationWidget.cs 2009-04-21 02:15:39 +0000
36+++ Do.Interface.Linux.Docky/gtk-gui/Docky.Interface.DockyConfigurationWidget.cs 2009-04-29 03:12:34 +0000
37@@ -23,9 +23,9 @@
38
39 private Gtk.HBox hbox8;
40
41- private Gtk.CheckButton autohide_checkbutton;
42+ private Gtk.Label orientation_label1;
43
44- private Gtk.CheckButton window_overlap_checkbutton;
45+ private Gtk.ComboBox autohide_combo;
46
47 private Gtk.HBox hbox9;
48
49@@ -39,12 +39,6 @@
50
51 private Gtk.HScale zoom_scale;
52
53- private Gtk.HBox hbox7;
54-
55- private Gtk.Label zoom_width_label;
56-
57- private Gtk.HScale zoom_width_scale;
58-
59 private Gtk.Label label5;
60
61 private Gtk.ScrolledWindow scrolled_window;
62@@ -87,28 +81,24 @@
63 // Container child vbox2.Gtk.Box+BoxChild
64 this.hbox8 = new Gtk.HBox();
65 this.hbox8.Name = "hbox8";
66- this.hbox8.Homogeneous = true;
67 this.hbox8.Spacing = 6;
68 // Container child hbox8.Gtk.Box+BoxChild
69- this.autohide_checkbutton = new Gtk.CheckButton();
70- this.autohide_checkbutton.CanFocus = true;
71- this.autohide_checkbutton.Name = "autohide_checkbutton";
72- this.autohide_checkbutton.Label = Mono.Unix.Catalog.GetString("Automatically Hide");
73- this.autohide_checkbutton.DrawIndicator = true;
74- this.autohide_checkbutton.UseUnderline = true;
75- this.hbox8.Add(this.autohide_checkbutton);
76- Gtk.Box.BoxChild w4 = ((Gtk.Box.BoxChild)(this.hbox8[this.autohide_checkbutton]));
77+ this.orientation_label1 = new Gtk.Label();
78+ this.orientation_label1.Name = "orientation_label1";
79+ this.orientation_label1.LabelProp = Mono.Unix.Catalog.GetString("Automatic Hiding:");
80+ this.hbox8.Add(this.orientation_label1);
81+ Gtk.Box.BoxChild w4 = ((Gtk.Box.BoxChild)(this.hbox8[this.orientation_label1]));
82 w4.Position = 0;
83+ w4.Expand = false;
84+ w4.Fill = false;
85 // Container child hbox8.Gtk.Box+BoxChild
86- this.window_overlap_checkbutton = new Gtk.CheckButton();
87- this.window_overlap_checkbutton.CanFocus = true;
88- this.window_overlap_checkbutton.Name = "window_overlap_checkbutton";
89- this.window_overlap_checkbutton.Label = Mono.Unix.Catalog.GetString("Allow Window Overlap");
90- this.window_overlap_checkbutton.DrawIndicator = true;
91- this.window_overlap_checkbutton.UseUnderline = true;
92- this.hbox8.Add(this.window_overlap_checkbutton);
93- Gtk.Box.BoxChild w5 = ((Gtk.Box.BoxChild)(this.hbox8[this.window_overlap_checkbutton]));
94+ this.autohide_combo = Gtk.ComboBox.NewText();
95+ this.autohide_combo.Name = "autohide_combo";
96+ this.hbox8.Add(this.autohide_combo);
97+ Gtk.Box.BoxChild w5 = ((Gtk.Box.BoxChild)(this.hbox8[this.autohide_combo]));
98 w5.Position = 1;
99+ w5.Expand = false;
100+ w5.Fill = false;
101 this.vbox2.Add(this.hbox8);
102 Gtk.Box.BoxChild w6 = ((Gtk.Box.BoxChild)(this.vbox2[this.hbox8]));
103 w6.Position = 1;
104@@ -181,71 +171,34 @@
105 w12.Expand = false;
106 w12.Fill = false;
107 // Container child vbox2.Gtk.Box+BoxChild
108- this.hbox7 = new Gtk.HBox();
109- this.hbox7.Name = "hbox7";
110- this.hbox7.Spacing = 6;
111- // Container child hbox7.Gtk.Box+BoxChild
112- this.zoom_width_label = new Gtk.Label();
113- this.zoom_width_label.Name = "zoom_width_label";
114- this.zoom_width_label.Yalign = 0.83F;
115- this.zoom_width_label.LabelProp = Mono.Unix.Catalog.GetString("Zoom Width");
116- this.hbox7.Add(this.zoom_width_label);
117- Gtk.Box.BoxChild w13 = ((Gtk.Box.BoxChild)(this.hbox7[this.zoom_width_label]));
118- w13.Position = 0;
119- w13.Expand = false;
120- w13.Fill = false;
121- // Container child hbox7.Gtk.Box+BoxChild
122- this.zoom_width_scale = new Gtk.HScale(null);
123- this.zoom_width_scale.CanFocus = true;
124- this.zoom_width_scale.Name = "zoom_width_scale";
125- this.zoom_width_scale.UpdatePolicy = ((Gtk.UpdateType)(1));
126- this.zoom_width_scale.Adjustment.Upper = 100;
127- this.zoom_width_scale.Adjustment.PageIncrement = 10;
128- this.zoom_width_scale.Adjustment.PageSize = 10;
129- this.zoom_width_scale.Adjustment.StepIncrement = 10;
130- this.zoom_width_scale.Adjustment.Value = 81;
131- this.zoom_width_scale.DrawValue = true;
132- this.zoom_width_scale.Digits = 0;
133- this.zoom_width_scale.ValuePos = ((Gtk.PositionType)(2));
134- this.hbox7.Add(this.zoom_width_scale);
135- Gtk.Box.BoxChild w14 = ((Gtk.Box.BoxChild)(this.hbox7[this.zoom_width_scale]));
136- w14.Position = 1;
137- this.vbox2.Add(this.hbox7);
138- Gtk.Box.BoxChild w15 = ((Gtk.Box.BoxChild)(this.vbox2[this.hbox7]));
139- w15.Position = 4;
140- w15.Expand = false;
141- w15.Fill = false;
142- // Container child vbox2.Gtk.Box+BoxChild
143 this.label5 = new Gtk.Label();
144 this.label5.Name = "label5";
145 this.label5.Xalign = 0F;
146 this.label5.LabelProp = Mono.Unix.Catalog.GetString("Configure Docklets:");
147 this.vbox2.Add(this.label5);
148- Gtk.Box.BoxChild w16 = ((Gtk.Box.BoxChild)(this.vbox2[this.label5]));
149- w16.Position = 5;
150- w16.Expand = false;
151- w16.Fill = false;
152+ Gtk.Box.BoxChild w13 = ((Gtk.Box.BoxChild)(this.vbox2[this.label5]));
153+ w13.Position = 4;
154+ w13.Expand = false;
155+ w13.Fill = false;
156 // Container child vbox2.Gtk.Box+BoxChild
157 this.scrolled_window = new Gtk.ScrolledWindow();
158 this.scrolled_window.CanFocus = true;
159 this.scrolled_window.Name = "scrolled_window";
160 this.scrolled_window.ShadowType = ((Gtk.ShadowType)(1));
161 this.vbox2.Add(this.scrolled_window);
162- Gtk.Box.BoxChild w17 = ((Gtk.Box.BoxChild)(this.vbox2[this.scrolled_window]));
163- w17.Position = 6;
164+ Gtk.Box.BoxChild w14 = ((Gtk.Box.BoxChild)(this.vbox2[this.scrolled_window]));
165+ w14.Position = 5;
166 this.Add(this.vbox2);
167 if ((this.Child != null)) {
168 this.Child.ShowAll();
169 }
170 this.Hide();
171 this.orientation_combobox.Changed += new System.EventHandler(this.OnOrientationComboboxChanged);
172- this.autohide_checkbutton.Toggled += new System.EventHandler(this.OnAutohideCheckbuttonToggled);
173- this.window_overlap_checkbutton.Toggled += new System.EventHandler(this.OnWindowOverlapCheckbuttonToggled);
174+ this.autohide_combo.Changed += new System.EventHandler(this.OnAutohideComboChanged);
175 this.zoom_checkbutton.Toggled += new System.EventHandler(this.OnZoomCheckbuttonToggled);
176 this.advanced_indicators_checkbutton.Toggled += new System.EventHandler(this.OnAdvancedIndicatorsCheckbuttonToggled);
177 this.zoom_scale.FormatValue += new Gtk.FormatValueHandler(this.OnZoomScaleFormatValue);
178 this.zoom_scale.ValueChanged += new System.EventHandler(this.OnZoomScaleValueChanged);
179- this.zoom_width_scale.ValueChanged += new System.EventHandler(this.OnZoomWidthScaleValueChanged);
180 }
181 }
182 }
183
184=== modified file 'Do.Interface.Linux.Docky/gtk-gui/gui.stetic'
185--- Do.Interface.Linux.Docky/gtk-gui/gui.stetic 2009-04-21 02:15:39 +0000
186+++ Do.Interface.Linux.Docky/gtk-gui/gui.stetic 2009-04-29 03:12:34 +0000
187@@ -9,9 +9,9 @@
188 <widget-library name="../../Do.Interface.Linux/bin/Debug/Do.Interface.Linux.dll" />
189 <widget-library name="gnomedesktop-sharp, Version=2.20.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
190 <widget-library name="../../Do.Interface.Wink/bin/Debug/Do.Interface.Wnck.dll" />
191- <widget-library name="../bin/Debug/Do.Interface.Linux.Docky.dll" internal="true" />
192 <widget-library name="../../Do.Platform.Linux/bin/Debug/Do.Platform.Linux.dll" />
193 <widget-library name="../../Do.Interface.Linux.AnimationBase/bin/Debug/Do.Interface.Linux.AnimationBase.dll" />
194+ <widget-library name="../bin/Debug/Do.Interface.Linux.Docky.dll" internal="true" />
195 </import>
196 <widget class="Gtk.Bin" id="Docky.Interface.DockyConfigurationWidget" design-size="376 347">
197 <property name="MemberName" />
198@@ -61,36 +61,31 @@
199 <child>
200 <widget class="Gtk.HBox" id="hbox8">
201 <property name="MemberName" />
202- <property name="Homogeneous">True</property>
203 <property name="Spacing">6</property>
204 <child>
205- <widget class="Gtk.CheckButton" id="autohide_checkbutton">
206+ <widget class="Gtk.Label" id="orientation_label1">
207 <property name="MemberName" />
208- <property name="CanFocus">True</property>
209- <property name="Label" translatable="yes">Automatically Hide</property>
210- <property name="DrawIndicator">True</property>
211- <property name="HasLabel">True</property>
212- <property name="UseUnderline">True</property>
213- <signal name="Toggled" handler="OnAutohideCheckbuttonToggled" />
214+ <property name="LabelProp" translatable="yes">Automatic Hiding:</property>
215 </widget>
216 <packing>
217 <property name="Position">0</property>
218 <property name="AutoSize">True</property>
219+ <property name="Expand">False</property>
220+ <property name="Fill">False</property>
221 </packing>
222 </child>
223 <child>
224- <widget class="Gtk.CheckButton" id="window_overlap_checkbutton">
225+ <widget class="Gtk.ComboBox" id="autohide_combo">
226 <property name="MemberName" />
227- <property name="CanFocus">True</property>
228- <property name="Label" translatable="yes">Allow Window Overlap</property>
229- <property name="DrawIndicator">True</property>
230- <property name="HasLabel">True</property>
231- <property name="UseUnderline">True</property>
232- <signal name="Toggled" handler="OnWindowOverlapCheckbuttonToggled" />
233+ <property name="IsTextCombo">True</property>
234+ <property name="Items" translatable="yes" />
235+ <signal name="Changed" handler="OnAutohideComboChanged" />
236 </widget>
237 <packing>
238 <property name="Position">1</property>
239 <property name="AutoSize">True</property>
240+ <property name="Expand">False</property>
241+ <property name="Fill">False</property>
242 </packing>
243 </child>
244 </widget>
245@@ -192,58 +187,13 @@
246 </packing>
247 </child>
248 <child>
249- <widget class="Gtk.HBox" id="hbox7">
250- <property name="MemberName" />
251- <property name="Spacing">6</property>
252- <child>
253- <widget class="Gtk.Label" id="zoom_width_label">
254- <property name="MemberName" />
255- <property name="Yalign">0.83</property>
256- <property name="LabelProp" translatable="yes">Zoom Width</property>
257- </widget>
258- <packing>
259- <property name="Position">0</property>
260- <property name="AutoSize">True</property>
261- <property name="Expand">False</property>
262- <property name="Fill">False</property>
263- </packing>
264- </child>
265- <child>
266- <widget class="Gtk.HScale" id="zoom_width_scale">
267- <property name="MemberName" />
268- <property name="CanFocus">True</property>
269- <property name="UpdatePolicy">Discontinuous</property>
270- <property name="Upper">100</property>
271- <property name="PageIncrement">10</property>
272- <property name="PageSize">10</property>
273- <property name="StepIncrement">10</property>
274- <property name="Value">81</property>
275- <property name="DrawValue">True</property>
276- <property name="Digits">0</property>
277- <property name="ValuePos">Top</property>
278- <signal name="ValueChanged" handler="OnZoomWidthScaleValueChanged" />
279- </widget>
280- <packing>
281- <property name="Position">1</property>
282- <property name="AutoSize">True</property>
283- </packing>
284- </child>
285- </widget>
286- <packing>
287- <property name="Position">4</property>
288- <property name="AutoSize">True</property>
289- <property name="Expand">False</property>
290- <property name="Fill">False</property>
291- </packing>
292- </child>
293- <child>
294 <widget class="Gtk.Label" id="label5">
295 <property name="MemberName" />
296 <property name="Xalign">0</property>
297 <property name="LabelProp" translatable="yes">Configure Docklets:</property>
298 </widget>
299 <packing>
300- <property name="Position">5</property>
301+ <property name="Position">4</property>
302 <property name="AutoSize">True</property>
303 <property name="Expand">False</property>
304 <property name="Fill">False</property>
305@@ -265,7 +215,7 @@
306 </child>
307 </widget>
308 <packing>
309- <property name="Position">6</property>
310+ <property name="Position">5</property>
311 <property name="AutoSize">True</property>
312 </packing>
313 </child>
314
315=== modified file 'Do.Interface.Linux.Docky/src/Docky.Core/Docky.Core.Default/ItemsService.cs'
316--- Do.Interface.Linux.Docky/src/Docky.Core/Docky.Core.Default/ItemsService.cs 2009-04-02 16:16:46 +0000
317+++ Do.Interface.Linux.Docky/src/Docky.Core/Docky.Core.Default/ItemsService.cs 2009-04-28 08:08:21 +0000
318@@ -23,6 +23,8 @@
319 using System.Linq;
320 using System.Runtime.Serialization;
321 using System.Runtime.Serialization.Formatters.Binary;
322+using System.Security;
323+using System.Security.Permissions;
324
325 using Do;
326 using Do.Interface;
327@@ -80,6 +82,12 @@
328 }
329 }
330
331+ string DesktopFilesDirectory {
332+ get {
333+ return Path.Combine (Services.Paths.UserDataDirectory, GetType ().Name + "_DesktopFiles");
334+ }
335+ }
336+
337 IEnumerable<AbstractDockItem> OrderedItems {
338 get {
339 return stat_items
340@@ -113,6 +121,9 @@
341 Separator = new SeparatorItem ();
342 MenuItem = new DoDockItem ();
343
344+ if (!Directory.Exists (DesktopFilesDirectory))
345+ Directory.CreateDirectory (DesktopFilesDirectory);
346+
347 RegisterEvents ();
348 }
349
350@@ -229,7 +240,7 @@
351 #endregion
352
353 #region Item Updating
354- AbstractDockItem MaybeCreateCustomItem (string identifier)
355+ AbstractDockItem MaybeCreateCustomItem (ref string identifier)
356 {
357 ItemDockItem customItem = null;
358
359@@ -238,6 +249,19 @@
360
361 if (File.Exists (identifier) || Directory.Exists (identifier)) {
362 if (identifier.EndsWith (".desktop")) {
363+ bool writeable = true;
364+ try {
365+ using (FileStream stream = File.OpenWrite (identifier)) {
366+ ;
367+ }
368+ } catch {
369+ writeable = false;
370+ }
371+ if (writeable && Path.GetDirectoryName (identifier) != DesktopFilesDirectory) {
372+ string newFile = Path.Combine (DesktopFilesDirectory, Path.GetFileName (identifier));
373+ File.Copy (identifier, newFile);
374+ identifier = newFile;
375+ }
376 Item o = Services.UniverseFactory.NewApplicationItem (identifier) as Item;
377 customItem = new ItemDockItem (o);
378 } else {
379@@ -428,7 +452,7 @@
380 {
381 if (custom_items.ContainsKey (identifier)) return false;
382
383- AbstractDockItem customItem = MaybeCreateCustomItem (identifier);
384+ AbstractDockItem customItem = MaybeCreateCustomItem (ref identifier);
385
386 if (customItem == null) return false;
387
388@@ -733,6 +757,11 @@
389 } else if (GetIconSource (DockItems [item]) == IconSource.Custom) {
390 foreach (KeyValuePair<string, AbstractDockItem> kvp in custom_items) {
391 if (kvp.Value.Equals (DockItems [item])) {
392+ if (kvp.Key.EndsWith (".desktop") && Path.GetDirectoryName (kvp.Key) == DesktopFilesDirectory) {
393+ try {
394+ File.Delete (kvp.Key);
395+ } catch { }
396+ }
397 custom_items.Remove (kvp.Key);
398
399 UpdateItems ();
400
401=== added file 'Do.Interface.Linux.Docky/src/Docky.Interface/AutohideTracker.cs'
402--- Do.Interface.Linux.Docky/src/Docky.Interface/AutohideTracker.cs 1970-01-01 00:00:00 +0000
403+++ Do.Interface.Linux.Docky/src/Docky.Interface/AutohideTracker.cs 2009-05-02 18:42:09 +0000
404@@ -0,0 +1,134 @@
405+//
406+// Copyright (C) 2009 GNOME Do
407+//
408+// This program is free software: you can redistribute it and/or modify
409+// it under the terms of the GNU General Public License as published by
410+// the Free Software Foundation, either version 3 of the License, or
411+// (at your option) any later version.
412+//
413+// This program is distributed in the hope that it will be useful,
414+// but WITHOUT ANY WARRANTY; without even the implied warranty of
415+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
416+// GNU General Public License for more details.
417+//
418+// You should have received a copy of the GNU General Public License
419+// along with this program. If not, see <http://www.gnu.org/licenses/>.
420+//
421+
422+using System;
423+using System.Collections.Generic;
424+using System.Linq;
425+
426+using Gdk;
427+using Wnck;
428+
429+using Do.Interface;
430+using Do.Interface.Wink;
431+using Docky.Utilities;
432+
433+namespace Docky.Interface
434+{
435+
436+
437+ public class AutohideTracker
438+ {
439+ DockArea parent;
440+ bool window_intersecting_other;
441+
442+ Gdk.Rectangle last_known_geo;
443+
444+ public event EventHandler IntersectionChanged;
445+
446+ public bool WindowIntersectingOther {
447+ get {
448+ return window_intersecting_other;
449+ }
450+ set {
451+ if (window_intersecting_other == value)
452+ return;
453+
454+ window_intersecting_other = value;
455+ if (IntersectionChanged != null)
456+ IntersectionChanged (this, EventArgs.Empty);
457+ }
458+ }
459+
460+ internal AutohideTracker (DockArea parent)
461+ {
462+ this.parent = parent;
463+ Wnck.Screen.Default.ActiveWindowChanged += HandleActiveWindowChanged;
464+ }
465+
466+ void HandleGeometryChanged (object sender, EventArgs e)
467+ {
468+ Wnck.Window window = sender as Wnck.Window;
469+
470+ Gdk.Rectangle monitor = LayoutUtils.MonitorGemonetry ();
471+ Gdk.Rectangle geo = window.EasyGeometry ();
472+
473+ geo.X = ((geo.X % monitor.Width) + monitor.Width) % monitor.Width;
474+ geo.Y = ((geo.Y % monitor.Height) + monitor.Height) % monitor.Height;
475+
476+ if (geo == last_known_geo)
477+ return;
478+
479+ last_known_geo = geo;
480+ UpdateWindowIntersect ();
481+ }
482+
483+ void HandleActiveWindowChanged (object o, ActiveWindowChangedArgs args)
484+ {
485+ if (args.PreviousWindow != null)
486+ args.PreviousWindow.GeometryChanged -= HandleGeometryChanged;
487+
488+ SetupActiveWindow ();
489+ UpdateWindowIntersect ();
490+ }
491+
492+ void SetupActiveWindow ()
493+ {
494+ Wnck.Window active = Wnck.Screen.Default.ActiveWindow;
495+ if (active != null) {
496+ active.GeometryChanged += HandleGeometryChanged;
497+ Gdk.Rectangle geo = active.EasyGeometry ();
498+ Gdk.Rectangle monitor = LayoutUtils.MonitorGemonetry ();
499+ geo.X = geo.X % monitor.Width;
500+ geo.Y = geo.Y % monitor.Height;
501+ last_known_geo = geo;
502+ }
503+ }
504+
505+ public void UpdateWindowIntersect ()
506+ {
507+ Gdk.Rectangle adjustedDockArea = parent.MinimumDockArea;
508+ Gdk.Rectangle geo = LayoutUtils.MonitorGemonetry ();
509+
510+ adjustedDockArea.X = geo.X + (geo.Width - adjustedDockArea.Width) / 2;
511+ switch (DockPreferences.Orientation) {
512+ case DockOrientation.Bottom:
513+ adjustedDockArea.Y = geo.Y + geo.Height - adjustedDockArea.Height;
514+ break;
515+ case DockOrientation.Top:
516+ adjustedDockArea.Y = geo.Y;
517+ break;
518+ }
519+ adjustedDockArea.Inflate (-2, -2);
520+
521+ bool intersect = false;
522+ try {
523+ IEnumerable<Wnck.Window> rawWindows = ScreenUtils.ActiveViewport.UnprocessedWindows ();
524+ Wnck.Window activeWindow = rawWindows
525+ .Where (w => w.IsActive && w.WindowType != Wnck.WindowType.Desktop)
526+ .First ();
527+
528+ intersect = rawWindows.Any (w => w.WindowType != Wnck.WindowType.Desktop &&
529+ activeWindow.Pid == w.Pid &&
530+ w.EasyGeometry ().IntersectsWith (adjustedDockArea));
531+ } catch (Exception e) {
532+ Do.Platform.Log <AutohideTracker>.Error (e.Message);
533+ }
534+
535+ WindowIntersectingOther = intersect;
536+ }
537+ }
538+}
539
540=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/DockAnimationState.cs'
541--- Do.Interface.Linux.Docky/src/Docky.Interface/DockAnimationState.cs 2009-03-02 05:26:10 +0000
542+++ Do.Interface.Linux.Docky/src/Docky.Interface/DockAnimationState.cs 2009-04-27 20:42:27 +0000
543@@ -34,6 +34,7 @@
544 Zoom,
545 Bounce,
546 Painter,
547+ Summon,
548 IconInsert,
549 UrgencyChanged,
550 InputModeChanged,
551
552=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/DockArea.cs'
553--- Do.Interface.Linux.Docky/src/Docky.Interface/DockArea.cs 2009-04-26 21:00:06 +0000
554+++ Do.Interface.Linux.Docky/src/Docky.Interface/DockArea.cs 2009-05-03 00:32:23 +0000
555@@ -26,6 +26,7 @@
556 using Gtk;
557
558 using Do.Platform;
559+using Do.Interface.Wink;
560 using Do.Interface.Xlib;
561
562 using Docky.Core;
563@@ -57,6 +58,7 @@
564 DateTime interface_change_time = new DateTime (0);
565 DateTime last_draw_timeout = new DateTime (0);
566 DateTime cursor_update = new DateTime (0);
567+ DateTime showhide_time = new DateTime (0);
568
569 bool disposed;
570
571@@ -92,13 +94,13 @@
572 public int DockHeight {
573 get { return PositionProvider.DockHeight; }
574 }
575-
576+
577 public uint[] StrutRequest {
578 get {
579 uint[] values = new uint[12];
580 Gdk.Rectangle geo = LayoutUtils.MonitorGemonetry ();
581
582- if (DockPreferences.AutoHide || DockPreferences.AllowOverlap)
583+ if (DockPreferences.AutohideType != AutohideType.None)
584 return values;
585
586 switch (DockPreferences.Orientation) {
587@@ -119,6 +121,8 @@
588
589 #endregion
590
591+ AutohideTracker AutohideTracker { get; set; }
592+
593 DockAnimationState AnimationState { get; set; }
594
595 ItemPositionProvider PositionProvider { get; set; }
596@@ -168,7 +172,7 @@
597 dockRegion.Inflate (0, (int) (IconSize * (DockPreferences.ZoomPercent - 1)) + 22);
598 CursorIsOverDockArea = dockRegion.Contains (cursor);
599 } else {
600- if (DockPreferences.AutoHide) {
601+ if (Hidden) {
602 switch (DockPreferences.Orientation) {
603 case DockOrientation.Bottom:
604 dockRegion.Y += dockRegion.Height - 1;
605@@ -183,27 +187,56 @@
606 CursorIsOverDockArea = dockRegion.Contains (cursor);
607 }
608
609+ bool codChange = CursorIsOverDockArea != cursorIsOverDockArea;
610 // When we change over this boundry, it will normally trigger an animation, we need to be sure to catch it
611- if (CursorIsOverDockArea != cursorIsOverDockArea) {
612+ if (codChange) {
613 ResetCursorTimer ();
614 enter_time = DateTime.UtcNow;
615+ switch (DockPreferences.AutohideType) {
616+ case AutohideType.Autohide:
617+ showhide_time = enter_time;
618+ break;
619+ case AutohideType.Intellihide:
620+ if (WindowIntersectingOther)
621+ showhide_time = enter_time;
622+ break;
623+ }
624 AnimatedDraw ();
625 }
626-
627+
628 DragCursorUpdate ();
629 }
630 }
631
632- Gdk.Rectangle MinimumDockArea {
633+ public Gdk.Rectangle MinimumDockArea {
634 get {
635 return PositionProvider.MinimumDockArea;
636 }
637 }
638
639+ bool WindowIntersectingOther {
640+ get { return AutohideTracker.WindowIntersectingOther; }
641+ }
642+
643+ IEnumerable<Gdk.Window> WindowStack {
644+ get {
645+ try {
646+ return Screen.WindowStack;
647+ } catch {
648+ try {
649+ return Wnck.Screen.Default.WindowsStacked.Select (wnk => Gdk.Window.ForeignNew ((uint) wnk.Xid));
650+ } catch {
651+ return null;
652+ }
653+ }
654+ }
655+ }
656+
657 public DockArea (DockWindow window) : base ()
658 {
659 this.window = window;
660
661+ AutohideTracker = new AutohideTracker (this);
662 PositionProvider = new ItemPositionProvider (this);
663
664 AnimationState = new DockAnimationState ();
665@@ -317,7 +350,8 @@
666 () => DockItems.Any (di => DateTime.UtcNow - di.AttentionRequestStartTime < BounceTime));
667
668 AnimationState.AddCondition (Animations.InputModeChanged,
669- () => DateTime.UtcNow - interface_change_time < SummonTime);
670+ () => DateTime.UtcNow - interface_change_time < SummonTime ||
671+ DateTime.UtcNow - showhide_time < SummonTime);
672 }
673
674 void HandleItemNeedsUpdate (object sender, UpdateRequestArgs args)
675@@ -331,6 +365,8 @@
676 return false;
677 });
678 }
679+
680+ RequestFullRender ();
681 AnimatedDraw ();
682 }
683
684@@ -513,6 +549,7 @@
685 DockPreferences.MaxIconSize = (int) (((double) Width / MinimumDockArea.Width) * IconSize);
686
687 SetIconRegions ();
688+ RequestFullRender ();
689 AnimatedDraw ();
690 }
691
692@@ -546,12 +583,11 @@
693 Display.GetPointer (out screen, out x, out y, out mod);
694
695 if (screen == Screen) {
696- Gdk.Rectangle geo, hide_offset;
697+ Gdk.Rectangle geo;
698 window.GetBufferedPosition (out geo.X, out geo.Y);
699- window.WindowHideOffset (out hide_offset.X, out hide_offset.Y);
700
701- x -= geo.X - hide_offset.X;
702- y -= geo.Y - hide_offset.Y;
703+ x -= geo.X;
704+ y -= geo.Y;
705 } else {
706 x = -4000;
707 y = -4000;
708@@ -656,23 +692,31 @@
709 }
710
711 //send off the clicks
712- Gdk.Point relative_point = Gdk.Point.Zero;
713- double zoom;
714- PointD center;
715- IconZoomedPosition (item, out center, out zoom);
716-
717- int xOffset = (int) (Cursor.X - center.X);
718- int yOffset = (int) (Cursor.Y - center.Y);
719-
720- relative_point.X = (int) (xOffset / zoom);
721- relative_point.Y = (int) (yOffset / zoom);
722-
723+ PointD relative_point = RelativePointOverItem (item);
724 DockItems [item].Clicked (evnt.Button, evnt.State, relative_point);
725
726 AnimatedDraw ();
727 }
728 return;
729 }
730+
731+ PointD RelativePointOverItem (int item)
732+ {
733+ PointD relative_point = new PointD (0,0);
734+ double zoom;
735+ PointD center;
736+ IconZoomedPosition (item, out center, out zoom);
737+
738+ int left = (int) (center.X - DockItems [item].Width * zoom / 2);
739+ int top = (int) (center.Y - DockItems [item].Height * zoom / 2);
740+ int right = (int) (center.X + DockItems [item].Width * zoom / 2);
741+ int bottom = (int) (center.Y + DockItems [item].Height * zoom / 2);
742+
743+ relative_point.X = (Cursor.X - left) / (double) (right - left);
744+ relative_point.Y = (Cursor.Y - top) / (double) (bottom - top);
745+
746+ return relative_point;
747+ }
748
749 protected override bool OnScrollEvent (Gdk.EventScroll evnt)
750 {
751@@ -686,17 +730,16 @@
752
753 void SetIconRegions ()
754 {
755- Gdk.Rectangle pos, area, offset;
756+ Gdk.Rectangle pos, area;
757 window.GetPosition (out pos.X, out pos.Y);
758 window.GetSize (out pos.Width, out pos.Height);
759
760- window.WindowHideOffset (out offset.X, out offset.Y);
761 // we use geo here instead of our position for the Y value because we know the parent window
762 // may offset us when hidden. This is not desired...
763 for (int i = 0; i < DockItems.Count; i++) {
764 Gdk.Point position = PositionProvider.IconUnzoomedPosition (i);
765- area = new Gdk.Rectangle (pos.X + (position.X - IconSize / 2) - offset.X,
766- pos.Y + (position.Y - IconSize / 2) - offset.Y,
767+ area = new Gdk.Rectangle (pos.X + (position.X - IconSize / 2),
768+ pos.Y + (position.Y - IconSize / 2),
769 IconSize,
770 IconSize);
771 DockItems [i].SetIconRegion (area);
772@@ -715,12 +758,8 @@
773 offset = GetDockArea ().Height;
774 offset = offset * 2 + 10;
775 } else {
776- if (DockPreferences.AutoHide && !drag_resizing) {
777- // setting the offset to 2 will trigger the parent window to unhide us if we are hidden.
778- if (AnimationState [Animations.UrgencyChanged])
779- offset = 2;
780- else
781- offset = 1;
782+ if (Hidden && !drag_resizing) {
783+ offset = 1;
784 } else {
785 offset = GetDockArea ().Height;
786 }
787
788=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/DockArea_DragAndDrop.cs'
789--- Do.Interface.Linux.Docky/src/Docky.Interface/DockArea_DragAndDrop.cs 2009-04-18 03:12:46 +0000
790+++ Do.Interface.Linux.Docky/src/Docky.Interface/DockArea_DragAndDrop.cs 2009-04-28 07:15:19 +0000
791@@ -132,16 +132,7 @@
792 } else {
793 Gdk.Point local_cursor = Cursor.RelativePointToRootPoint (window);
794
795- IEnumerable<Gdk.Window> windows;
796- try {
797- windows = Screen.WindowStack;
798- } catch {
799- try {
800- windows = Wnck.Screen.Default.WindowsStacked.Select (wnk => Gdk.Window.ForeignNew ((uint) wnk.Xid));
801- } catch {
802- return;
803- }
804- }
805+ IEnumerable<Gdk.Window> windows = WindowStack;
806
807 foreach (Gdk.Window w in windows.Reverse ()) {
808 if (w == null || w == window.GdkWindow || !w.IsVisible)
809@@ -207,7 +198,11 @@
810 if (CurrentDockItem != null && CurrentDockItem.IsAcceptingDrops) {
811 uriList.ForEach (uri => CurrentDockItem.ReceiveItem (uri));
812 } else {
813- uriList.ForEach (uri => DockServices.ItemsService.AddItemToDock (uri, PositionProvider.IndexAtPosition (Cursor)));
814+ int index = PositionProvider.IndexAtPosition (Cursor);
815+ Gdk.Point center = PositionProvider.IconUnzoomedPosition (index);
816+ if (center.X < Cursor.X)
817+ index++;
818+ uriList.ForEach (uri => DockServices.ItemsService.AddItemToDock (uri, index));
819 }
820
821 base.OnDragDataReceived (context, x, y, selectionData, info, time);
822
823=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/DockArea_Rendering.cs'
824--- Do.Interface.Linux.Docky/src/Docky.Interface/DockArea_Rendering.cs 2009-04-08 00:57:55 +0000
825+++ Do.Interface.Linux.Docky/src/Docky.Interface/DockArea_Rendering.cs 2009-05-02 19:07:49 +0000
826@@ -26,6 +26,7 @@
827
828 using Do.Interface;
829 using Do.Interface.CairoUtils;
830+using Do.Interface.Wink;
831
832 using Docky.Core;
833 using Docky.Utilities;
834@@ -49,12 +50,14 @@
835 const int UrgentIndicatorSize = 12;
836
837 Dictionary<IDockPainter, Surface> painter_surfaces;
838- bool fast_render_fail, first_render_set;
839+ bool next_fast_render, first_render_set, last_intersect;
840
841 Surface backbuffer, input_area_buffer, dock_icon_buffer;
842 Surface indicator, urgent_indicator;
843 IDockPainter painter, last_painter;
844
845+ DateTime LastOverlapCheck { get; set; }
846+
847 DateTime ActiveIconChangeTime { get; set; }
848
849 DateTime FirstRenderTime { get; set; }
850@@ -65,15 +68,15 @@
851
852 bool CanFastRender {
853 get {
854- bool canFastRender = !RenderData.ForceFullRender &&
855+ bool result = next_fast_render;
856+ next_fast_render = !RenderData.ForceFullRender &&
857 RenderData.ZoomIn == 1 &&
858 ZoomIn == 1 &&
859 !AnimationState [Animations.IconInsert] &&
860 !AnimationState [Animations.UrgencyChanged] &&
861 !AnimationState [Animations.Bounce];
862
863- fast_render_fail = canFastRender;
864- return canFastRender && !fast_render_fail;
865+ return result;
866 }
867 }
868
869@@ -97,6 +100,21 @@
870 }
871 }
872
873+ bool Hidden {
874+ get {
875+ bool hidden = false;
876+ switch (DockPreferences.AutohideType) {
877+ case AutohideType.Autohide:
878+ hidden = !CursorIsOverDockArea;
879+ break;
880+ case AutohideType.Intellihide:
881+ hidden = !CursorIsOverDockArea && WindowIntersectingOther;
882+ break;
883+ }
884+ return hidden;
885+ }
886+ }
887+
888 /// <value>
889 /// Icon Size used for the dock
890 /// </value>
891@@ -137,7 +155,7 @@
892 double PainterOpacity {
893 get { return 1 - DockIconOpacity; }
894 }
895-
896+
897 //// <value>
898 /// The overall offset of the dock as a whole
899 /// </value>
900@@ -145,7 +163,7 @@
901 get {
902 double offset = 0;
903 // we never hide in these conditions
904- if (!DockPreferences.AutoHide || drag_resizing || PainterOpacity == 1) {
905+ if (DockPreferences.AutohideType == AutohideType.None || drag_resizing || PainterOpacity == 1) {
906 if ((RenderTime - FirstRenderTime) > SummonTime)
907 return 0;
908 offset = 1 - Math.Min (1, (DateTime.UtcNow - FirstRenderTime).TotalMilliseconds / SummonTime.TotalMilliseconds);
909@@ -153,10 +171,10 @@
910 }
911
912 if (PainterOpacity > 0) {
913- if (CursorIsOverDockArea) {
914+ if (!Hidden) {
915 return 0;
916 } else {
917- offset = Math.Min (1, (RenderTime - enter_time).TotalMilliseconds /
918+ offset = Math.Min (1, (RenderTime - showhide_time).TotalMilliseconds /
919 SummonTime.TotalMilliseconds);
920 offset = Math.Min (offset, Math.Min (1,
921 (RenderTime - interface_change_time)
922@@ -166,9 +184,9 @@
923 if (PainterOverlayVisible)
924 offset = 1 - offset;
925 } else {
926- offset = Math.Min (1, (RenderTime - enter_time).TotalMilliseconds /
927+ offset = Math.Min (1, (RenderTime - showhide_time).TotalMilliseconds /
928 SummonTime.TotalMilliseconds);
929- if (CursorIsOverDockArea)
930+ if (!Hidden)
931 offset = 1 - offset;
932 }
933 return (int) (offset * PositionProvider.DockHeight * 1.5);
934@@ -186,7 +204,8 @@
935 double zoom = Math.Min (1, (RenderTime - enter_time).TotalMilliseconds /
936 BaseAnimationTime.TotalMilliseconds);
937 if (CursorIsOverDockArea) {
938- if (DockPreferences.AutoHide)
939+ if (DockPreferences.AutohideType == AutohideType.Autohide ||
940+ (DockPreferences.AutohideType == AutohideType.Intellihide && WindowIntersectingOther))
941 zoom = 1;
942 } else {
943 zoom = 1 - zoom;
944@@ -203,6 +222,15 @@
945 {
946 RenderData = new PreviousRenderData ();
947 painter_surfaces = new Dictionary<IDockPainter, Surface> ();
948+ AutohideTracker.IntersectionChanged +=HandleIntersectionChanged;
949+ }
950+
951+ void HandleIntersectionChanged(object sender, EventArgs e)
952+ {
953+ if (DockPreferences.AutohideType == AutohideType.Intellihide && !CursorIsOverDockArea) {
954+ showhide_time = DateTime.UtcNow;
955+ AnimatedDraw ();
956+ }
957 }
958
959 void DrawDrock (Context cr)
960@@ -225,13 +253,13 @@
961 cr.PaintWithAlpha (PainterOpacity);
962 }
963
964- bool isNotSummonTransition = PainterOpacity == 0 || CursorIsOverDockArea || !DockPreferences.AutoHide;
965+ bool isNotSummonTransition = PainterOpacity == 0 || !Hidden || !DockPreferences.AutoHide;
966 if (DockIconOpacity > 0 && isNotSummonTransition) {
967 if (dock_icon_buffer == null)
968 dock_icon_buffer = cr.Target.CreateSimilar (cr.Target.Content, Width, Height);
969
970 using (Context input_cr = new Context (dock_icon_buffer)) {
971- DrawIcons (input_cr);
972+ DrawIcons (input_cr, dockArea);
973 }
974
975 int offset = (int) (IconSize * (1 - DockIconOpacity));
976@@ -241,16 +269,15 @@
977 }
978 }
979
980- void DrawIcons (Context cr)
981+ void DrawIcons (Context cr, Gdk.Rectangle dockArea)
982 {
983 if (!CanFastRender) {
984 cr.AlphaFill ();
985+ int index = PositionProvider.IndexAtPosition (Cursor);
986 for (int i = 0; i < DockItems.Count; i++)
987- DrawIcon (cr, i);
988+ DrawIcon (cr, i, i == index);
989 } else {
990-
991 Gdk.Rectangle renderArea = Gdk.Rectangle.Zero;
992- Gdk.Rectangle dockArea = GetDockArea ();
993
994 int startItemPosition;
995 startItemPosition = Math.Min (Cursor.X, RenderData.LastCursor.X) -
996@@ -288,20 +315,25 @@
997 renderArea.Height = Height;
998
999 cr.Rectangle (renderArea.X, renderArea.Y, renderArea.Width, renderArea.Height);
1000+
1001+ // clear the areas outside the dock area
1002+ cr.Rectangle (0, dockArea.Y, dockArea.X, dockArea.Height);
1003+ cr.Rectangle (dockArea.X + dockArea.Width, dockArea.Y, Width - (dockArea.X + dockArea.Width), dockArea.Height);
1004 switch (DockPreferences.Orientation) {
1005 case DockOrientation.Bottom:
1006- cr.Rectangle (0, Width, 0, Height - dockArea.Height);
1007+ cr.Rectangle (0, 0, Width, Height - dockArea.Height);
1008 break;
1009 case DockOrientation.Top:
1010- cr.Rectangle (0, Width, dockArea.Height, Height - dockArea.Height);
1011+ cr.Rectangle (0, dockArea.Height, Width, Height - dockArea.Height);
1012 break;
1013 }
1014 cr.Operator = Operator.Clear;
1015 cr.Fill ();
1016 cr.Operator = Operator.Over;
1017
1018+ int index = PositionProvider.IndexAtPosition (Cursor);
1019 for (int i = startItem; i <= endItem; i++)
1020- DrawIcon (cr, i);
1021+ DrawIcon (cr, i, i == index);
1022 }
1023
1024 RenderData.LastCursor = Cursor;
1025@@ -309,7 +341,7 @@
1026 RenderData.ForceFullRender = false;
1027 }
1028
1029- void DrawIcon (Context cr, int icon)
1030+ void DrawIcon (Context cr, int icon, bool hovered)
1031 {
1032 // Don't draw the icon we are dragging around
1033 if (GtkDragging && !DragState.IsFinished) {
1034@@ -424,7 +456,7 @@
1035 // we do a null check here to allow things like separator items to supply
1036 // a null. This allows us to draw nothing at all instead of rendering a
1037 // blank surface (which is slow)
1038- if (!PopupMenu.Visible && PositionProvider.IndexAtPosition (Cursor) == icon &&
1039+ if (!PopupMenu.Visible && hovered &&
1040 CursorIsOverDockArea && dockItem.GetTextSurface (cr.Target) != null && !GtkDragging && !drag_resizing) {
1041
1042 Gdk.Point textPoint;
1043@@ -598,7 +630,7 @@
1044
1045 protected override bool OnExposeEvent(EventExpose evnt)
1046 {
1047- if (!IsDrawable || window.IsRepositionHidden)
1048+ if (!IsDrawable)
1049 return false;
1050
1051 RenderTime = DateTime.UtcNow;
1052@@ -626,7 +658,8 @@
1053
1054 cr = Gdk.CairoHelper.Create (GdkWindow);
1055
1056- Gdk.Point finalTarget = new Gdk.Point (0, 0).RelativeMovePoint (VerticalOffset, RelativeMove.Outward);
1057+ int vert = VerticalOffset;
1058+ Gdk.Point finalTarget = new Gdk.Point (0, 0).RelativeMovePoint (vert, RelativeMove.Outward);
1059
1060 cr.SetSource (backbuffer, finalTarget.X, finalTarget.Y);
1061
1062
1063=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/DockWindow.cs'
1064--- Do.Interface.Linux.Docky/src/Docky.Interface/DockWindow.cs 2009-04-26 21:00:06 +0000
1065+++ Do.Interface.Linux.Docky/src/Docky.Interface/DockWindow.cs 2009-04-27 20:42:27 +0000
1066@@ -50,7 +50,6 @@
1067 IDoController controller;
1068 Gdk.Rectangle current_mask;
1069 uint strut_timer;
1070- bool is_repositioned_hidden;
1071 bool presented;
1072 int buffer_x, buffer_y;
1073 int buffer_width, buffer_height;
1074@@ -58,10 +57,6 @@
1075 public new string Name {
1076 get { return "Docky"; }
1077 }
1078-
1079- public bool IsRepositionHidden {
1080- get { return is_repositioned_hidden; }
1081- }
1082
1083 public IDoController Controller {
1084 get { return controller; }
1085@@ -172,17 +167,6 @@
1086
1087 (cr as IDisposable).Dispose ();
1088 pixmap.Dispose ();
1089-
1090- if (area.Height == 1) {
1091- GLib.Timeout.Add (500, () => {
1092- if (current_mask.Height == 1)
1093- HideReposition ();
1094- return false;
1095- });
1096- } else {
1097- if (is_repositioned_hidden)
1098- Reposition ();
1099- }
1100 }
1101
1102 protected override bool OnButtonReleaseEvent (Gdk.EventButton evnt)
1103@@ -250,54 +234,7 @@
1104 break;
1105 }
1106
1107- if (Display != null)
1108- Display.Sync ();
1109-
1110 results.SlideFromBottom = DockPreferences.Orientation == DockOrientation.Bottom;
1111- is_repositioned_hidden = false;
1112- }
1113-
1114- void HideReposition ()
1115- {
1116- Gdk.Rectangle geo, main;
1117-
1118- GetSize (out main.Width, out main.Height);
1119- geo = LayoutUtils.MonitorGemonetry ();
1120-
1121- switch (DockPreferences.Orientation) {
1122- case DockOrientation.Bottom:
1123- Move ((geo.X + geo.Width / 2) - main.Width / 2, geo.Y + geo.Height);
1124- break;
1125- case DockOrientation.Top:
1126- Move (geo.X, geo.Y - main.Height);
1127- break;
1128- }
1129-
1130- if (Display != null)
1131- Display.Sync ();
1132-
1133- is_repositioned_hidden = true;
1134- }
1135-
1136- public void WindowHideOffset (out int x, out int y)
1137- {
1138- x = y = 0;
1139-
1140- Gdk.Rectangle main, geo;
1141- main.Width = dock_area.Width;
1142- main.Height = dock_area.Height;
1143- GetBufferedPosition (out main.X, out main.Y);
1144- geo = LayoutUtils.MonitorGemonetry ();
1145-
1146-
1147- switch (DockPreferences.Orientation) {
1148- case DockOrientation.Bottom:
1149- y = main.Y - ((geo.Y + geo.Height) - main.Height);
1150- return;
1151- case DockOrientation.Top:
1152- y = main.Y - geo.Y;
1153- return;
1154- }
1155 }
1156
1157 public void GetBufferedPosition (out int x, out int y)
1158
1159=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/AbstractDockItem.cs'
1160--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/AbstractDockItem.cs 2009-04-21 16:10:39 +0000
1161+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/AbstractDockItem.cs 2009-05-02 18:42:09 +0000
1162@@ -42,6 +42,8 @@
1163 uint size_changed_timer;
1164 bool needs_attention;
1165
1166+ bool time_since_click_overdue;
1167+
1168 protected int current_size;
1169
1170 protected virtual Surface IconSurface { get; set; }
1171@@ -70,7 +72,7 @@
1172 /// <value>
1173 /// The last time this icon was "clicked" that required an animation
1174 /// </value>
1175- public virtual DateTime LastClick { get; protected set; }
1176+ public virtual DateTime LastClick { get; private set; }
1177
1178 public int Position { get; set; }
1179
1180@@ -127,7 +129,17 @@
1181 }
1182
1183 public TimeSpan TimeSinceClick {
1184- get { return DockArea.RenderTime - LastClick; }
1185+ get {
1186+ if (time_since_click_overdue)
1187+ return new TimeSpan (1, 0, 0);
1188+
1189+ TimeSpan result = DockArea.RenderTime - LastClick;
1190+
1191+ if (result.TotalMilliseconds > 1000)
1192+ time_since_click_overdue = true;
1193+
1194+ return result;
1195+ }
1196 }
1197
1198 public TimeSpan TimeSinceAdd {
1199@@ -138,7 +150,7 @@
1200 {
1201 NeedsAttention = false;
1202 Description = "";
1203- AttentionRequestStartTime = LastClick = new DateTime (0);
1204+ AttentionRequestStartTime = LastClick = new DateTime (0);
1205
1206 DockPreferences.IconSizeChanged += OnIconSizeChanged;
1207 DockWindow.Window.StyleSet += HandleStyleSet;
1208@@ -174,9 +186,10 @@
1209 /// <param name="controller">
1210 /// A <see cref="IDoController"/>
1211 /// </param>
1212- public virtual void Clicked (uint button, ModifierType state, Gdk.Point position)
1213+ public virtual void Clicked (uint button, ModifierType state, PointD position)
1214 {
1215 LastClick = DateTime.UtcNow;
1216+ time_since_click_overdue = false;
1217 }
1218
1219 public virtual void Scrolled (Gdk.ScrollDirection direction)
1220@@ -305,6 +318,7 @@
1221
1222 size_changed_timer = GLib.Timeout.Add (150, delegate {
1223 ResetSurfaces ();
1224+ size_changed_timer = 0;
1225 return false;
1226 });
1227 }
1228@@ -322,6 +336,9 @@
1229
1230 protected void RedrawIcon ()
1231 {
1232+ if (size_changed_timer > 0)
1233+ return;
1234+
1235 ResetIconSurface ();
1236 OnUpdateNeeded (new UpdateRequestArgs (this, UpdateRequestType.IconChanged));
1237 }
1238
1239=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/ActionDockItem.cs'
1240--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/ActionDockItem.cs 2009-04-21 16:10:39 +0000
1241+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/ActionDockItem.cs 2009-04-29 06:22:41 +0000
1242@@ -48,7 +48,7 @@
1243 SetText (action.Name);
1244 }
1245
1246- public override void Clicked (uint button, ModifierType state, Gdk.Point position)
1247+ public override void Clicked (uint button, ModifierType state, PointD position)
1248 {
1249 if (button == 1) {
1250 Services.Core.PerformActionOnItem (action, target_item);
1251
1252=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/ClockDockItem.cs'
1253--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/ClockDockItem.cs 2009-04-21 16:10:39 +0000
1254+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/ClockDockItem.cs 2009-04-29 06:22:41 +0000
1255@@ -136,7 +136,7 @@
1256 return tmp_surface;
1257 }
1258
1259- public override void Clicked (uint button, Gdk.ModifierType state, Gdk.Point position)
1260+ public override void Clicked (uint button, Gdk.ModifierType state, PointD position)
1261 {
1262 cal_painter.Summon ();
1263 base.Clicked (button, state, position);
1264
1265=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/DoDockItem.cs'
1266--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/DoDockItem.cs 2009-04-21 16:10:39 +0000
1267+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/DoDockItem.cs 2009-05-02 01:35:08 +0000
1268@@ -47,6 +47,10 @@
1269 protected override string Icon {
1270 get { return "gnome-do"; }
1271 }
1272+
1273+ public override int WindowCount {
1274+ get { return 1; }
1275+ }
1276
1277 HotSeatPainter hot_seat_painter;
1278
1279@@ -58,7 +62,7 @@
1280 }
1281 }
1282
1283- public override void Clicked (uint button, ModifierType state, Gdk.Point position)
1284+ public override void Clicked (uint button, ModifierType state, PointD position)
1285 {
1286 if (button == 1)
1287 Services.Windowing.SummonMainWindow ();
1288@@ -87,17 +91,11 @@
1289
1290 public IEnumerable<AbstractMenuArgs> GetMenuItems ()
1291 {
1292- yield return new SeparatorMenuButtonArgs ();
1293-
1294- yield return new SimpleMenuButtonArgs (() => DockPreferences.AutoHide = !DockPreferences.AutoHide,
1295- Catalog.GetString ("Automatically Hide"), DockPreferences.AutoHide ? EnableIcon : DisableIcon).AsDark ();
1296-
1297- yield return new SimpleMenuButtonArgs (() => DockPreferences.ZoomEnabled = !DockPreferences.ZoomEnabled,
1298- Catalog.GetString ("Zoom Icons"), DockPreferences.ZoomEnabled ? EnableIcon : DisableIcon).AsDark ();
1299-
1300- if (Gdk.Screen.Default.NMonitors > 1)
1301+ if (Gdk.Screen.Default.NMonitors > 1) {
1302+ yield return new SeparatorMenuButtonArgs ();
1303 yield return new SimpleMenuButtonArgs (() => DockPreferences.Monitor++,
1304 Catalog.GetString ("Switch Monitors"), "display").AsDark ();
1305+ }
1306
1307 foreach (IRunnableItem item in Services.Application.MainMenuItems) {
1308 yield return new SeparatorMenuButtonArgs ();
1309
1310=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/HotSeatProxyItem.cs'
1311--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/HotSeatProxyItem.cs 2009-04-21 16:10:39 +0000
1312+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/HotSeatProxyItem.cs 2009-04-29 06:22:41 +0000
1313@@ -123,7 +123,7 @@
1314 return inner.GetTextSurface (similar);
1315 }
1316
1317- public override void Clicked (uint button, Gdk.ModifierType state, Gdk.Point position)
1318+ public override void Clicked (uint button, Gdk.ModifierType state, PointD position)
1319 {
1320 DockServices.ItemsService.ResetHotSeat (inner);
1321 base.Clicked (button, state, position);
1322
1323=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/ItemDockItem.cs'
1324--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/ItemDockItem.cs 2009-04-21 16:10:39 +0000
1325+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/ItemDockItem.cs 2009-04-29 06:22:41 +0000
1326@@ -226,7 +226,7 @@
1327 base.HotSeatRequested ();
1328 }
1329
1330- public override void Clicked (uint button, Gdk.ModifierType state, Gdk.Point position)
1331+ public override void Clicked (uint button, Gdk.ModifierType state, PointD position)
1332 {
1333 SetIconRegionFromCache ();
1334 base.Clicked (button, state, position);
1335
1336=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/TrashDockItem.cs'
1337--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/TrashDockItem.cs 2009-04-22 03:50:29 +0000
1338+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/TrashDockItem.cs 2009-04-29 06:22:41 +0000
1339@@ -110,7 +110,7 @@
1340 return true;
1341 }
1342
1343- public override void Clicked (uint button, ModifierType state, Gdk.Point position)
1344+ public override void Clicked (uint button, ModifierType state, Cairo.PointD position)
1345 {
1346 if (button == 1) {
1347 Services.Environment.OpenUrl ("trash://");
1348
1349=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/WnckDockItem.cs'
1350--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/WnckDockItem.cs 2009-04-18 03:12:46 +0000
1351+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Items/WnckDockItem.cs 2009-04-29 06:22:41 +0000
1352@@ -116,7 +116,7 @@
1353 VisibleWindows.ElementAt (last_raised).CenterAndFocusWindow ();
1354 }
1355
1356- public override void Clicked (uint button, Gdk.ModifierType state, Gdk.Point position)
1357+ public override void Clicked (uint button, Gdk.ModifierType state, PointD position)
1358 {
1359 if (!Windows.Any () || !HasVisibleApps || button == 2) {
1360 AnimationType = ClickAnimationType.Bounce;
1361
1362=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/DockBackgroundRenderer.cs'
1363--- Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/DockBackgroundRenderer.cs 2009-03-10 18:10:04 +0000
1364+++ Do.Interface.Linux.Docky/src/Docky.Interface/Docky.Interface.Painters/DockBackgroundRenderer.cs 2009-05-01 16:09:04 +0000
1365@@ -35,7 +35,6 @@
1366 static Surface sr;
1367 static int height;
1368
1369- const int ShineWidth = 120;
1370 const int width = 1500;
1371
1372 public static void RenderDockBackground (Context context, Gdk.Rectangle dockArea)
1373
1374=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/DockyConfigurationWidget.cs'
1375--- Do.Interface.Linux.Docky/src/Docky.Interface/DockyConfigurationWidget.cs 2009-04-22 03:50:29 +0000
1376+++ Do.Interface.Linux.Docky/src/Docky.Interface/DockyConfigurationWidget.cs 2009-04-29 03:12:34 +0000
1377@@ -83,20 +83,18 @@
1378 zoom_scale.SetIncrements (.1, .1);
1379 zoom_scale.Value = DockPreferences.ZoomPercent;
1380
1381- zoom_width_scale.Digits = 0;
1382- zoom_width_scale.SetRange (200, 500);
1383- zoom_width_scale.SetIncrements (10, 10);
1384- zoom_width_scale.Value = DockPreferences.ZoomSize;
1385-
1386 advanced_indicators_checkbutton.Active = DockPreferences.IndicateMultipleWindows;
1387- autohide_checkbutton.Active = DockPreferences.AutoHide;
1388- window_overlap_checkbutton.Active = DockPreferences.AllowOverlap;
1389 zoom_checkbutton.Active = DockPreferences.ZoomEnabled;
1390
1391 orientation_combobox.AppendText (DockOrientation.Bottom.ToString ());
1392 orientation_combobox.AppendText (DockOrientation.Top.ToString ());
1393 orientation_combobox.Active = DockPreferences.Orientation == DockOrientation.Bottom ? 0 : 1;
1394
1395+ autohide_combo.AppendText (((AutohideType) 0).ToString ());
1396+ autohide_combo.AppendText (((AutohideType) 1).ToString ());
1397+ autohide_combo.AppendText (((AutohideType) 2).ToString ());
1398+ autohide_combo.Active = (int) DockPreferences.AutohideType;
1399+
1400 BuildDocklets ();
1401
1402 SetSensitivity ();
1403@@ -134,9 +132,7 @@
1404 void SetSensitivity ()
1405 {
1406 zoom_scale.Sensitive =
1407- zoom_width_scale.Sensitive =
1408 zoom_size_label.Sensitive =
1409- zoom_width_label.Sensitive =
1410 DockPreferences.ZoomEnabled;
1411 }
1412
1413@@ -171,28 +167,16 @@
1414 DockPreferences.ZoomEnabled = zoom_checkbutton.Active;
1415 }
1416
1417- protected virtual void OnWindowOverlapCheckbuttonToggled (object sender, System.EventArgs e)
1418- {
1419- if (setup) return;
1420- DockPreferences.AllowOverlap = window_overlap_checkbutton.Active;
1421- }
1422-
1423- protected virtual void OnAutohideCheckbuttonToggled (object sender, System.EventArgs e)
1424- {
1425- if (setup) return;
1426- DockPreferences.AutoHide = autohide_checkbutton.Active;
1427- }
1428-
1429 protected virtual void OnOrientationComboboxChanged (object sender, System.EventArgs e)
1430 {
1431 if (setup) return;
1432 DockPreferences.Orientation = (DockOrientation) orientation_combobox.Active;
1433 }
1434-
1435- protected virtual void OnZoomWidthScaleValueChanged (object sender, System.EventArgs e)
1436+
1437+ protected virtual void OnAutohideComboChanged (object sender, System.EventArgs e)
1438 {
1439 if (setup) return;
1440- DockPreferences.ZoomSize = (int) zoom_width_scale.Value;
1441+ DockPreferences.AutohideType = (AutohideType) autohide_combo.Active;
1442 }
1443
1444 public override void Dispose ()
1445
1446=== modified file 'Do.Interface.Linux.Docky/src/Docky.Interface/LayoutUtils.cs'
1447--- Do.Interface.Linux.Docky/src/Docky.Interface/LayoutUtils.cs 2009-02-26 07:55:16 +0000
1448+++ Do.Interface.Linux.Docky/src/Docky.Interface/LayoutUtils.cs 2009-04-29 08:44:10 +0000
1449@@ -64,11 +64,24 @@
1450 {
1451 return monitor_geo;
1452 }
1453+
1454+ public static Gdk.Rectangle RelativeRectangleToRootPoint (this Gdk.Rectangle relativePoint, Gtk.Window window)
1455+ {
1456+ Gdk.Rectangle main;
1457+ if (window is DockWindow)
1458+ (window as DockWindow).GetBufferedPosition (out main.X, out main.Y);
1459+ else
1460+ window.GetPosition (out main.X, out main.Y);
1461+ return new Gdk.Rectangle (main.X + relativePoint.X, main.Y + relativePoint.Y, relativePoint.Width, relativePoint.Height);
1462+ }
1463
1464 public static Gdk.Point RelativePointToRootPoint (this Gdk.Point relativePoint, Gtk.Window window)
1465 {
1466 Gdk.Rectangle main;
1467- window.GetPosition (out main.X, out main.Y);
1468+ if (window is DockWindow)
1469+ (window as DockWindow).GetBufferedPosition (out main.X, out main.Y);
1470+ else
1471+ window.GetPosition (out main.X, out main.Y);
1472 return new Gdk.Point (main.X + relativePoint.X, main.Y + relativePoint.Y);
1473 }
1474
1475
1476=== added file 'Do.Interface.Linux.Docky/src/Docky.Utilities/AutohideType.cs'
1477--- Do.Interface.Linux.Docky/src/Docky.Utilities/AutohideType.cs 1970-01-01 00:00:00 +0000
1478+++ Do.Interface.Linux.Docky/src/Docky.Utilities/AutohideType.cs 2009-04-27 20:42:27 +0000
1479@@ -0,0 +1,30 @@
1480+//
1481+// Copyright (C) 2009 GNOME Do
1482+//
1483+// This program is free software: you can redistribute it and/or modify
1484+// it under the terms of the GNU General Public License as published by
1485+// the Free Software Foundation, either version 3 of the License, or
1486+// (at your option) any later version.
1487+//
1488+// This program is distributed in the hope that it will be useful,
1489+// but WITHOUT ANY WARRANTY; without even the implied warranty of
1490+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1491+// GNU General Public License for more details.
1492+//
1493+// You should have received a copy of the GNU General Public License
1494+// along with this program. If not, see <http://www.gnu.org/licenses/>.
1495+//
1496+
1497+using System;
1498+
1499+namespace Docky
1500+{
1501+
1502+
1503+ public enum AutohideType
1504+ {
1505+ None = 0,
1506+ Autohide,
1507+ Intellihide,
1508+ }
1509+}
1510
1511=== modified file 'Do.Interface.Linux.Docky/src/Docky.Utilities/DockPreferences.cs'
1512--- Do.Interface.Linux.Docky/src/Docky.Utilities/DockPreferences.cs 2009-04-23 01:09:57 +0000
1513+++ Do.Interface.Linux.Docky/src/Docky.Utilities/DockPreferences.cs 2009-04-29 03:12:34 +0000
1514@@ -62,13 +62,8 @@
1515 get { return 350; }
1516 }
1517
1518- static int zoom_size = prefs.Get ("ZoomSize", 330);
1519 public static int ZoomSize {
1520- get { return (int) (zoom_size * (IconSize / (double) DefaultIconSize)); }
1521- set {
1522- prefs.Set ("ZoomSize", value);
1523- zoom_size = value;
1524- }
1525+ get { return (int) (330 * (IconSize / (double) DefaultIconSize)); }
1526 }
1527
1528 static bool indicate_multiple_windows = prefs.Get ("IndicateMultipleWindows", false);
1529@@ -153,33 +148,8 @@
1530 get { return ZoomPercent; }
1531 }
1532
1533- static bool autohide = prefs.Get ("AutoHide", false);
1534 public static bool AutoHide {
1535- get { return autohide; }
1536- set {
1537- if (autohide == value)
1538- return;
1539-
1540- prefs.Set ("AutoHide", value);
1541- autohide = value;
1542- if (AutohideChanged != null)
1543- AutohideChanged ();
1544- }
1545- }
1546-
1547- static bool allow_overlap = prefs.Get ("AllowWindowOverlap", false);
1548- public static bool AllowOverlap {
1549- get { return allow_overlap; }
1550- set {
1551- if (allow_overlap == value)
1552- return;
1553-
1554- prefs.Set ("AllowWindowOverlap", value);
1555- allow_overlap = value;
1556-
1557- if (AllowOverlapChanged != null)
1558- AllowOverlapChanged ();
1559- }
1560+ get { return AutohideType != AutohideType.None; }
1561 }
1562
1563 static TimeSpan summon_time = new TimeSpan (0, 0, 0, 0, prefs.Get ("SummonTime", 100));
1564@@ -243,6 +213,19 @@
1565 OrientationChanged ();
1566 }
1567 }
1568+
1569+ static AutohideType hide = (AutohideType) Enum.Parse (typeof (AutohideType), prefs.Get ("AutohideType", AutohideType.None.ToString ()));
1570+ public static AutohideType AutohideType {
1571+ get { return hide; }
1572+ set {
1573+ if (hide == value)
1574+ return;
1575+ hide = value;
1576+ prefs.Set ("AutohideType", value.ToString ());
1577+ if (AutohideChanged != null)
1578+ AutohideChanged ();
1579+ }
1580+ }
1581
1582 #region blacklists
1583 static List<string> item_blacklist = DeserializeBlacklist ();
1584
1585=== modified file 'Do.Interface.Linux.Docky/src/Docky.Utilities/GtkUtils.cs'
1586--- Do.Interface.Linux.Docky/src/Docky.Utilities/GtkUtils.cs 2009-02-13 00:19:29 +0000
1587+++ Do.Interface.Linux.Docky/src/Docky.Utilities/GtkUtils.cs 2009-04-27 20:42:27 +0000
1588@@ -38,5 +38,13 @@
1589 self.Colormap = colormap;
1590 colormap.Dispose ();
1591 }
1592+
1593+ public static Gdk.Rectangle EasyGeometery (this Gdk.Window self)
1594+ {
1595+ Gdk.Rectangle rect;
1596+ int depth;
1597+ self.GetGeometry (out rect.X, out rect.Y, out rect.Width, out rect.Height, out depth);
1598+ return rect;
1599+ }
1600 }
1601 }
1602
1603=== modified file 'Do.Interface.Wink/src/Do.Interface.Wink/ScreenUtils.cs'
1604--- Do.Interface.Wink/src/Do.Interface.Wink/ScreenUtils.cs 2009-04-04 02:31:03 +0000
1605+++ Do.Interface.Wink/src/Do.Interface.Wink/ScreenUtils.cs 2009-04-29 06:22:41 +0000
1606@@ -30,20 +30,27 @@
1607 public static class ScreenUtils
1608 {
1609 static string ViewportFormatString = Catalog.GetString ("Desktop") + " {0}";
1610- static List<Viewport> viewports;
1611+ static Dictionary<Workspace, Viewport [,]> layouts;
1612+
1613+ public static event EventHandler ViewportsChanged;
1614
1615 public static Viewport ActiveViewport {
1616 get {
1617 Workspace wsp = Wnck.Screen.Default.ActiveWorkspace;
1618 Gdk.Rectangle geo = new Gdk.Rectangle (wsp.ViewportX, wsp.ViewportY, wsp.Screen.Width, wsp.Screen.Height);
1619- if (viewports.Any (vp => vp.Area == geo))
1620- return viewports.First (vp => vp.Area == geo);
1621+ if (Viewports.Any (vp => vp.Area == geo))
1622+ return Viewports.First (vp => vp.Area == geo);
1623 return null;
1624 }
1625 }
1626
1627 public static IEnumerable<Viewport> Viewports {
1628- get { return viewports.AsEnumerable (); }
1629+ get {
1630+ foreach (Viewport [,] layout in layouts.Values) {
1631+ foreach (Viewport viewport in layout)
1632+ yield return viewport;
1633+ }
1634+ }
1635 }
1636
1637 static ScreenUtils ()
1638@@ -87,11 +94,26 @@
1639 screen.ToggleShowingDesktop (false);
1640 }
1641
1642+ public static Viewport [,] ViewportLayout ()
1643+ {
1644+ return ViewportLayout (Wnck.Screen.Default.ActiveWorkspace);
1645+ }
1646+
1647+ public static Viewport [,] ViewportLayout (Workspace workspace)
1648+ {
1649+ if (!layouts.ContainsKey (workspace))
1650+ return new Viewport [0,0];
1651+
1652+ return layouts [workspace];
1653+ }
1654+
1655 static void UpdateViewports ()
1656 {
1657- viewports = new List<Viewport> ();
1658+ layouts = new Dictionary<Workspace, Viewport [,]> ();
1659+
1660 int currentViewport = 1;
1661 foreach (Wnck.Workspace workspace in Wnck.Screen.Default.Workspaces) {
1662+
1663 if (workspace.IsVirtual) {
1664 int viewportWidth;
1665 int viewportHeight;
1666@@ -101,26 +123,31 @@
1667 int rows = workspace.Height / viewportHeight;
1668 int columns = workspace.Width / viewportWidth;
1669
1670+ layouts [workspace] = new Viewport [rows, columns];
1671+
1672 for (int i = 0; i < rows; i++) {
1673 for (int j = 0; j < columns; j++) {
1674 Gdk.Rectangle area = new Gdk.Rectangle (j * viewportWidth,
1675 i * viewportHeight,
1676 viewportWidth,
1677 viewportHeight);
1678- viewports.Add (new Viewport (string.Format (ViewportFormatString, currentViewport),
1679- area,
1680- workspace));
1681+ layouts [workspace] [i, j] = new Viewport (string.Format (ViewportFormatString, currentViewport),
1682+ area,
1683+ workspace);
1684 currentViewport++;
1685 }
1686 }
1687 } else {
1688+ layouts [workspace] = new Viewport [1,1];
1689 Viewport viewport = new Viewport (string.Format (ViewportFormatString, currentViewport),
1690 new Gdk.Rectangle (0, 0, workspace.Width, workspace.Height),
1691 workspace);
1692- viewports.Add (viewport);
1693+ layouts [workspace] [0,0] = viewport;
1694 currentViewport++;
1695 }
1696 }
1697+ if (ViewportsChanged != null)
1698+ ViewportsChanged (new object (), EventArgs.Empty);
1699 }
1700 }
1701 }
1702
1703=== modified file 'Do.Interface.Wink/src/Do.Interface.Wink/Viewport.cs'
1704--- Do.Interface.Wink/src/Do.Interface.Wink/Viewport.cs 2009-04-21 04:12:30 +0000
1705+++ Do.Interface.Wink/src/Do.Interface.Wink/Viewport.cs 2009-05-01 18:02:03 +0000
1706@@ -104,6 +104,11 @@
1707 return RawWindows ().Where (w => !w.IsSkipTasklist && w.WindowType != Wnck.WindowType.Dock);
1708 }
1709
1710+ public IEnumerable<Wnck.Window> UnprocessedWindows ()
1711+ {
1712+ return RawWindows ().Where (w => w.WindowType != Wnck.WindowType.Dock);
1713+ }
1714+
1715 public void MoveWindowInto (Wnck.Window window)
1716 {
1717 if (parent.IsVirtual) {
1718
1719=== modified file 'Do.Platform.Linux/gtk-gui/gui.stetic'
1720--- Do.Platform.Linux/gtk-gui/gui.stetic 2009-04-20 00:12:53 +0000
1721+++ Do.Platform.Linux/gtk-gui/gui.stetic 2009-04-29 03:12:34 +0000
1722@@ -7,6 +7,7 @@
1723 <import>
1724 <widget-library name="gnomedesktop-sharp, Version=2.20.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
1725 <widget-library name="notify-sharp, Version=0.4.0.0, Culture=neutral, PublicKeyToken=2df29c54e245917a" />
1726+ <widget-library name="../../Do.Interface.Linux/bin/Debug/Do.Interface.Linux.dll" />
1727 <widget-library name="../bin/Debug/Do.Platform.Linux.dll" internal="true" />
1728 </import>
1729 <widget class="Gtk.Bin" id="Do.Platform.Linux.AbstractLoginWidget" design-size="300 300">