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

            Bug ID: 523146
           Summary: KWin accepts buffer_scale commit with non-divisible
                    buffer size
    Classification: Plasma
           Product: kwin
      Version First master
       Reported In:
          Platform: unspecified
                OS: All
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: wayland-generic
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

Created attachment 194358
  --> https://bugs.kde.org/attachment.cgi?id=194358&action=edit
testcase for invalid buffer

DESCRIPTION
Wayland requires the compositor to send wl_surface.error.invalid_size when a
surface is committed with a buffer whose size is not divisible by the committed
buffer_scale.

Reference: https://wayland.app/protocols/wayland#wl_surface:request:attach

The attached test commits wl_surface.set_buffer_scale(2), then attaches and
commits a 773x688 ARGB8888 wl_shm buffer. Because 773 is not divisible by 2,
this commit should be rejected with invalid_size.

STEPS TO REPRODUCE
1. Compile the testcase:
    test.c with gcc test.c -o test $(pkg-config --cflags --libs wayland-client)
2. Run ./test with correct WAYLAND_DISPLAY and XDG_RUNTIME_DIR.
3. Check the output.

OBSERVED RESULT
The test prints:
   fail: compositor accepted an invalid buffer-scale mismatch

EXPECTED RESULT
The test prints:
   success: compositor rejected the invalid buffer size with
wl_surface.error.invalid_size

SOFTWARE/OS VERSIONS
Operating System: NixOS 25.04
kwin: master ed1ee4fda4

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

Reply via email to