https://bugs.kde.org/show_bug.cgi?id=528099

            Bug ID: 528099
           Summary: Native Wayland window flickers between sizes at
                    mixed-scale monitor boundary.
    Classification: Plasma
           Product: kwin
      Version First 6.8.1
       Reported In:
          Platform: Arch Linux
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: wayland-generic
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

Created attachment 197883
  --> https://bugs.kde.org/attachment.cgi?id=197883&action=edit
Visual of the flickering issue and size changes.

When moving a native Wayland window (In testing, Firefox, Spotify, and Vesktop)
across the boundary between two displays with different scale factors, KWin
repeatedly changes the window's reported size and output assignment. With the
window centered on the seam, it flickers rapidly between two sizes. Repeatedly
dragging it across the boundary can shrink it to its minimum size. On the TV
display, the rendered content becomes smaller while input hit-testing and
resizing no longer line up with the visible window.

Steps to reproduce

1. In a Wayland session, extend the desktop across the two displays listed
below, with `DP-1` on the left and `HDMI-A-1` on the right.
2. Set `DP-1` to 1920×1080 at 165 Hz and scale 1.0. Set `HDMI-A-1` to 1360×768
at 60.37 Hz and scale 0.708333.
3. Happens with Firefox, Spotify, but for this example try to launch Vesktop as
a native Wayland client. The tested renderer command line included
`--ozone-platform=wayland`.
4. Drag it so its center is near the boundary between the displays.
5. Drag it back and forth between the displays several times, then test
resizing and clicking controls while it is on `HDMI-A-1`.

 At the seam, the window rapidly flickers between two sizes.
- On `HDMI-A-1`, the window and its contents are visibly reduced. Resizing is
broken, and clickable controls do not line up with their visible positions.
Areas of content beyond the visible right or bottom edge cannot be clicked.
- Repeated crossings progressively reduce the window until it reaches its
minimum size.

Expected result

The window should keep a stable size while moving between displays. Its
rendered contents, frame geometry, and input hit-testing should remain aligned.
At the seam it should not alternate rapidly between output assignments and
sizes.

- Session: Wayland.
- Displays side by side, `DP-1` left and `HDMI-A-1` right.
- `DP-1`: 1920×1080 at 165 Hz; scale 1.0; logical origin (0, 0).
- `HDMI-A-1`: 1360×768 at 60.37 Hz; scale 0.708333; logical origin (1920, 0);
KScreen reports logical geometry 1920×1085.
- GPU: NVIDIA GeForce GTX 1660 Ti; driver 615.78.8.
- The reporter observes the issue on Plasma 6.8.0 and 6.8.1 A live geometry
capture also reproduced the oscillation on KWin 6.7.5, Qt 6.12.0, kernel
6.18.57.
- Vesktop renderer is native Wayland (`--ozone-platform=wayland`).
- Firefox's inspected process had `MOZ_ENABLE_WAYLAND=0`, so it used XWayland.
Firefox appeared unaffected in the reporter's comparison. This suggests the
problem may depend on the native Wayland client path; it does not establish the
root cause.

KWin geometry measurements

While the Vesktop window was flickering at the seam, KWin's `frameGeometry` and
output assignment were sampled 100 times at 100 ms intervals over about 10
seconds:

- 58 samples reported 948×532 on `HDMI-A-1`.
- 42 samples reported 673.41×385.41 on `DP-1`.
- The reported top-left stayed at x=1571.51, y=373.44.
- Size/output assignment changed between adjacent samples 39 times.

KWin defines a window's output as the output containing its center. With the
sampled fixed top-left, the reported center falls at x≈2045.51 in the larger
state and x≈1908.21 in the smaller state; the output boundary is x=1920. The
center therefore crosses the boundary as the size changes. The size ratio
(about 1.407) is close to the reciprocal of the TV scale (1/0.708333 ≈ 1.412).
These measurements show KWin's reported size and output assignment oscillating
together. They suggest a scale/geometry feedback loop but do not identify the
responsible code path.

Firefox used XWayland (`MOZ_ENABLE_WAYLAND=0`) while Vesktop used native
Wayland, and surprisingly, this completely fixes the issue for any window (Also
applied on Spotify!). Then applied to to Vesktop, and it fixed as well.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to