GNOME Bugzilla – Bug 95614
DND between workspaces
Last modified: 2005-01-06 20:13:22 UTC
Version: 2.4.2 In an attempt to drag files from nautilus to rhythmbox I noticed that it is impossible to drag the files into another workspace. Mouse cursor stopped at the edge of the screen but didn't switch workspaces. Neither did workspace switching keybindings have any effect.
For the tasklist, if you drag over the task button the window will unminimize, we could do something similar with the workspace switcher perhaps.
*** Bug 106534 has been marked as a duplicate of this bug. ***
Patch attached to bug 106534 looks pretty good. Marking priority/keywords so the patch gets found.
Created attachment 21460 [details] [review] patch fix DND between workspaces for version libwnck-2.4.0.1
Havoc: did you review this patch?
I didn't see the patch when posted unfortunately; I'm in an airport right now, but I'll try to review it when I get home.
This is probably borderline feature-freeze break, but I'd certainly look the other way :)
*** Bug 136698 has been marked as a duplicate of this bug. ***
*** Bug 135182 has been marked as a duplicate of this bug. ***
Havoc, did you look at this patch? Ok for HEAD?
I put a similar (although slightly smaller, and IMHO cleaner) patch on bug 136698 and, while testing it, discovered some problems (noted in that bug) that weren't libwnck related. Namely, the workspace will switch, but the window positions in the old workspace are "remembered" as far as DND goes. After testing both patches, I found that this patch suffers from exactly the same problem. DND between workspaces results in the "drop" occuring on the window that is under the cursor on the first workspace, not the current one. FYI, the patch in this bug doesn't appear to apply cleanly against the current CVS, but all of the rejects are changes that have already been made and can be safely ignored.
I probe my patch http://bugzilla.gnome.org/attachment.cgi?id=21460&action=view in gnome-2.4 = libwnk-2.4 and gtk-2.2.4 (Working well). gnome-2.4 = libwnk-2.6.1 and gtk-2.2.4 (Working well). gnome-2.5 = libwnk-2.5.1 and gtk-2.3.2 (Not Working). In libwnk-2.5.1 and gtk-2.3.2 the workspace will switch, but the window positons of DND destination is the preview workspace, there is a problem in GTK.
Can you test with a current version of GTK+ rather than a development snapshot from a couple of months ago?
I tested both patches against a jhbuild checked out and built last night and the problem persists. I will test again when the current jhbuild is finished and post an update. After that's done I'll posted a version that cleanly applies to libwnck HEAD.
Created attachment 32375 [details] [review] patch fix DND between workspaces for version libwnck-2.8.1, uses jhbuild Is the same code but I uses jhbuild and cvs diff -u -p for generate the patch file. And uses gtk+-2.4.11 + libwnck-2.8.1 (work well).
*** Bug 153962 has been marked as a duplicate of this bug. ***
Created attachment 35431 [details] [review] Modified patch against CVS HEAD This patch is a modified version of attachment 32375 [details] [review] which works consistently with the current libwnck behavior (not selecting windows inside workspaces) I hope to see it in before the 2.9 feature freeze :)
Some quick nitpicks: - Need to remove the timeout on finalize() - Make dnd_workspace hold the workspace number rather than the pointer - the number of workspaces could be reduced by the time the timeout is called (You can then just do return pager->priv->dnd_workspace != -1; in drag_motion()) - Add a newline before drag_dest_set() and fixup the whitespace in GTK_WIDGET(pager) - i.e. GTK_WIDGET (pager) - Keep drag_motion() and drag_leave() prototypes together with the other widget class prototypes. Also, keep the implementations together and remove the need for the motion_timeout() prototype by putting its implementation above the other two. - Fixup whitespace in gdk_drag_status() call - This is fairly ugly: + if (wnck_workspace_get_number (wnck_screen_get_active_workspace ( pager->priv->screen)) + != wnck_workspace_get_number(pager->priv->dnd_workspace)) use a temporary variable to hold the active WnckWorkspace - Move TIMEOUT_ACTIVATE to private.h and rename to _WNCK_ACTIVATE_TIMEOUT or something - we should share it with the tasklist Looks about right to me, though
Created attachment 35467 [details] [review] Patch with all the suggestions applied, also fixes a compiler warning Mark, thanks for reviewing it, this new patch fixes all those issues
In finalize, I'd set pager->priv->dnd_activate to zero after you remove the source as a rule its better to make issues with stale pointers lying around less likely Apart from that, it looks fine to commit
I've put dnd_activate to zero in finalize and committed, the ChangeLog entry is: 2005-01-06 Carlos Garnacho Parro <carlosg@gnome.org> Modified patch from Fernando Villacis Postigo <fvillacis@csnat.unt.edu.ar> in bug #95614 * libwnck/private.h: defined WNCK_ACTIVATE_TIMEOUT * libwnck/tasklist.c: use it instead of TIMEOUT_ACTIVATE * libwnck/pager.c: Implemented switching workspaces when doing a DnD operation. thanks :)