47
48
DockArea dock_area;
48
49
Interface.DoInteropService interop_service;
49
50
IDoController controller;
50
Gdk.Rectangle current_mask;
51
Gdk.Rectangle current_mask, blur_mask;
52
bool is_repositioned_hidden;
54
55
int buffer_x, buffer_y;
56
int buffer_width, buffer_height;
56
58
public new string Name {
57
59
get { return "Docky"; }
60
public bool IsRepositionHidden {
61
get { return is_repositioned_hidden; }
64
62
public IDoController Controller {
65
63
get { return controller; }
102
101
results = new BezelGlassResults (controller, 450, HUDStyle.Classic, new BezelColors (new Cairo.Color (.1, .1, .1, .8)));
102
results.SlideFromBottom = DockPreferences.Orientation == DockOrientation.Bottom;
103
103
results_window = new BezelGlassWindow (results);
109
109
void RegisterEvents ()
111
111
Realized += (o, a) => GdkWindow.SetBackPixmap (null, false);
170
170
(cr as IDisposable).Dispose ();
171
171
pixmap.Dispose ();
173
if (area.Height == 1) {
174
GLib.Timeout.Add (500, () => {
175
if (current_mask.Height == 1)
180
if (is_repositioned_hidden)
185
174
protected override bool OnButtonReleaseEvent (Gdk.EventButton evnt)
222
211
protected override void OnSizeAllocated (Gdk.Rectangle allocation)
213
buffer_width = allocation.Width;
214
buffer_height = allocation.Height;
224
216
base.OnSizeAllocated (allocation);
220
public void Reposition ()
230
222
Gdk.Rectangle geo, main, res;
232
224
GetSize (out main.Width, out main.Height);
233
225
results_window.GetSize (out res.Width, out res.Height);
234
geo = LayoutUtils.MonitorGemonetry ();
226
geo = LayoutUtils.MonitorGeometry ();
236
228
switch (DockPreferences.Orientation) {
237
229
case DockOrientation.Bottom:
243
235
results_window.Move ((geo.X + geo.Width / 2) - res.Width / 2, geo.Y + dock_area.DockHeight);
248
is_repositioned_hidden = false;
251
void HideReposition ()
253
Gdk.Rectangle geo, main;
255
GetSize (out main.Width, out main.Height);
256
geo = LayoutUtils.MonitorGemonetry ();
258
switch (DockPreferences.Orientation) {
259
case DockOrientation.Bottom:
260
Move ((geo.X + geo.Width / 2) - main.Width / 2, geo.Y + geo.Height);
262
case DockOrientation.Top:
263
Move (geo.X, geo.Y - main.Height);
269
is_repositioned_hidden = true;
272
public void WindowHideOffset (out int x, out int y)
276
if (!is_repositioned_hidden) {
281
GetSize (out main.Width, out main.Height);
282
switch (DockPreferences.Orientation) {
283
case DockOrientation.Bottom:
286
case DockOrientation.Top:
239
results.SlideFromBottom = DockPreferences.Orientation == DockOrientation.Bottom;
293
242
public void GetBufferedPosition (out int x, out int y)
250
public void GetBufferedSize (out int width, out int height)
252
if (buffer_width == 0 && buffer_height == 0)
253
GetSize (out buffer_width, out buffer_height);
254
width = buffer_width;
255
height = buffer_height;
301
258
public void DelaySetStruts ()
303
260
if (strut_timer > 0)
309
266
public bool SetStruts ()
311
X11Atoms atoms = new X11Atoms (GdkWindow);
268
X11Atoms atoms = X11Atoms.Instance;
313
uint [] struts = dock_area.StrutRequest;
314
uint [] first_struts = new [] { struts [0], struts [1], struts [2], struts [3] };
270
IntPtr [] struts = dock_area.StrutRequest.Select (i => (IntPtr) i).ToArray ();
271
IntPtr [] first_struts = new [] { struts [0], struts [1], struts [2], struts [3] };
320
277
Xlib.XChangeProperty (GdkWindow, atoms._NET_WM_STRUT_PARTIAL, atoms.XA_CARDINAL,
321
(int) XLib.PropertyMode.PropModeReplace, struts);
278
(int) PropertyMode.PropModeReplace, struts);
323
280
Xlib.XChangeProperty (GdkWindow, atoms._NET_WM_STRUT, atoms.XA_CARDINAL,
324
(int) XLib.PropertyMode.PropModeReplace, first_struts);
281
(int) PropertyMode.PropModeReplace, first_struts);
286
public void SetBackgroundBlur (Gdk.Rectangle area)
288
if (!IsRealized || blur_mask == area)
293
int WindowHeight = dock_area.Height;
294
X11Atoms atoms = X11Atoms.Instance;
296
IntPtr [] data = new IntPtr [8];
298
// this is meant to tell the blur-plugin what and how to blur, somehow
299
// the y-coords are interpreted as being CenterGravity, I wonder why
301
data [0] = (IntPtr) 2; // threshold
302
data [1] = (IntPtr) 0; // filter
303
data [2] = (IntPtr) XGravity.NorthWestGravity; // gravity of top-left
304
data [3] = (IntPtr) area.X; // x-coord of top-left
305
data [4] = (IntPtr) (WindowHeight / 2 - area.Height); // y-coord of top-left
306
data [5] = (IntPtr) XGravity.NorthWestGravity; // gravity of bottom-right
307
data [6] = (IntPtr) (area.X + area.Width); // bottom-right x-coord
308
data [7] = (IntPtr) (WindowHeight / 2); // bottom-right y-coord
310
Xlib.XChangeProperty (GdkWindow, atoms._COMPIZ_WM_WINDOW_BLUR, atoms.XA_INTEGER, (int) PropertyMode.PropModeReplace, data);
329
313
public void PresentWindow ()
425
#region IConfigurable implementation
426
public Bin GetConfiguration ()
428
return new DockyConfigurationWidget ();
431
public string Description {
433
return "Docky configuration";
437
public new string Icon {