Merge lp:~psybers/docky/scale into lp:docky

Proposed by Thiago Teixeira
Status: Rejected
Rejected by: Robert Dyer
Proposed branch: lp:~psybers/docky/scale
Merge into: lp:docky
Diff against target: 104 lines
2 files modified
Docky.Windowing/Xlib/Xlib.cs (+3/-0)
Docky/Docky/Interface/DockWindow.cs (+49/-0)
To merge this branch: bzr merge lp:~psybers/docky/scale
Reviewer Review Type Date Requested Status
Robert Dyer (community) Needs Fixing
Jason Smith (community) Disapprove
Review via email: mp+14137@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Thiago Teixeira (tvst) wrote :

Any chance this will make it into trunk?

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

Needs more development

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

I wrote it, and even I think it shouldnt be merged. :-)

The basics are there, but we definitely have to figure out how the user interaction works!

review: Needs Fixing
lp:~psybers/docky/scale updated
284. By Robert Dyer

merge trunk

285. By Robert Dyer

clean some

Unmerged revisions

285. By Robert Dyer

clean some

284. By Robert Dyer

merge trunk

283. By Robert Dyer

merge trunk

282. By Robert Dyer

stop the scale timer on clicks/scroll

281. By Robert Dyer

add scale plugin invoke over dbus after 2s hover on a window group

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Docky.Windowing/Xlib/Xlib.cs'
2--- Docky.Windowing/Xlib/Xlib.cs 2009-09-03 05:09:05 +0000
3+++ Docky.Windowing/Xlib/Xlib.cs 2009-11-02 02:31:14 +0000
4@@ -81,6 +81,9 @@
5 static extern IntPtr gdk_x11_display_get_xdisplay (IntPtr display);
6
7 [DllImport (libGdkX11)]
8+ public static extern IntPtr gdk_x11_get_default_root_xwindow ();
9+
10+ [DllImport (libGdkX11)]
11 static extern void gdk_x11_window_set_user_time (IntPtr window, uint timestamp);
12
13 [DllImport (libX11)]
14
15=== modified file 'Docky/Docky/Interface/DockWindow.cs'
16--- Docky/Docky/Interface/DockWindow.cs 2009-11-02 01:35:55 +0000
17+++ Docky/Docky/Interface/DockWindow.cs 2009-11-02 02:31:14 +0000
18@@ -288,9 +288,47 @@
19 hoveredItem = value;
20 SetHoveredAcceptsDrop ();
21 OnHoveredItemChanged (last);
22+
23+ if (hover_timer != 0)
24+ GLib.Source.Remove (hover_timer);
25+
26+ // if we hover for 2 seconds, this will attempt to tell the
27+ // Compiz Scale plugin to scale the window group
28+ hover_timer = GLib.Timeout.Add (2000, delegate {
29+ ShowCompizScale ();
30+
31+ return false;
32+ });
33 }
34 }
35
36+ void ShowCompizScale ()
37+ {
38+ if (compizProxy == null || hoveredItem == null || !(hoveredItem is WnckDockItem))
39+ return;
40+
41+ Wnck.Window window = (hoveredItem as WnckDockItem).Windows.FirstOrDefault ();
42+
43+ // there has to be at least 1 window
44+ if (window != null)
45+ try {
46+ compizProxy.activate (
47+ "root", (int) Xlib.Xlib.gdk_x11_get_default_root_xwindow (),
48+ "window", (int)window.Xid
49+ );
50+ } catch {}
51+ }
52+
53+ // the timer for activating the Scale plugin
54+ uint hover_timer;
55+ ICompizScaleProxy compizProxy;
56+
57+ [NDesk.DBus.Interface ("org.freedesktop.compiz")]
58+ interface ICompizScaleProxy
59+ {
60+ void activate (string screen, int screenId, string window, int windowId);
61+ }
62+
63 internal AbstractDockItem ClosestItem {
64 get {
65 return Items
66@@ -513,6 +551,10 @@
67
68 Realized += HandleRealized;
69 Docky.Controller.ThemeChanged += DockyControllerThemeChanged;
70+
71+ try {
72+ compizProxy = NDesk.DBus.Bus.Session.GetObject<ICompizScaleProxy> ("org.freedesktop.compiz", new NDesk.DBus.ObjectPath ("/org/freedesktop/compiz/scale/allscreens/initiate_group_key"));
73+ } catch {}
74 }
75
76
77@@ -751,6 +793,9 @@
78
79 protected override bool OnButtonPressEvent (EventButton evnt)
80 {
81+ if (hover_timer != 0)
82+ GLib.Source.Remove (hover_timer);
83+
84 if (InternalDragActive || ConfigurationMode)
85 return base.OnButtonPressEvent (evnt);
86
87@@ -813,6 +858,9 @@
88
89 protected override bool OnScrollEvent (EventScroll evnt)
90 {
91+ if (hover_timer != 0)
92+ GLib.Source.Remove (hover_timer);
93+
94 if (InternalDragActive || ConfigurationMode)
95 return base.OnScrollEvent (evnt);
96
97@@ -841,6 +889,7 @@
98 if (HoveredItem != null && ExternalDragActive) {
99 if (DragTracker.DragData != null && HoveredItem.CanAcceptDrop (DragTracker.DragData)) {
100 HoveredAcceptsDrop = true;
101+ ShowCompizScale ();
102 }
103 }
104 }

Subscribers

People subscribed via source and target branches

to status/vote changes: