Closed Bug 1464808 Opened 6 years ago Closed 6 years ago

[Wayland] Dragging a tab copies it

Categories

(Core :: Widget: Gtk, defect)

60 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla62
Tracking Status
firefox62 --- fixed

People

(Reporter: moz, Assigned: stransky)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0
Build ID: 20100101

Steps to reproduce:

1. open firefox-wayland
2. open several tabs in at least 2 different windows
3. drag one tab to another window


Actual results:

The default drag operation is "copy": During drag (before mouse button release) the icon shows a "+" indicating a copy action. After releasing the mouse button, the tab is being copied to the other window.


Expected results:

The default drag operation on X11 has been "move": During drag, the icon should show an arrow indicating a move action. After releasing the mouse button, the tab should be moved to the other window.
Affected version:
Firefox build on Fedora 28, firefox-60.0.1-3.fc28.x86_64
Blocks: wayland
Status: UNCONFIRMED → NEW
Ever confirmed: true
Assignee: nobody → stransky
Component: Untriaged → Widget: Gtk
Product: Firefox → Core
Comment on attachment 8981404 [details]
Bug 1464808 - [Wayland] Emulate gdk_drag_context_get_actions(), nsWaylandDragContext::GetSelectedDragAction returns available D&D actions when no one is selected by user,

https://reviewboard.mozilla.org/r/247524/#review253996

::: widget/gtk/nsClipboardWayland.cpp
(Diff revision 1)
>   * here.
>   */
>  void
>  WaylandDataOffer::SetDragStatus(GdkDragAction aAction, uint32_t aTime)
>  {
> -    uint32_t dnd_actions = gdk_to_wl_actions(aAction);

You can also remove the gdk_to_wl_actions implementation.

::: widget/gtk/nsClipboardWayland.cpp:216
(Diff revision 1)
>  
> -    wl_data_offer_set_actions(mWaylandDataOffer, all_actions, dnd_actions);
> +    /* Default Firefox D&D action is move so set it here as a preferred one.
> +       Actual D&D action will be select by Wayland compositor and reported
> +       at data_offer_action() callback.
> +    */
> +    wl_data_offer_set_actions(mWaylandDataOffer, all_actions,

This does not fix when you trying to copy some text from gedit for example (in this case the move indicator is shown instead of copy unlike on X11). 

I sugggest to fill another bug for this issue as long as it is a minor issue.

Please also add to the above comment the side effect of having only ACTION_MOVE. It's also a bit confusing why aAction is no longer used in the method.

Good start for finding out why is there:
https://searchfox.org/mozilla-central/rev/5a744713370ec47969595e369fd5125f123e6d24/browser/base/content/tabbrowser.xml#765
Attachment #8981404 - Flags: review?(jhorak) → review+
Comment on attachment 8981404 [details]
Bug 1464808 - [Wayland] Emulate gdk_drag_context_get_actions(), nsWaylandDragContext::GetSelectedDragAction returns available D&D actions when no one is selected by user,

https://reviewboard.mozilla.org/r/247524/#review253996

> This does not fix when you trying to copy some text from gedit for example (in this case the move indicator is shown instead of copy unlike on X11). 
> 
> I sugggest to fill another bug for this issue as long as it is a minor issue.
> 
> Please also add to the above comment the side effect of having only ACTION_MOVE. It's also a bit confusing why aAction is no longer used in the method.
> 
> Good start for finding out why is there:
> https://searchfox.org/mozilla-central/rev/5a744713370ec47969595e369fd5125f123e6d24/browser/base/content/tabbrowser.xml#765

Well, let's fix it properly then - I'll investigate why _getDropEffectForTabDrag() is not applied correctly on Wayland.
I encounter this problem even when dragging a tab within the same unique window.

Fedora 28, firefox 60.0.1
(In reply to Gwendal from comment #5)
> I encounter this problem even when dragging a tab within the same unique
> window.
> 
> Fedora 28, firefox 60.0.1

Confirmed. I've changed the bug title.
Summary: [Wayland] Dragging a tab to a different window copies it → [Wayland] Dragging a tab copies it
Pushed by stransky@redhat.com:
https://hg.mozilla.org/integration/autoland/rev/ff8aa13f2b8e
[Wayland] Emulate gdk_drag_context_get_actions(), nsWaylandDragContext::GetSelectedDragAction returns available D&D actions when no one is selected by user, r=jhorak
https://hg.mozilla.org/mozilla-central/rev/ff8aa13f2b8e
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
Depends on: 1466444
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: