diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-01-24 11:03:07 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-01-24 11:03:07 +0100 |
commit | 4b7a48bda37da6ac1c08822c7c888be6bf7cb751 (patch) | |
tree | 919bbd1c7eeca956a4cb20c8e3b88c9a2e27f821 /src/renderers/pieWindow.vala | |
parent | 751a72bc2d2f54e27206a32cd4b7b17e9837228e (diff) | |
parent | b683ce2789d95b2e9f221e75adc30efd91cfb901 (diff) |
Merge tag 'upstream/0.5.7'
Upstream version 0.5.7
Diffstat (limited to 'src/renderers/pieWindow.vala')
-rw-r--r-- | src/renderers/pieWindow.vala | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/renderers/pieWindow.vala b/src/renderers/pieWindow.vala index a95b3e3..da346dd 100644 --- a/src/renderers/pieWindow.vala +++ b/src/renderers/pieWindow.vala @@ -89,11 +89,7 @@ public class PieWindow : Gtk.Window { // check for compositing if (this.screen.is_composited()) { - #if HAVE_GTK_3 - this.set_visual(this.screen.get_rgba_visual()); - #else - this.set_colormap(this.screen.get_rgba_colormap()); - #endif + this.set_visual(this.screen.get_rgba_visual()); this.has_compositing = true; } @@ -147,11 +143,7 @@ public class PieWindow : Gtk.Window { }); // draw the pie on expose - #if HAVE_GTK_3 - this.draw.connect(this.draw_window); - #else - this.expose_event.connect(this.draw_window); - #endif + this.draw.connect(this.draw_window); } ///////////////////////////////////////////////////////////////////// @@ -214,13 +206,7 @@ public class PieWindow : Gtk.Window { /// Draw the Pie. ///////////////////////////////////////////////////////////////////// - #if HAVE_GTK_3 - private bool draw_window(Cairo.Context ctx) { - #else - private bool draw_window(Gtk.Widget da, Gdk.EventExpose event) { - // clear the window - var ctx = Gdk.cairo_create(this.get_window()); - #endif + private bool draw_window(Cairo.Context ctx) { // paint the background image if there is no compositing if (this.has_compositing) { ctx.set_operator (Cairo.Operator.CLEAR); @@ -237,7 +223,17 @@ public class PieWindow : Gtk.Window { // get the mouse position double mouse_x = 0.0, mouse_y = 0.0; - this.get_pointer(out mouse_x, out mouse_y); + Gdk.ModifierType mask; + + var display = Gdk.Display.get_default(); + var manager = display.get_device_manager(); + GLib.List<weak Gdk.Device?> list = manager.list_devices(Gdk.DeviceType.MASTER); + + foreach(var device in list) { + if (device.input_source != Gdk.InputSource.KEYBOARD) { + this.get_window().get_device_position_double(device, out mouse_x, out mouse_y, out mask); + } + } // store the frame time double frame_time = this.timer.elapsed(); @@ -260,7 +256,11 @@ public class PieWindow : Gtk.Window { this.on_closing(); Gtk.grab_remove(this); FocusGrabber.ungrab(); - this.renderer.activate(); + + GLib.Timeout.add(10, () => { + this.renderer.activate(); + return false; + }); GLib.Timeout.add((uint)(Config.global.theme.fade_out_time*1000), () => { this.closed = true; |