Skip to content
Snippets Groups Projects

qt: wayland: fix incorrect input region after switching the window title bar setting (`FramelessWindowHint`)

Merged Fatih Uzunoğlu requested to merge fuzun/vlc:qt/disablemaskratherthanemptyregion into master

This is useful when toggling the window title bar setting. For example, if it is switched on from off, a title bar appears and the window geometry no longer counts the title bar, but then, the mask needs to account for the title bar. This is observed with KWin, where SSD is supported (through zxdg_decoration_manager_v1) but not effective when the setting is switched (which effectively means switching the FramelessWindowHint flag), as in that case Qt platform plugin tries to decorate the window itself (probably the protocol does not support switching SSD like that).

I assume this occurs because the title bar is not really server-side decoration but rather the one provided by platform decoration (QT_WAYLAND_DECORATION), so technically client-side decoration (managed by the platform plugin).

Since when FramelessWindowHint is off; either SSD (zxdg_decoration_manager_v1), or CSD (managed by the platform plugin), in both cases the windowExtendedMargin() would be set to 0 in our case, this is a valid workaround instead of trying to get the client side margins with (QWaylandWindow::clientSideMargins()) and accounting it when applying the margins.

I'm not sure if this is a Qt or KWin Wayland bug, because if CSD is handled by the platform plugin, the application should not be forced to care about the CSD. In that case for the application, it is no different than SSD.

Also use QRect(QPoint(0, 0), m_qmlView->size()) instead of m_qmlView->geometry() because mask should be relative to the window, not screen. Currently this does not change anything because XDG surface (at least regular ones) does not provide where it is positioned in the screen, so QWindow::position() returns (0, 0).

Request review @chub.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading