[gnome-shell] XDND: Remove the switch timeout in _onDragEnd
- From: Adel Gadllah <agadllah src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] XDND: Remove the switch timeout in _onDragEnd
- Date: Thu, 24 Feb 2011 10:47:26 +0000 (UTC)
commit 6d6ec46f254ecac7879218a64840e1922a2ac1b8
Author: Adel Gadllah <adel gadllah gmail com>
Date: Thu Feb 24 11:30:46 2011 +0100
XDND: Remove the switch timeout in _onDragEnd
When the user cancels the drag while hovering over a window the timeout
handler will throw an exception because the drag actor will be destroyed
at this point.
Fix that by removing the timeout in _onDragEnd.
js/ui/overview.js | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/overview.js b/js/ui/overview.js
index fbe8c3e..d0b3aff 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -213,10 +213,19 @@ Overview.prototype = {
global.screen.get_workspace_by_index(this._lastActiveWorkspaceIndex).activate(time);
this.hideTemporarily();
}
+ this._resetWindowSwitchTimeout();
this._lastHoveredWindow = null;
DND.removeMonitor(this._dragMonitor);
},
+ _resetWindowSwitchTimeout: function() {
+ if (this._windowSwitchTimeoutId != 0) {
+ Mainloop.source_remove(this._windowSwitchTimeoutId);
+ this._windowSwitchTimeoutId = 0;
+ this._needsFakePointerEvent = false;
+ }
+ },
+
_fakePointerEvent: function() {
let display = Gdk.Display.get_default();
let deviceManager = display.get_device_manager();
@@ -239,11 +248,7 @@ Overview.prototype = {
this._lastHoveredWindow = null;
- if (this._windowSwitchTimeoutId != 0) {
- Mainloop.source_remove(this._windowSwitchTimeoutId);
- this._windowSwitchTimeoutId = 0;
- this._needsFakePointerEvent = false;
- }
+ this._resetWindowSwitchTimeout();
if (targetIsWindow) {
this._lastHoveredWindow = dragEvent.targetActor._delegate.metaWindow;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]