Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Code from Gnome-Do */
- private static bool try_grab_window (Gtk.Window window)
- {
- uint time = Gtk.get_current_event_time();
- if (Gdk.pointer_grab (window.get_window(),
- true,
- Gdk.EventMask.BUTTON_PRESS_MASK |
- Gdk.EventMask.BUTTON_RELEASE_MASK |
- Gdk.EventMask.POINTER_MOTION_MASK,
- null,
- null,
- time) == Gdk.GrabStatus.SUCCESS)
- {
- if (Gdk.keyboard_grab (window.get_window(), true, time) == Gdk.GrabStatus.SUCCESS) {
- Gtk.grab_add (window);
- return true;
- } else {
- Gdk.pointer_ungrab (time);
- return false;
- }
- }
- return false;
- }
Add Comment
Please, Sign In to add comment