Bug 445741 - "Fullscreen" in window menu is disabled in all KDE/Qt apps, with 250% zoom and certain screen resolution
Summary: "Fullscreen" in window menu is disabled in all KDE/Qt apps, with 250% zoom an...
Status: RESOLVED DUPLICATE of bug 391956
Alias: None
Product: kwin
Classification: Plasma
Component: core (show other bugs)
Version: git master
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-19 09:50 UTC by Jin Liu
Modified: 2022-05-24 21:08 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jin Liu 2021-11-19 09:50:07 UTC
SUMMARY
When global scaling is set to 250%, and with certain screen resolution (3200x2000: bug, 2000x1000: bug, 3000x1800: ok), the "Fullscreen" item in window menu is grayed out in all KDE/Qt apps. Other apps (e.g. Gnome apps, Firefox) is OK.

STEPS TO REPRODUCE
1. Xephyr -screen 2000x1000 :1
2. docker run --name kde --env [DISPLAY=:1] -v /tmp/.X11-unix:/tmp/.X11-unix docker.io/kdeneon/plasma:user
3. [in Xephyr] Open systemsettings.
4. [in Xephyr] In "display configuration", set "global scale" to 250%.
5. [in Xephyr] Log out.
6. docker start kde
7. [in Xephyr] Open dolphin.
8. [in Xephyr] In window menu - more actions, "Fullscreen" is grayed out.
9. Repeat step 3-8, but set "global scale" to 200%. Everything works.
10. docker rm --force --volumes kde
11. Xephyr -screen 3000x1800 :1
12. Repeat step 2-9. Everything works.

OBSERVED RESULT
"Fullscreen" window menu is grayed out, only in the combination of:
1. KDE/Qt apps 
2. 250% zoom
3. Certain resolutions (3200x2000, 2000x1000)

EXPECTED RESULT
"Fullscreen" window menu clickable.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)

(setup #1: KDE Neon docker image)
KDE Plasma Version: 5.23.3
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.3

(setup #2: archlinux, physical machine)
KDE Plasma Version: 5.23.3
KDE Frameworks Version: 5.88.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Perhaps this is related to https://bugs.kde.org/show_bug.cgi?id=435674 , as both only occurs in 250% zoom and certain resolution?
Comment 1 Nate Graham 2021-11-23 22:30:13 UTC
Moving to KConfigWidgets where the "Enter full screen" KStandardAction lives.
Comment 2 Jin Liu 2022-05-19 10:19:39 UTC
I did some debugging and found this is indeed a kwin bug. But I don't know kwin enough to fix it though.

The bug happens when X11, 250% zoom, screen size is not multiply of 3, and KDE/Qt apps only.
The code is kwin/x11window.cpp: X11Window::isFullScreenable :

>    if (rules()->checkStrictGeometry(true)) {
I don't know why but seems all KDE apps require strict geometry, while other apps don't. So only KDE apps pass the above check.
 
>        // check geometry constraints (rule to obey is set)
>        const QRect fullScreenArea = workspace()->clientArea(FullScreenArea, this);
In my computer fullScreenArea is (3200,2000)

>        const QSize constrainedClientSize = constrainClientSize(fullScreenArea.size());
While constrainedClientSize is (3198, 1998). I.e. rounded to multiply of 3. That 3 comes from WM_SIZE_HINTS which specified resize increment = 3. I didn't track where that size hint come from, but again only KDE apps get that resize increment hint.

>        if (rules()->checkSize(constrainedClientSize) != fullScreenArea.size()) {
So this check fails for all KDE apps in this particular screen size and zoom combo.

>            return false; // the app wouldn't fit exactly fullscreen geometry due to its strict geometry requirements
>        }
>    }
Comment 3 Nate Graham 2022-05-24 15:05:54 UTC
I wonder if fixing this would also fix Bug 391956.

The bug is only present on X11, right? It works on Wayland?
Comment 4 Jin Liu 2022-05-24 15:24:34 UTC
(In reply to Nate Graham from comment #3)
> I wonder if fixing this would also fix Bug 391956.
> 
> The bug is only present on X11, right? It works on Wayland?

Yes it works on Wayland. And on X11 it can be worked around by creating a "force disable Strict Geometry for all windows" window rule. Ditto for Bug 391956.
So I guess these two bugs are indeed caused by the same problem: Strict Geometry forcing the window size to be multiply of global scaling factor, and thus unable to exactly fill the whole screen (as in this bug), or the desktop area (as in bug 391956).
Comment 5 Nate Graham 2022-05-24 21:08:34 UTC
Sounds right. I'll mark this as a duplicate. Would you mind posting the conclusions of your technical investigation in Bug 391956? Thanks!

*** This bug has been marked as a duplicate of bug 391956 ***