[gnome-shell] dnd: Use pushModal() to grab the keyboard



commit 9e56e668e05007669be36cf9834d879ab140544f
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu May 23 15:49:42 2013 +0200

    dnd: Use pushModal() to grab the keyboard
    
    Currently we "only" grab the keyboard when starting a drag operation,
    which does not impede keybindings to be processed. This is at best
    not harmful (like workspace switching), but may have unintended effects
    otherwise - for instance, the hot corner is disabled, so having the
    corresponding keyboard shortcut still active is fairly odd (not to
    mention that it leaves the system in a confused state).
    Fix this by switching to pushModal()/popModal(), which will push a
    dedicated keybinding mode for us.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=700877

 js/ui/dnd.js |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/dnd.js b/js/ui/dnd.js
index fab58f5..c4cc047 100644
--- a/js/ui/dnd.js
+++ b/js/ui/dnd.js
@@ -147,16 +147,16 @@ const _Draggable = new Lang.Class({
 
     _grabEvents: function() {
         if (!this._eventsGrabbed) {
-            Clutter.grab_pointer(_getEventHandlerActor());
-            Clutter.grab_keyboard(_getEventHandlerActor());
-            this._eventsGrabbed = true;
+            this._eventsGrabbed = Main.pushModal(_getEventHandlerActor());
+            if (this._eventsGrabbed)
+                Clutter.grab_pointer(_getEventHandlerActor());
         }
     },
 
     _ungrabEvents: function() {
         if (this._eventsGrabbed) {
             Clutter.ungrab_pointer();
-            Clutter.ungrab_keyboard();
+            Main.popModal(_getEventHandlerActor());
             this._eventsGrabbed = false;
         }
     },


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]