Bug 476653 - Plastik and other 3rd-party window decoration themes do not work on X11
Summary: Plastik and other 3rd-party window decoration themes do not work on X11
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: decorations (show other bugs)
Version: master
Platform: Neon Linux
: NOR major
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2023-11-06 23:43 UTC by Zoey Ahmed
Modified: 2023-12-05 22:13 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zoey Ahmed 2023-11-06 23:43:35 UTC
SUMMARY
***
The default Plastik titlebar in KDE Neon Unstable Edition buttons are completely non-functional, and the window can not be moved by dragging the title bar.
***

STEPS TO REPRODUCE
1. Log into KDE Neon on the X11 session
2. Open any application with a titlebar
3. Try to use the buttons in the titlebar, or drag the window around using the titlebar.

OBSERVED RESULT

The titlebars buttons are non-functional and can not drag the window round the screen using the titlebar.
EXPECTED RESULT

The buttons should do their corresponding actions, and when a titlebar is grabbed and dragged, the window should move along with it. 

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE Neon Unstable Edition
KDE Plasma Version: KDE Plasma 6.0 Dev
KDE Frameworks Version:  5.240.0
Qt Version: 6.6.0

ADDITIONAL INFORMATION
The functionality of the title bars is restored when switching to the Wayland session once Neon is installed. I understand X11 is taking a back seat for Plasma 6, so this is somewhat expected.
Comment 1 guimarcalsilva 2023-11-08 21:05:32 UTC
Confirmed. I tested a few random themes from GHNS in addition to Plastik and none of them work on X11.
Comment 2 Nate Graham 2023-11-08 21:16:38 UTC
Could you take a screen recording so I can see exactly what's happening? Thanks!
Comment 3 Zoey Ahmed 2023-11-09 18:13:52 UTC
(In reply to Nate Graham from comment #2)
> Could you take a screen recording so I can see exactly what's happening?
> Thanks!

Here is it on X11 
https://youtube.com/shorts/dZ8Kv3ssxiY
Here is it working on Wayland as intended
https://youtube.com/shorts/WcNtfLnwpLM
Comment 4 Nate Graham 2023-11-09 21:52:43 UTC
Very interesting, thanks. Can I ask a few more questions?
1. Is it working on X11 with the Breeze window decoration theme, not Plastik? How about a 3rd-party window decoration theme?
2. Are any of the buttons on the titlebar  interactive when it's in this state? Or no?
3. Do any of the titlebar buttons *visually* react when clicked while the titlebar is in this state?
Comment 5 Zoey Ahmed 2023-11-11 00:22:25 UTC
(In reply to Nate Graham from comment #4)
> Very interesting, thanks. Can I ask a few more questions?
> 1. Is it working on X11 with the Breeze window decoration theme, not
> Plastik? How about a 3rd-party window decoration theme?
> 2. Are any of the buttons on the titlebar  interactive when it's in this
> state? Or no?
> 3. Do any of the titlebar buttons *visually* react when clicked while the
> titlebar is in this state?

Hello, sorry ive been quite busy with school so i didnt respond quickly, anyways:
1. Breeze decorations work as expected on X11 on all accounts. 
2. The close button does go a shade of red when hovered over, but that is it.
3. No
Comment 6 Nate Graham 2023-11-16 21:47:22 UTC
Thanks. Do any 3rd-party window decoration themes also exhibit these issues? Or is it just Plastik?
Comment 7 Zoey Ahmed 2023-11-17 22:42:15 UTC
(In reply to Nate Graham from comment #6)
> Thanks. Do any 3rd-party window decoration themes also exhibit these issues?
> Or is it just Plastik?

3rd party window decorations have exactly the same issuses as Plastik. Only Breeze works as intended
Comment 8 Nate Graham 2023-11-29 20:04:30 UTC
Can reproduce.
Comment 9 Bug Janitor Service 2023-12-04 16:06:25 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/4742
Comment 10 Vlad Zahorodnii 2023-12-05 22:13:59 UTC
Git commit b01b626ca81d23583a8c33307a94874a8ff0ad37 by Vlad Zahorodnii.
Committed on 05/12/2023 at 23:04.
Pushed by vladz into branch 'master'.

x11: Fix MouseButtonPress events sent to decoration

ButtonPressEvent::state includes keys and buttons prior to the button
press has been generated.

On the other hand, it appears that QMouseEvent::buttons() should include
currently pressed buttons, i.e. the button that has been just pressed
should be in that bitfield.

This is important for QQuickDeliveryAgent, which checks
QMouseEvent::button() and QMouseEvent::buttons() to decide whether to
send the button event only to tap handlers or both tap handlers and
mouse areas.

M  +12   -4    src/events.cpp

https://invent.kde.org/plasma/kwin/-/commit/b01b626ca81d23583a8c33307a94874a8ff0ad37