Commit 6f6603eb authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

x11integration: Force standalone Qt::Dialog resizable

Because KWin now honors minimize/maximize button hint.

CCBUG: 430666
parent 3196d6f0
......@@ -62,6 +62,27 @@ bool X11Integration::eventFilter(QObject *watched, QEvent *event)
QPlatformSurfaceEvent *pe = static_cast<QPlatformSurfaceEvent*>(event);
if (!w->flags().testFlag(Qt::ForeignWindow)) {
if (pe->surfaceEventType() == QPlatformSurfaceEvent::SurfaceCreated) {
auto flags = w->flags();
// A recent KWin change means it now follows WindowButtonHints on X11
// Some KDE applications use QDialogs for their main window,
// which means the KWin now surfaces those windows having the wrong hints.
// To avoid clients changing, we adjust flags here.
// This is documented as being only available on some platforms,
// so altering is relatively safe.
if (flags.testFlag(Qt::Dialog)) {
if (!w->transientParent()) {
flags.setFlag(Qt::WindowMinimizeButtonHint, true);
// QWINDOWSIZE_MAX from qwindow_p.h
const auto maxWindowSize = ((1<<24)-1);
if (w->maximumSize() == QSize(maxWindowSize, maxWindowSize)) {
flags.setFlag(Qt::WindowMaximizeButtonHint, true);
if (qApp->property(s_schemePropertyName).isValid()) {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment