Closed Bug 1882963 Opened 1 year ago Closed 9 months ago

[KDE/Wayland] After dragging links onto a tab, it randomly gains focus

Categories

(Core :: Widget: Gtk, defect, P3)

Firefox 123
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: chengyuhui1, Unassigned)

References

(Blocks 2 open bugs)

Details

Attachments

(3 files)

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

Steps to reproduce:

Environment: Manjaro, KDE Plasma, Wayland (about:support says wayland).

  1. Drag a link or selected text onto the tab bar, creating a new tab or reusing existing ones

Actual results:

The affected tab will regain focus when I:
a. Switch to another application and back to FF
b. Copy anything in FF (context menu or Ctrl-C)
c. Initiate drag-and-drop in any tab

Sometimes the drag-and-drop indicator will remain on the tab bar, and if I closed tabs so that the indicator is on top of a certain tab, it will gain focus when I do the actions described above.

Similar bug with almost the same setup is described in https://www.reddit.com/r/firefox/comments/y69wwj/strange_tabswitching_when_switching_focus_or/

Expected results:

Other tabs should not gain focus when I switch windows.

Component: Untriaged → Widget: Gtk
Product: Firefox → Core

Can you create a screencast of it please?
Thanks.

Blocks: linuxdad, wayland
Priority: -- → P3
Summary: After dragging links onto a tab, it randomly gains focus → [KDE/Wayland] After dragging links onto a tab, it randomly gains focus

Screencast attached, note that I never manually switched tabs in this video.

The behavior of the dragging indicator (as shown in screenshot) is more random, it shows up or disappears randomly when FF loses and re-gains focus, and sometimes even snaps to the nearest gap when I close tabs so that it is no longer positioned between two tabs. At least I think that it should not be there.
I was unable to capture a screencast as for now because it would disappear the moment I start recording and switch back to FF.

This screencast shows how the indicator usually behaves: re-gaining focus and I'm switched to the tab under it.

mozregression shows that even 2021-07-01 has this bug (older versions crash on my system). Both of my systems (one Manjaro, one vanilla Arch) exhibit this behavior (along with that Redditor), and it is not related to extensions since mozregression creates an empty profile.

Another report on Reddit: https://www.reddit.com/r/firefox/comments/126rtip/copyingcutting_text_switches_to_another_tab/
It seems to be a KDE-specific thing and related to versions around Plasma 5.27.3, but I currently have no time to verify that...

Looks like a dupe of Bug 1875031.

Status: UNCONFIRMED → RESOLVED
Closed: 11 months ago
Duplicate of bug: 1875031
Resolution: --- → DUPLICATE

Can confirm that the build 2024-03-28 19:25:51.721000, revision 55aaac63 is still bad after the fix of Bug 1875031.

Drop events are still firing upon Ctrl-C in logs.

Status: RESOLVED → REOPENED
No longer duplicate of bug: 1875031
Ever confirmed: true
Resolution: DUPLICATE → ---

I can repro with the STR from comment 0.

It's easier to just drag from urlbar to tab bar. Ctrl+C will re-show the drop indicator.

As is analyzed in Bug 1875031, https://invent.kde.org/frameworks/kguiaddons/-/blob/master/src/systemclipboard/waylandclipboard.cpp?ref_type=heads#L589 is probably what causing this (both why GTK recognizes this as a drop and KDE sends these events is a puzzle to me).

It appears that Sublime Text is also affected by odd drag-drop issues, only on KDE + Wayland: https://github.com/sublimehq/sublime_text/issues/4077

I can confirm that this bug and bug 1875031 has been fixed in KDE Plasma 6.0.4 Wayland released on 2024.4.16
See also: https://kde.org/announcements/plasma/6/6.0.4/

I've also noticed that this bug is gone after my recent update to KWin 6.0.4 on Manjaro. Should we mark this as fixed?

Yes

Status: REOPENED → RESOLVED
Closed: 11 months ago9 months ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: