summaryrefslogtreecommitdiff
path: root/src/renderers/pieWindow.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2015-01-24 11:03:06 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2015-01-24 11:03:06 +0100
commitb683ce2789d95b2e9f221e75adc30efd91cfb901 (patch)
tree7903b95887c3fbb995ec2e6a99b027053e617adf /src/renderers/pieWindow.vala
parent73201cab74e84e5372b6c4a1f72f7e70df5c0d5a (diff)
Imported Upstream version 0.5.7upstream/0.5.7
Diffstat (limited to 'src/renderers/pieWindow.vala')
-rw-r--r--src/renderers/pieWindow.vala38
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;