[gnome-shell/gnome-3-8] dnd: Use pushModal() to grab the keyboard
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-3-8] dnd: Use pushModal() to grab the keyboard
- Date: Wed, 5 Jun 2013 15:33:57 +0000 (UTC)
commit 1360747c9e8f4f1bc42c9ab8c433b1dc9fd0a6e7
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 763bd04..a8f449f 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;
}
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]