Bug 459373 - Maximized XWayland apps leave some pixels on the right border with fractional scale factor
Summary: Maximized XWayland apps leave some pixels on the right border with fractional...
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.26.90
Platform: Other Other
: NOR normal with 2 votes (vote)
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: regression
: 458481 462906 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-09-19 08:08 UTC by Iyán Méndez Veiga
Modified: 2023-01-26 16:29 UTC (History)
11 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Still an issue on 5.26.4 (265.74 KB, image/png)
2022-11-29 18:38 UTC, André M
Details
Still an issue on kwin-git a93ccbd7e74 (224.07 KB, image/png)
2022-11-29 23:47 UTC, André M
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Iyán Méndez Veiga 2022-09-19 08:08:13 UTC
SUMMARY
After updating to Plasma 5.26, when I maximize xwayland apps (e.g. VLC, PyCharm, etc.), a column of 1 or 2 pixels are left to the right showing the background. In some situations it can be unnoticeable, but others can be very distracting.


STEPS TO REPRODUCE
1. In order to make it more obvious, choose a bright wallpaper (a solid white wallpaper is perfect)
2. Open a xwayland app (e.g. VLC) and maximize, either with the keyboard or with the window button
3. Observe a column of few pixels on the right not covered by the app

OBSERVED RESULT
xwayland apps don't use exactly the full screen when maximized. I cannot take a screenshot to show this, because Spectacle seems to ignore that extra column of pixels.

EXPECTED RESULT
Maximized apps, both xwayland and native wayland ones, should cover all screen when maximized.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.25.90
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6
Kernel Version: 5.19.9-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 8 × 11th Gen Intel® Core™ i5-1135G7 @ 2.40GHz
Memory: 15.4 GiB of RAM
Graphics Processor: Mesa Intel® Xe Graphics
Manufacturer: LENOVO
Product Name: 20XYCTO1WW
System Version: ThinkPad X1 Yoga Gen 6
Comment 1 Aurora Robb Kristiansen 2022-09-19 21:39:35 UTC
This happens to me as well on my HiDPI laptop, it is very noticeable in Blender (with xwayland) as it leaves a 2 pixel gap between the right side and along the bottom of the window, when it is maximized.
It is also noticeable in VLC.

In Blender, most of the app looks very crisp and nice thanks to using its own scaling, but near the right side and bottom, elements are slightly blurry. I wonder if it's because of this gap?

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.25.90
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6
Kernel Version: 5.19.9-zen1-1-zen
Graphics Platform: Wayland

Laptop: Lenovo IdeaPad 5 Pro 16ACH6
Processor and Graphics: AMD Ryzen 5 5600H with Vega 7 graphics
Product Name: 82L5
System Version: ThinkPad X1 Yoga Gen 6
Screen resolution: 2560x1600
PPI: 188.68
Scaling in Plasma settings: 150%
Comment 2 Iyán Méndez Veiga 2022-09-21 08:10:30 UTC
I also note that same happens in the bottom as confirmed by Aurora.
Comment 3 Bug Janitor Service 2022-09-28 09:00:06 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/3008
Comment 4 Iyán Méndez Veiga 2022-10-13 10:43:32 UTC
Why was the fix not merge to 5.26?
Comment 5 Nate Graham 2022-10-14 17:51:55 UTC
It hasn't been merged anywhere yet; the change is still under review.
Comment 6 Zamundaaa 2022-10-14 23:40:21 UTC
*** Bug 458481 has been marked as a duplicate of this bug. ***
Comment 7 Zamundaaa 2022-10-23 21:29:41 UTC
Git commit ceae7175006c9b56acc63d40bcaa93986ed28572 by Xaver Hugl.
Committed on 23/10/2022 at 20:06.
Pushed by zamundaaa into branch 'master'.

output: don't round geometry as often

M  +5    -0    src/core/output.cpp
M  +5    -0    src/core/output.h
M  +4    -4    src/wayland/xdgoutput_v1_interface.cpp
M  +4    -4    src/workspace.cpp

https://invent.kde.org/plasma/kwin/commit/ceae7175006c9b56acc63d40bcaa93986ed28572
Comment 8 Zamundaaa 2022-10-23 22:45:44 UTC
Git commit dadf93f87ae338d9b3765507d3fd1b3e8c9fa440 by Xaver Hugl.
Committed on 23/10/2022 at 22:36.
Pushed by zamundaaa into branch 'Plasma/5.26'.

output: don't round geometry as often
(cherry picked from commit ceae7175006c9b56acc63d40bcaa93986ed28572)

