Summary: | For Qt::Dialog type window, KWin_x11 shows minimize and maximize buttons and no close button, instead of the reverse | ||
---|---|---|---|
Product: | [Plasma] kwin | Reporter: | Gary Wang <wzc782970009> |
Component: | decorations | Assignee: | KWin default assignee <kwin-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | bpd489, nate |
Priority: | HI | ||
Version: | 5.26.4 | ||
Target Milestone: | --- | ||
Platform: | Arch Linux | ||
OS: | Linux | ||
See Also: | https://bugs.kde.org/show_bug.cgi?id=437653 | ||
Latest Commit: | https://invent.kde.org/plasma/plasma-integration/-/commit/d6d82f2b0c26b8b5e5e76618fda1dfa763592b78 | Version Fixed In: | 5.27.9 |
Sentry Crash Report: |
Description
Gary Wang
2023-01-12 14:25:57 UTC
*** Bug 474735 has been marked as a duplicate of this bug. *** Once this is fixed, we can probably revert https://invent.kde.org/frameworks/knewstuff/-/commit/ea19fa6e824650f3257e8047d6f90e01899b2e03. A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-integration/-/merge_requests/108 Git commit 522824e4302c5dae2cd92c488153ee2fe048e548 by Vlad Zahorodnii. Committed on 06/10/2023 at 08:23. Pushed by vladz into branch 'master'. Force WindowCloseButtonHint for toplevel dialogs Prior to 6f6603eb64b945e39820a0658504041b851c6e8c, the close button had been implicitly added by QtXCB. For example, if window flags contain only Qt::Dialog, QtXCB will set MWM_FUNC_ALL motif hints. So QtQuick dialogs used to get the close button even though there's no Qt::WinodwCloseButtonHint flag. QtWidgets dialogs usually always pass Qt::WindowCloseButtonHint flag. After making kwin display minimize and maximize decoration buttons only if corresponding Motif hints are set, KDE applications that use windows with Dialog type lost their min/max buttons because QtWidgets code doesn't set those flags. 6f6603eb64b945e39820a0658504041b851c6e8c tried to fix that by making the platform integration theme force Qt::WindowMinimizeButtonHint and Qt::WindowMaximizeButtonHint flags. But it accidentally broke QtQuick dialogs since dialogs have additional flags besides Qt::Dialog now, so QtXCB has stopped setting MWM_FUNC_ALL hints anymore. In order to address that, this patch changes a few things: - Make the platform theme be more careful about changing window flags. If user has explicitly changed window decoration flags, i.e. Qt::CustomizeWindowHint flag is set, don't touch decoration hints. - Merge Qt::WindowMaximizeButtonHint with Qt::WindowMinimizeButtonHint. If the window cannot be maximized, the window manager will hide the maximize button, so we can pass Qt::WindowMinMaxButtonHint. In some way, it's a breaking change as child dialogs may not have maximize button, but it's a weird case and maybe user code should be in control of that? - Forces Qt::WindowCloseButtonHint in addition to min/max button hints. QtQuick child dialogs, i.e. transientParent() is not null, will get default decoration buttons. M +3 -9 qt5/src/platformtheme/x11integration.cpp M +3 -9 qt6/src/platformtheme/x11integration.cpp https://invent.kde.org/plasma/plasma-integration/-/commit/522824e4302c5dae2cd92c488153ee2fe048e548 Git commit d6d82f2b0c26b8b5e5e76618fda1dfa763592b78 by Vlad Zahorodnii. Committed on 06/10/2023 at 09:19. Pushed by vladz into branch 'Plasma/5.27'. Force WindowCloseButtonHint for toplevel dialogs Prior to 6f6603eb64b945e39820a0658504041b851c6e8c, the close button had been implicitly added by QtXCB. For example, if window flags contain only Qt::Dialog, QtXCB will set MWM_FUNC_ALL motif hints. So QtQuick dialogs used to get the close button even though there's no Qt::WinodwCloseButtonHint flag. QtWidgets dialogs usually always pass Qt::WindowCloseButtonHint flag. After making kwin display minimize and maximize decoration buttons only if corresponding Motif hints are set, KDE applications that use windows with Dialog type lost their min/max buttons because QtWidgets code doesn't set those flags. 6f6603eb64b945e39820a0658504041b851c6e8c tried to fix that by making the platform integration theme force Qt::WindowMinimizeButtonHint and Qt::WindowMaximizeButtonHint flags. But it accidentally broke QtQuick dialogs since dialogs have additional flags besides Qt::Dialog now, so QtXCB has stopped setting MWM_FUNC_ALL hints anymore. In order to address that, this patch changes a few things: - Make the platform theme be more careful about changing window flags. If user has explicitly changed window decoration flags, i.e. Qt::CustomizeWindowHint flag is set, don't touch decoration hints. - Merge Qt::WindowMaximizeButtonHint with Qt::WindowMinimizeButtonHint. If the window cannot be maximized, the window manager will hide the maximize button, so we can pass Qt::WindowMinMaxButtonHint. In some way, it's a breaking change as child dialogs may not have maximize button, but it's a weird case and maybe user code should be in control of that? - Forces Qt::WindowCloseButtonHint in addition to min/max button hints. QtQuick child dialogs, i.e. transientParent() is not null, will get default decoration buttons. (cherry picked from commit 522824e4302c5dae2cd92c488153ee2fe048e548) M +3 -9 src/platformtheme/x11integration.cpp https://invent.kde.org/plasma/plasma-integration/-/commit/d6d82f2b0c26b8b5e5e76618fda1dfa763592b78 |