After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 95614 - DND between workspaces
DND between workspaces
Status: RESOLVED FIXED
Product: libwnck
Classification: Core
Component: general
unspecified
Other other
: High enhancement
: ---
Assigned To: libwnck maintainers
libwnck maintainers
: 106534 135182 136698 153962 (view as bug list)
Depends on:
Blocks: 155908
 
 
Reported: 2002-10-12 15:11 UTC by Tommi Komulainen
Modified: 2005-01-06 20:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch fix DND between workspaces for version libwnck-2.4.0.1 (6.25 KB, patch)
2003-11-14 16:24 UTC, Fernando Villacis Postigo
none Details | Review
patch fix DND between workspaces for version libwnck-2.8.1, uses jhbuild (5.86 KB, patch)
2004-10-08 04:48 UTC, Fernando Villacis Postigo
none Details | Review
Modified patch against CVS HEAD (4.70 KB, patch)
2005-01-04 15:45 UTC, Carlos Garnacho
needs-work Details | Review
Patch with all the suggestions applied, also fixes a compiler warning (6.30 KB, patch)
2005-01-05 11:33 UTC, Carlos Garnacho
accepted-commit_now Details | Review

Description Tommi Komulainen 2002-10-12 15:11:41 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.
Comment 1 Havoc Pennington 2002-10-12 17:02:41 UTC
For the tasklist, if you drag over the task button the window will
unminimize, we could do something similar with the workspace switcher
perhaps.
Comment 2 Fernando Villacis Postigo 2003-05-05 14:45:47 UTC
*** Bug 106534 has been marked as a duplicate of this bug. ***
Comment 3 Havoc Pennington 2003-05-05 18:39:09 UTC
Patch attached to bug 106534 looks pretty good.
Marking priority/keywords so the patch gets found.
Comment 4 Fernando Villacis Postigo 2003-11-14 16:24:41 UTC
Created attachment 21460 [details] [review]
patch fix DND between workspaces for version libwnck-2.4.0.1
Comment 5 Vincent Untz 2004-01-08 00:02:04 UTC
Havoc: did you review this patch?
Comment 6 Havoc Pennington 2004-01-11 06:21:11 UTC
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.
Comment 7 Luis Villa 2004-02-14 05:13:00 UTC
This is probably borderline feature-freeze break, but I'd certainly
look the other way :)
Comment 8 Matthew Gatto 2004-04-17 05:12:29 UTC
*** Bug 136698 has been marked as a duplicate of this bug. ***
Comment 9 Matthew Gatto 2004-04-17 05:12:54 UTC
*** Bug 135182 has been marked as a duplicate of this bug. ***
Comment 10 Kjartan Maraas 2004-04-18 19:40:45 UTC
Havoc, did you look at this patch? Ok for HEAD?
Comment 11 Shahms E. King 2004-04-18 20:47:48 UTC
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.
Comment 12 Fernando Villacis Postigo 2004-04-20 14:19:14 UTC
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.
Comment 13 Owen Taylor 2004-04-20 15:48:25 UTC
Can you test with a current version of GTK+ rather than a development
snapshot from a couple of months ago?
Comment 14 Shahms E. King 2004-04-20 19:05:07 UTC
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.
Comment 15 Fernando Villacis Postigo 2004-10-08 04:48:40 UTC
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).
Comment 16 Elijah Newren 2004-12-19 02:50:12 UTC
*** Bug 153962 has been marked as a duplicate of this bug. ***
Comment 17 Carlos Garnacho 2005-01-04 15:45:45 UTC
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 :)
Comment 18 Mark McLoughlin 2005-01-04 16:17:48 UTC
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
Comment 19 Carlos Garnacho 2005-01-05 11:33:13 UTC
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
Comment 20 Mark McLoughlin 2005-01-06 12:16:06 UTC
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

Comment 21 Carlos Garnacho 2005-01-06 20:13:22 UTC
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 :)