[gnome-shell/wip/carlosg/cleanup-gtk-usage: 33/40] overview: Do not warp pointer to fake crossing event



commit 192bbbc561c518cebd5ef323fa6bdb5ecd16b7e6
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Nov 27 13:36:26 2018 +0100

    overview: Do not warp pointer to fake crossing event
    
    This is actually papering over bugs in toolkits. On X11 the Xserver will
    send crossing events when the stage input shape changes. As those go
    end up ignored in GTK+, this warp call aims (and randomly manages) to send
    a motion event that wouldn't go unlistened by the drag source window (the
    one holding the grab).
    
    This bug actually manifests in other ways, eg. by changing the window
    beneath the pointer with alt-tab while DnDing. This should be fixed
    altogether in the client side.

 js/ui/overview.js | 20 --------------------
 1 file changed, 20 deletions(-)
---
diff --git a/js/ui/overview.js b/js/ui/overview.js
index ae60e1a24..e92b21e50 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -2,13 +2,11 @@
 
 const Clutter = imports.gi.Clutter;
 const GLib = imports.gi.GLib;
-const Gtk = imports.gi.Gtk;
 const Meta = imports.gi.Meta;
 const Mainloop = imports.mainloop;
 const Signals = imports.signals;
 const St = imports.gi.St;
 const Shell = imports.gi.Shell;
-const Gdk = imports.gi.Gdk;
 
 const Background = imports.ui.background;
 const DND = imports.ui.dnd;
@@ -158,7 +156,6 @@ var Overview = class {
         this._windowSwitchTimestamp = 0;
         this._lastActiveWorkspaceIndex = -1;
         this._lastHoveredWindow = null;
-        this._needsFakePointerEvent = false;
 
         if (this._initCalled)
             this.init();
@@ -306,19 +303,9 @@ var Overview = class {
         if (this._windowSwitchTimeoutId != 0) {
             Mainloop.source_remove(this._windowSwitchTimeoutId);
             this._windowSwitchTimeoutId = 0;
-            this._needsFakePointerEvent = false;
         }
     }
 
-    _fakePointerEvent() {
-        let display = Gdk.Display.get_default();
-        let deviceManager = display.get_device_manager();
-        let pointer = deviceManager.get_client_pointer();
-        let [gdkScreen, pointerX, pointerY] = pointer.get_position();
-
-        pointer.warp(gdkScreen, pointerX, pointerY);
-    }
-
     _onDragMotion(dragEvent) {
         let targetIsWindow = dragEvent.targetActor &&
                              dragEvent.targetActor._delegate &&
@@ -340,7 +327,6 @@ var Overview = class {
             this._windowSwitchTimeoutId = Mainloop.timeout_add(DND_WINDOW_SWITCH_TIMEOUT,
                 () => {
                     this._windowSwitchTimeoutId = 0;
-                    this._needsFakePointerEvent = true;
                     Main.activateWindow(dragEvent.targetActor._delegate.metaWindow,
                                         this._windowSwitchTimestamp);
                     this.hide();
@@ -643,12 +629,6 @@ var Overview = class {
             Main.layoutManager.hideOverview();
 
         this._syncGrab();
-
-        // Fake a pointer event if requested
-        if (this._needsFakePointerEvent) {
-            this._fakePointerEvent();
-            this._needsFakePointerEvent = false;
-        }
     }
 
     toggle() {


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