M  +5    -0    src/core/output.cpp
M  +5    -0    src/core/output.h
M  +11   -11   src/wayland/xdgoutput_v1_interface.cpp
M  +4    -4    src/wayland/xdgoutput_v1_interface.h
M  +2    -2    src/waylandoutput.cpp
M  +4    -4    src/workspace.cpp

https://invent.kde.org/plasma/kwin/commit/dadf93f87ae338d9b3765507d3fd1b3e8c9fa440
Comment 9 Iyán Méndez Veiga 2022-10-25 14:44:09 UTC
The merged patch is only a partial solution for this bug. There are still combinations of screen resolutions and scale factors where one can get a border. Should we keep this open not to forget or should I open a new bug?
Comment 10 Joshua T 2022-10-25 14:46:08 UTC
(In reply to Iyán Méndez Veiga from comment #9)
> The merged patch is only a partial solution for this bug. There are still
> combinations of screen resolutions and scale factors where one can get a
> border. Should we keep this open not to forget or should I open a new bug?

Maybe so, that makes sense. I have still experienced a small gap on the bottom of Xwayland windows.
Comment 11 Iyán Méndez Veiga 2022-11-18 09:36:15 UTC
I just noticed today that this is again as bad as when I first reported this bug. Was something reverted in 5.26.3?
Comment 12 Zamundaaa 2022-11-18 15:38:28 UTC
Yes, part of had to be reverted due to the Xorg session breaking really badly
Comment 13 Bug Janitor Service 2022-11-18 21:53:43 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/3215
Comment 14 Aleix Pol 2022-11-21 19:09:52 UTC
Git commit df77fcd9e01d8cd2a31f785acde214f2146c04e2 by Aleix Pol Gonzalez, on behalf of Aleix Pol.
Committed on 21/11/2022 at 14:16.
Pushed by apol into branch 'master'.

x11window: Calculate the native floor from the begining of the output

If this function is useful to make sure we are properly aligned with the
output's pixels, we should start with the output's 0, otherwise we'll be
carrying over the rounding errors increasingly as our workspace grows.

M  +10   -0    src/core/output.cpp
M  +10   -0    src/core/output.h
M  +9    -4    src/utils/xcbutils.cpp
M  +0    -1    src/utils/xcbutils.h

https://invent.kde.org/plasma/kwin/commit/df77fcd9e01d8cd2a31f785acde214f2146c04e2
Comment 15 André M 2022-11-29 18:38:28 UTC Comment hidden (spam)
Comment 16 Joshua T 2022-11-29 20:11:36 UTC Comment hidden (spam)
Comment 17 Iyán Méndez Veiga 2022-11-29 21:19:39 UTC Comment hidden (spam)
Comment 18 Nate Graham 2022-11-29 21:21:23 UTC Comment hidden (spam)
Comment 19 Iyán Méndez Veiga 2022-11-29 21:50:22 UTC
Nate: I know the patch was not merged for 5.26.4, but I just compiled kwin 5.26.4 with that additional patch (I guess André M did the same), and it doesn't fix the issue. As far as I know, that commit was the only one mentioned this bug in master.
Comment 20 André M 2022-11-29 23:47:44 UTC
Created attachment 154154 [details]
Still an issue on kwin-git a93ccbd7e74

Ok, compiled kwin-git, kdecoration-git and kwayland-git as of today, and the issue is still present, but has improved; if you compare with the previous screenshot with VLC, the bottom pixel is gone, and when in fullscreen, Xwayland apps also don't show the bug; BUT when Xwayland app is maximized, on the right side the wallpaper still can be seen; while it's maximized, editing the left panel's width makes it disappear, but as soon as unmaximizing and remaximizing the app, the bleeding shows up again.
Comment 21 Nate Graham 2022-11-30 17:04:47 UTC
Ok, thanks for testing so extensively!
Comment 22 Iyán Méndez Veiga 2023-01-19 22:17:50 UTC
I still observe this issue with Plasma 5.26.90 and KDE Frameworks 5.102.0.
Comment 23 Nate Graham 2023-01-20 22:18:31 UTC
*** Bug 462906 has been marked as a duplicate of this bug. ***
Comment 24 André M 2023-01-25 20:32:50 UTC
The situation seems to have improved on Plasma 5.26.90 (5.27 beta):
While moving a *xwayland window* between 2 monitors (main 2560x1600 150% with left, top panels; right 2560x1440 135% no panels), when they go to the other monitor while already maximized, they occupy the correct area on the other monitor, leaving no gaps; when unmaximizing and re-maximizing in place, the right border still leaves a couple of pixels off, showing the wallpaper or window below, as before. Either way, bottom gap is gone.