[gnome-shell/workspace-thumbnails: 4/13] Don't check for Workspaces.WindowClone for window drops



commit ff74078e2c8ae4a5ce2880e428aa5d1183c952f5
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Sun Jan 30 20:25:00 2011 -0500

    Don't check for Workspaces.WindowClone for window drops
    
    When checking the type of a DND source, instead of checking
    'instanceof Workspaces.WindowClone' accept any actor with realWindow
    and metaWindow properties. This will be useful to support a separate
    type of actor dragged from workspace thumbnails.

 js/ui/appDisplay.js     |    2 +-
 js/ui/dash.js           |    8 ++++----
 js/ui/workspace.js      |    2 +-
 js/ui/workspacesView.js |    2 +-
 4 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 6cefd64..16e9806 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -630,7 +630,7 @@ AppIconMenu.prototype = {
     },
 
     _findMetaWindowForActor: function (actor) {
-        if (actor._delegate instanceof Workspace.WindowClone)
+        if (actor._delegate.metaWindow)
             return actor._delegate.metaWindow;
         else if (actor.get_meta_window)
             return actor.get_meta_window();
diff --git a/js/ui/dash.js b/js/ui/dash.js
index 01de6af..3a5d0ad 100644
--- a/js/ui/dash.js
+++ b/js/ui/dash.js
@@ -54,7 +54,7 @@ RemoveFavoriteIcon.prototype = {
         if (source instanceof AppDisplay.AppWellIcon) {
             let appSystem = Shell.AppSystem.get_default();
             app = appSystem.get_app(source.getId());
-        } else if (source instanceof Workspace.WindowClone) {
+        } else if (source.metaWindow) {
             let tracker = Shell.WindowTracker.get_default();
             app = tracker.get_window_app(source.metaWindow);
         }
@@ -148,7 +148,7 @@ Dash.prototype = {
         let app = null;
         if (dragEvent.source instanceof AppDisplay.AppWellIcon)
             app = this._appSystem.get_app(dragEvent.source.getId());
-        else if (dragEvent.source instanceof Workspace.WindowClone)
+        else if (dragEvent.source.metaWindow)
             app = this._tracker.get_window_app(dragEvent.source.metaWindow);
         else
             return DND.DragMotionResult.CONTINUE;
@@ -265,7 +265,7 @@ Dash.prototype = {
         let app = null;
         if (source instanceof AppDisplay.AppWellIcon)
             app = this._appSystem.get_app(source.getId());
-        else if (source instanceof Workspace.WindowClone)
+        else if (source.metaWindow)
             app = this._tracker.get_window_app(source.metaWindow);
 
         // Don't allow favoriting of transient apps
@@ -316,7 +316,7 @@ Dash.prototype = {
         let app = null;
         if (source instanceof AppDisplay.AppWellIcon) {
             app = this._appSystem.get_app(source.getId());
-        } else if (source instanceof Workspace.WindowClone) {
+        } else if (source.metaWindow) {
             app = this._tracker.get_window_app(source.metaWindow);
         }
 
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index ddd82bc..a2c6f29 100644
--- a/js/ui/workspace.js
+++ b/js/ui/workspace.js
@@ -1395,7 +1395,7 @@ Workspace.prototype = {
     },
 
     acceptDrop : function(source, actor, x, y, time) {
-        if (source instanceof WindowClone) {
+        if (source.realWindow) {
             let win = source.realWindow;
             if (this._isMyWindow(win))
                 return false;
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
index 262fef8..c21d10b 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -264,7 +264,7 @@ WorkspacesView.prototype = {
     },
 
     _handleDragOverNewWorkspace: function(source, dropActor, x, y, time) {
-        if (source instanceof Workspace.WindowClone)
+        if (source.realWindow)
             return DND.DragMotionResult.MOVE_DROP;
         if (source.shellWorkspaceLaunch)
             return DND.DragMotionResult.COPY_DROP;



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