Bug 152205 - Wayland does not allow switching between multiples LibreOffice windows from the Window menu
Summary: Wayland does not allow switching between multiples LibreOffice windows from t...
Status: RESOLVED NOTOURBUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.4.7.2 release
Hardware: All Linux (All)
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Wayland KDE, KF5 New-Window-Same-File Qt6
  Show dependency treegraph
 
Reported: 2022-11-24 21:31 UTC by Steve Sibelman
Modified: 2022-12-05 21:47 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
screen shot of Libre "about" version info (15.63 KB, image/png)
2022-11-25 14:46 UTC, Steve Sibelman
Details
Small Qt sample program to reproduce similar behavior (726 bytes, text/x-c++src)
2022-12-03 08:24 UTC, Michael Weghorn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Sibelman 2022-11-24 21:31:20 UTC
The "Window" menu item usually allows the user to switch between open LibreOffice document windows, switching focus to the selected item.  This still works in an X11 session, but in Wayland the focus does not shift -- the current window stays forward.

Other methods of bringing windows forward still work fine:  Alt-Tab and the taskbar.
Comment 1 Stéphane Guillou (stragu) 2022-11-25 09:47:34 UTC
Hi Steve
Could you please paste here the info in Help > About LibreOffice?
Thank you!

(and thanks for teaching me a new word, but I changed the summary for more straight-forward keywords :D )
Comment 2 Stéphane Guillou (stragu) 2022-11-25 09:55:10 UTC Comment hidden (obsolete)
Comment 3 Steve Sibelman 2022-11-25 14:46:08 UTC
Created attachment 183775 [details]
screen shot of Libre "about" version info

I wonder which was le mot nouveau
Comment 4 Stéphane Guillou (stragu) 2022-11-25 16:56:35 UTC
Le nouveau mot: "to bollix"!

Thanks for the version details.

Right, I *can't* reproduce with:

Version: 7.3.7.2 / LibreOffice Community
Build ID: e114eadc50a9ff8d8c8a0567d6da8f454beeb84f
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: de-DE (en_AU.UTF-8); UI: en-US
Calc: threaded

Version: 7.4.3.2 / LibreOffice Community
Build ID: 1048a8393ae2eeec98dff31b5c133c5f1d08b890
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: de-DE (en_AU.UTF-8); UI: en-US
Calc: threaded

Version: 7.5.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 24d7431876e87eba700a9f141dc8e030143a92ad
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Version: 7.3.7.2 / LibreOffice Community
Build ID: e114eadc50a9ff8d8c8a0567d6da8f454beeb84f
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-DE (en_AU.UTF-8); UI: en-US
Calc: threaded

However, I *can* reproduce the issue with the kf5 VCL with Cairo and Wayland:

and

Version: 7.4.3.2 / LibreOffice Community
Build ID: 1048a8393ae2eeec98dff31b5c133c5f1d08b890
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: kf5 (cairo+wayland)
Locale: de-DE (en_AU.UTF-8); UI: en-US
Calc: threaded

Using:

QT_QPA_PLATFORM=wayland SAL_USE_VCLPLUGIN=kf5 libreoffice7.4 --writer

Same for LO 7.3.7 and 6.4.7.

So it does seem wayland-related.
Comment 5 Steve Sibelman 2022-11-25 23:04:19 UTC
I'm glad my symptom is reproducible.  Wayland is definitely a work in progress.  Thunderbird actually works better in Wayland than X11.

fwiw, I'm using Ubuntu (Kubuntu) 22.04, KDE Plasma 5.24.7 KDE Frameworks Version 5.92.0 Qt Version 5.15.2 Kernel 5.15.0-53-generic (64-bit) running on a Core i7-7700T with 16GB of RAM.

per etymonline.com, an on-line etymology resource I value:

bollix (v.)
"bungle, make a mess of," 1937, a respelling (perhaps euphemistic) of bollocks, from Old English beallucas "testicles," 

OK, I guess that's more than enough tangential chatter.  Cheers!
Comment 6 Michael Weghorn 2022-12-03 08:24:10 UTC
Created attachment 183971 [details]
Small Qt sample program to reproduce similar behavior
Comment 7 Michael Weghorn 2022-12-03 08:36:50 UTC
When trying this with kf5 in a Plasma Wayland session with current master on Debian testing, I get this warning on stderr:

   qt.qpa.wayland: Wayland does not support QWindow::requestActivate()

This looks like something is missing inside the Qt library, rather than LO.

From a quick glance, it looks like
https://codereview.qt-project.org/c/qt/qtwayland/+/321246
has implemented handling for QWindow::requestActivate, and I actually don't get the above warning any more when using the qt6 VCL plugin and Qt 6.3.1 on current Debian testing.
Other than for kf5, the taskbar entry of the selected window gets highlighted (yellow/orange background), but the window still doesn't become active as desired.

For me, this is basically the same as the behavior with the gtk3 VCL plugin in a Plasma Wayland session, the window doesn't become active there either.

However, when using the gtk3 VCL plugin in a GNOME Wayland session, the selected window becomes active as desired.

Even in a GNOME Wayland session, the window does not become active for qt6, though.
The behavior is the same with the attached sample program, attachment 183971 [details], so it seems to me like this is probably rather a problem in Qt (and possibly KWin as well), rather than LO.

It all works fine when run with QT_QPA_PLATFORM=xcb, i.e. using Qt's X11 instead of the wayland platform plugin.

-> Closing as NOTOURBUG, will report a bug in KDE's bug tracker instead.
Comment 8 Michael Weghorn 2022-12-03 08:46:07 UTC
(In reply to Michael Weghorn from comment #7)
> -> Closing as NOTOURBUG, will report a bug in KDE's bug tracker instead.

Reported as https://bugs.kde.org/show_bug.cgi?id=462574 for now, let's wait for input there.

LO version I was using is master as of a611f2fc149153aabea8948f74ee004944acf681.
Comment 9 Michael Weghorn 2022-12-05 21:47:36 UTC
(In reply to Michael Weghorn from comment #8)
> Reported as https://bugs.kde.org/show_bug.cgi?id=462574 for now, let's wait
> for input there.

FYI, quoting https://bugs.kde.org/show_bug.cgi?id=462574#c1 :

> In general for QWindow::requestActivate to work an activation token needs to be
> set. It can't just work in all cases.
> 
> For the case where a window activates another window of the same app Qt can do
> that automatically since https://codereview.qt-project.org/c/qt/qtwayland/+/418094.
> That was added after Qt 6.3.1 though