05c147f1a9
Update to 5.5.0 OBS-URL: https://build.opensuse.org/request/show/324146 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libqt5-qtbase?expand=0&rev=46
131 lines
5.1 KiB
Diff
131 lines
5.1 KiB
Diff
From 552cbc0d89dcdbf32dfe652ff7d3bbe45dafe595 Mon Sep 17 00:00:00 2001
|
|
From: Alexander Volkov <a.volkov@rusbitech.ru>
|
|
Date: Thu, 7 May 2015 17:36:57 +0300
|
|
Subject: [PATCH] Restore documented behavior for the WA_X11NetWmWindowType*
|
|
attributes
|
|
|
|
Use QXcbWindowFunctions::setWmWindowType() to add the corresponding
|
|
types to the window's _NET_WM_WINDOW_TYPE X11 window property.
|
|
|
|
Change-Id: Ia2413ad7a69ab8d49b448de11dd07c77101a564c
|
|
Task-number: QTBUG-39887
|
|
---
|
|
src/src.pro | 2 +-
|
|
src/widgets/kernel/qwidget.cpp | 45 ++++++++++++++++++++++++++++++++++++++----
|
|
src/widgets/kernel/qwidget_p.h | 3 ++-
|
|
3 files changed, 44 insertions(+), 6 deletions(-)
|
|
|
|
diff --git a/src/src.pro b/src/src.pro
|
|
index b4d62aa..090ae68 100644
|
|
--- a/src/src.pro
|
|
+++ b/src/src.pro
|
|
@@ -110,7 +110,7 @@ src_platformsupport.depends = src_corelib src_gui src_platformheaders
|
|
|
|
src_widgets.subdir = $$PWD/widgets
|
|
src_widgets.target = sub-widgets
|
|
-src_widgets.depends = src_corelib src_gui src_tools_uic
|
|
+src_widgets.depends = src_corelib src_gui src_tools_uic src_platformheaders
|
|
|
|
src_opengl.subdir = $$PWD/opengl
|
|
src_opengl.target = sub-opengl
|
|
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
|
|
index b2ea83c..d918b1a 100644
|
|
--- a/src/widgets/kernel/qwidget.cpp
|
|
+++ b/src/widgets/kernel/qwidget.cpp
|
|
@@ -1406,6 +1407,7 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
|
|
win->setProperty("_q_showWithoutActivating", QVariant(true));
|
|
if (q->testAttribute(Qt::WA_MacAlwaysShowToolWindow))
|
|
win->setProperty("_q_macAlwaysShowToolWindow", QVariant::fromValue(QVariant(true)));
|
|
+ setNetWmWindowTypes();
|
|
win->setFlags(data.window_flags);
|
|
fixPosIncludesFrame();
|
|
if (q->testAttribute(Qt::WA_Moved)
|
|
@@ -11135,7 +11137,6 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
|
|
break;
|
|
}
|
|
|
|
-#ifdef Q_DEAD_CODE_FROM_QT4_X11
|
|
case Qt::WA_X11NetWmWindowTypeDesktop:
|
|
case Qt::WA_X11NetWmWindowTypeDock:
|
|
case Qt::WA_X11NetWmWindowTypeToolBar:
|
|
@@ -11149,10 +11150,8 @@ void QWidget::setAttribute(Qt::WidgetAttribute attribute, bool on)
|
|
case Qt::WA_X11NetWmWindowTypeNotification:
|
|
case Qt::WA_X11NetWmWindowTypeCombo:
|
|
case Qt::WA_X11NetWmWindowTypeDND:
|
|
- if (testAttribute(Qt::WA_WState_Created))
|
|
- d->setNetWmWindowTypes();
|
|
+ d->setNetWmWindowTypes();
|
|
break;
|
|
-#endif
|
|
|
|
case Qt::WA_StaticContents:
|
|
if (QWidgetBackingStore *bs = d->maybeBackingStore()) {
|
|
@@ -12796,6 +12795,44 @@ void QWidgetPrivate::setWidgetParentHelper(QObject *widgetAsObject, QObject *new
|
|
widget->setParent(static_cast<QWidget*>(newParent));
|
|
}
|
|
|
|
+void QWidgetPrivate::setNetWmWindowTypes()
|
|
+{
|
|
+ Q_Q(QWidget);
|
|
+
|
|
+ if (!q->windowHandle())
|
|
+ return;
|
|
+
|
|
+ int wmWindowType = 0;
|
|
+ if (q->testAttribute(Qt::WA_X11NetWmWindowTypeDesktop))
|
|
+ wmWindowType |= QXcbWindowFunctions::Desktop;
|
|
+ if (q->testAttribute(Qt::WA_X11NetWmWindowTypeDock))
|
|
+ wmWindowType |= QXcbWindowFunctions::Dock;
|
|
+ if (q->testAttribute(Qt::WA_X11NetWmWindowTypeToolBar))
|
|
+ wmWindowType |= QXcbWindowFunctions::Toolbar;
|
|
+ if (q->testAttribute(Qt::WA_X11NetWmWindowTypeMenu))
|
|
+ wmWindowType |= QXcbWindowFunctions::Menu;
|
|
+ if (q->testAttribute(Qt::WA_X11NetWmWindowTypeUtility))
|
|
+ wmWindowType |= QXcbWindowFunctions::Utility;
|
|
+ if (q->testAttribute(Qt::WA_X11NetWmWindowTypeSplash))
|
|
+ wmWindowType |= QXcbWindowFunctions::Splash;
|
|
+ if (q->testAttribute(Qt::WA_X11NetWmWindowTypeDialog))
|
|
+ wmWindowType |= QXcbWindowFunctions::Dialog;
|
|
+ if (q->testAttribute(Qt::WA_X11NetWmWindowTypeDropDownMenu))
|
|
+ wmWindowType |= QXcbWindowFunctions::DropDownMenu;
|
|
+ if (q->testAttribute(Qt::WA_X11NetWmWindowTypePopupMenu))
|
|
+ wmWindowType |= QXcbWindowFunctions::PopupMenu;
|
|
+ if (q->testAttribute(Qt::WA_X11NetWmWindowTypeToolTip))
|
|
+ wmWindowType |= QXcbWindowFunctions::Tooltip;
|
|
+ if (q->testAttribute(Qt::WA_X11NetWmWindowTypeNotification))
|
|
+ wmWindowType |= QXcbWindowFunctions::Notification;
|
|
+ if (q->testAttribute(Qt::WA_X11NetWmWindowTypeCombo))
|
|
+ wmWindowType |= QXcbWindowFunctions::Combo;
|
|
+ if (q->testAttribute(Qt::WA_X11NetWmWindowTypeDND))
|
|
+ wmWindowType |= QXcbWindowFunctions::Dnd;
|
|
+
|
|
+ QXcbWindowFunctions::setWmWindowType(q->windowHandle(), static_cast<QXcbWindowFunctions::WmWindowType>(wmWindowType));
|
|
+}
|
|
+
|
|
QT_END_NAMESPACE
|
|
|
|
#include "moc_qwidget.cpp"
|
|
diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h
|
|
index fe65cb1..dc1c580 100644
|
|
--- a/src/widgets/kernel/qwidget_p.h
|
|
+++ b/src/widgets/kernel/qwidget_p.h
|
|
@@ -752,7 +752,6 @@ public:
|
|
|
|
void setWindowRole();
|
|
void sendStartupMessage(const char *message) const;
|
|
- void setNetWmWindowTypes();
|
|
void x11UpdateIsOpaque();
|
|
bool isBackgroundInherited() const;
|
|
void updateX11AcceptFocus();
|
|
@@ -849,6 +848,8 @@ public:
|
|
static bool qt_widget_rgn(QWidget *, short, RgnHandle, bool);
|
|
void registerTouchWindow(bool enable = true);
|
|
#endif
|
|
+ void setNetWmWindowTypes();
|
|
+
|
|
bool stealKeyboardGrab(bool grab);
|
|
bool stealMouseGrab(bool grab);
|
|
};
|
|
--
|
|
2.3.5
|