From 1360747c9e8f4f1bc42c9ab8c433b1dc9fd0a6e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 23 May 2013 15:49:42 +0200 Subject: [PATCH] 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 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/ui/dnd.js b/js/ui/dnd.js index 763bd0494..a8f449fd0 100644 --- a/js/ui/dnd.js +++ b/js/ui/dnd.js @@ -149,16 +149,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; } },