Bug 430376

Summary: QWidget doesn't correctly open in full screen on specific monitor if told to do so on Wayland
Product: [Plasma] kwin Reporter: Michael Weghorn <m.weghorn>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: REOPENED ---    
Severity: normal CC: kde, m.weghorn, ybx332
Priority: NOR    
Version: 5.19.5   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Sample program to reproduce the issue

Description Michael Weghorn 2020-12-14 14:19:44 UTC
Created attachment 134071 [details]
Sample program to reproduce the issue

SUMMARY

In a dual screen setup, trying to open a QWidget in full screen on a specific monitor does not work on Wayland, which breaks e.g. LibreOffice Impress presentation mode.

STEPS TO REPRODUCE
0. use KDE Plasma Wayland with a dual screen setup
1. compile and run the attached sample program "main.cpp" (source code also given below)
2. run the program

OBSERVED RESULT

Two white/empty widgets open in full screen on the first/same screen.

EXPECTED RESULT

One full screen widget on each  of the two screens.

SOFTWARE/OS VERSIONS

Operating System: Debian GNU/Linux
KDE Plasma Version: 5.19.5
KDE Frameworks Version: 5.74.0
Qt Version: 5.15.1
Kernel Version: 5.9.0-4-amd64
OS Type: 64-bit
Processors: 12 × Intel® Core™ i7-9850H CPU @ 2.60GHz
Memory: 62.4 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 630

ADDITIONAL INFORMATION

* It works as expected when run with env variable 'QT_QPA_PLATFORM=xcb' set, i.e. using XWayland.
* My setup for testing includes a laptop with an internal screen + an attached external screen, both with a resolution of 1920x1080.
* This was originally reported as a LibreOffice Impress bug at https://bugs.documentfoundation.org/show_bug.cgi?id=128214
* The LibreOffice scenario works fine when using LibreOffice with the gtk3 integration ("VCL plugin") on GNOME Wayland, but not when using the gtk3 integration on Plasma Wayland either (tested with LibreOffice from Debian testing, package version 7.0.3-4+b1).
* Sample program:

#include <QApplication>
#include <QScreen>
#include <QWidget>
#include <QWindow>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    for (QScreen* screen : qApp->screens()) {
        QWidget * widget = new QWidget;
        widget->show();
        QRect screenGeometry = screen->geometry();
        widget->windowHandle()->setScreen(screen);
        widget->move(screenGeometry.topLeft());
        widget->showFullScreen();
    }

    return a.exec();
}
Comment 1 David Edmundson 2021-02-02 17:56:40 UTC
This is fixed in QtWayland.
Not in 5.15.2 though.

There's nothing we can do our side.
Comment 2 ybx332 2022-06-05 06:32:58 UTC
(In reply to David Edmundson from comment #1)
> This is fixed in QtWayland.
> Not in 5.15.2 though.
> 
> There's nothing we can do our side.

So could you please tell me which version it is fixed in? My distribution is packaging qt5.15.4 and qt6, so I can request them to package the correct version with the fix included.