Bug 498446 - GL_INVALID_VALUE in glTexSubImage2D under fractional scaling, breaking "show keyboard accelerator when alt is pressed" in window menu
Summary: GL_INVALID_VALUE in glTexSubImage2D under fractional scaling, breaking "show ...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: scene-opengl (other bugs)
Version First Reported In: git master
Platform: Fedora RPMs Linux
: NOR minor
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: accessibility
Depends on:
Blocks:
 
Reported: 2025-01-09 22:41 UTC by Georgiy Treyvus
Modified: 2025-01-15 17:24 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
working accels (23.58 KB, image/png)
2025-01-10 08:40 UTC, David Redondo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Georgiy Treyvus 2025-01-09 22:41:33 UTC
=== Expected behavior ===

When a user opens the Window Operations Menu they should be able to discover which accelerator keys map to which action or submenu.

=== Actual behavior ===

Even pressing and/or holding Alt doesn't reveal the accelerator keys.

For novices the only way to discover them is by trial and error pressing keys and seeing what does/doesn't happen.

For programmers they can look at the strings passed to the various addAction calls in UserActionMenu::init in src/useractions.cpp.

Either way it shouldn't be this painful.

=== Other thoughts ===

Ideally once the Window Operations Menu is invoked the user would just see the underlined accelerator keys without needing to press or hold Alt for proper discoverability as was the case in the good old days.

But even needing to press Alt to see them is fine. That would at least be consistent with the unfortunate change of norms that seemed to happen around 2012-13 not just with KDE but also GTK/MATE/Cinnamon/Xfce.
Comment 1 David Redondo 2025-01-10 08:40:37 UTC
The right click on decoration menu? It shows accelerators here.
Comment 2 David Redondo 2025-01-10 08:40:56 UTC
Created attachment 177250 [details]
working accels
Comment 3 Georgiy Treyvus 2025-01-10 16:26:34 UTC
So I did some more testing from the Fedora 41 live media.

This issue has something to do with the Application Style that's set. By default that's Breeze. But when I change it to Fusion or MS Windows 9x it works.

But with the Breeze style it doesn't matter whether I invoke the Window Operations menu by Alt+F3 or right clicking on the title bar or however else. The accelerator keys do not show. They don't show when I press Alt.

(They don't show when I hover the mouse over the menu items either. But at that point if I'm already using the mouse instead of keyboard shortcuts I've lost the game.)
Comment 4 fanzhuyifan 2025-01-12 01:05:45 UTC
Can reproduce with either the menu opened via right click, clicking top left corner, or shortcut. Using breeze style.

kwin: git master commit b36151e81a456d25b118abadb791b4a12bc624be

Operating System: Arch Linux 
KDE Plasma Version: 6.3.80
KDE Frameworks Version: 6.11.0
Qt Version: 6.9.0
Kernel Version: 6.12.8-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 20 × 13th Gen Intel® Core™ i9-13900H
Memory: 15.2 GiB of RAM
Graphics Processor 1: Mesa Intel® Graphics
Graphics Processor 2: llvmpipe
Manufacturer: ASUSTeK COMPUTER INC.
Product Name: ROG Zephyrus G16 GU603VV_GU603VV
System Version: 1.0
Comment 5 Nate Graham 2025-01-13 21:02:54 UTC
Can reproduce the issue same as Yifan.
Comment 6 fanzhuyifan 2025-01-14 02:46:24 UTC
The issue only appears when the keyboard accelerators visibility option is set to "show when alt key is pressed". If set to always show, the accelerators are correctly shown.
Comment 7 fanzhuyifan 2025-01-14 02:59:31 UTC
For some reason, this *does not* happen when running nested kwin (e.g., with dbus-run-session kwin_wayland --exit-with-session konsole)
Comment 8 fanzhuyifan 2025-01-14 05:41:45 UTC
The underlying issue seems to be rounding errors under fractional scaling. The evidence includes:

- The issue doesn't occur when all displays are set to 100% scaling
- When display is set to fractional scaling (on my end 135%) to trigger the issue, I see lines such as
> kwin_scene_opengl: 0x2: GL_INVALID_VALUE in glTexSubImage2D(xoffset 0 + width 507 > 506)
> kwin_scene_opengl: 0x3: GL_INVALID_VALUE in glTexSubImage2D(yoffset 0 + height 947 > 946)
in the logs when I press/release alt, indicating a off-by-1 error in the size. (only first line appears if no submenus are open, second line appears if a certain submenu is open).
Comment 9 Bug Janitor Service 2025-01-15 13:56:09 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/7011
Comment 10 Vlad Zahorodnii 2025-01-15 15:25:43 UTC
Git commit 8073f1380166d328ad24cf2e066260c18c1a1a2e by Vlad Zahorodnii.
Committed on 15/01/2025 at 14:59.
Pushed by vladz into branch 'master'.

plugins/qpa: Clip buffer damage

Buffer damage must remain confined to the buffer rect.

M  +4    -1    src/plugins/qpa/backingstore.cpp

https://invent.kde.org/plasma/kwin/-/commit/8073f1380166d328ad24cf2e066260c18c1a1a2e
Comment 11 Vlad Zahorodnii 2025-01-15 16:19:19 UTC
Git commit 865660f55378f8bd5b0b41de398b27b6975bee1c by Vlad Zahorodnii.
Committed on 15/01/2025 at 15:54.
Pushed by vladz into branch 'Plasma/6.3'.

plugins/qpa: Clip buffer damage

Buffer damage must remain confined to the buffer rect.


(cherry picked from commit 8073f1380166d328ad24cf2e066260c18c1a1a2e)

Co-authored-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>

M  +4    -1    src/plugins/qpa/backingstore.cpp

https://invent.kde.org/plasma/kwin/-/commit/865660f55378f8bd5b0b41de398b27b6975bee1c
Comment 12 fanzhuyifan 2025-01-15 17:24:16 UTC
Can verify the fix.