summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2017-11-16 17:27:12 +0100
committerCarlos Garnacho <carlosg@gnome.org>2017-11-17 16:04:21 +0100
commit6bd087253003686e288fd21ecc57f45c2a07ad72 (patch)
treee222c7ff3c12f843c7df6803b4d3932ae71a93a9
parent8dace05c26c54e2d33c4b090e893a921f3b27be5 (diff)
downloadgnome-shell-gnome-3-24.tar.gz
overview: Protect ::drag-end handlersgnome-3-24
These end up emitting item-drag-end/window-drag-end pretty much without checks. Given the MetaDnd object may end up emitting ::drag-leave as a result of the plugin ending its grab, this would result on spurious emission of those events and subsequent warnings. For extra paranoia, the _inDrag variable has been split into _inItemDrag/_inWindowDrag so we can't cross the streams. https://bugzilla.gnome.org/show_bug.cgi?id=784545
-rw-r--r--js/ui/overview.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/js/ui/overview.js b/js/ui/overview.js
index 04a92b570..84f89b434 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -414,7 +414,7 @@ const Overview = new Lang.Class({
beginItemDrag: function(source) {
this.emit('item-drag-begin');
- this._inDrag = true;
+ this._inItemDrag = true;
},
cancelledItemDrag: function(source) {
@@ -422,13 +422,15 @@ const Overview = new Lang.Class({
},
endItemDrag: function(source) {
+ if (!this._inItemDrag)
+ return;
this.emit('item-drag-end');
- this._inDrag = false;
+ this._inItemDrag = false;
},
beginWindowDrag: function(window) {
this.emit('window-drag-begin', window);
- this._inDrag = true;
+ this._inWindowDrag = true;
},
cancelledWindowDrag: function(window) {
@@ -436,8 +438,10 @@ const Overview = new Lang.Class({
},
endWindowDrag: function(window) {
+ if (!this._inWindowDrag)
+ return;
this.emit('window-drag-end', window);
- this._inDrag = false;
+ this._inWindowDrag = false;
},
focusSearch: function() {
@@ -481,7 +485,7 @@ const Overview = new Lang.Class({
shouldToggleByCornerOrButton: function() {
if (this.animationInProgress)
return false;
- if (this._inDrag)
+ if (this._inItemDrag || this._inWindowDrag)
return false;
if (this._activationTime == 0 || Date.now() / 1000 - this._activationTime > OVERVIEW_ACTIVATION_TIMEOUT)
return true;