summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-06-13 10:05:49 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-13 10:05:49 +0200
commit9b102e953f3fd63f9f1d6a4ac2626354972c76d6 (patch)
tree96813aeb37532532d7a6c841562f2f33a6f745f3 /src/plugins
parent23d8a7fb237c433a74499dcd65aa60144aafbc46 (diff)
parente2776b44a0e0e34e5a1d851916a94f7db5e7bb7b (diff)
Merge "Merge remote-tracking branch 'origin/stable' into dev" into refs/staging/dev
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/bearer/connman/qconnmanservice_linux.cpp34
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm6
-rw-r--r--src/plugins/platforms/cocoa/qcocoadrag.mm4
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenu.h5
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenu.mm13
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenubar.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenubar.mm68
-rw-r--r--src/plugins/platforms/cocoa/qcocoatheme.mm2
-rw-r--r--src/plugins/platforms/cocoa/qnsviewaccessibility.mm2
-rw-r--r--src/plugins/platforms/eglfs/qeglfshooks_stub.cpp8
-rw-r--r--src/plugins/platforms/eglfs/qeglfswindow.cpp4
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.cpp80
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.h1
-rw-r--r--src/plugins/platforms/windows/qplatformfunctions_wince.h1
-rw-r--r--src/plugins/platforms/windows/qwindowsintegration.cpp3
-rw-r--r--src/plugins/platforms/windows/qwindowsmousehandler.cpp4
-rw-r--r--src/plugins/platforms/xcb/qxcbxsettings.cpp22
17 files changed, 158 insertions, 101 deletions
diff --git a/src/plugins/bearer/connman/qconnmanservice_linux.cpp b/src/plugins/bearer/connman/qconnmanservice_linux.cpp
index 4efecc5464..380cf92a24 100644
--- a/src/plugins/bearer/connman/qconnmanservice_linux.cpp
+++ b/src/plugins/bearer/connman/qconnmanservice_linux.cpp
@@ -74,7 +74,6 @@ const QDBusArgument &operator>>(const QDBusArgument &argument, ConnmanMap &map)
return argument;
}
-static QDBusConnection dbusConnection = QDBusConnection::systemBus();
QConnmanManagerInterface::QConnmanManagerInterface( QObject *parent)
: QDBusAbstractInterface(QLatin1String(CONNMAN_SERVICE),
QLatin1String(CONNMAN_MANAGER_PATH),
@@ -98,7 +97,7 @@ void QConnmanManagerInterface::connectNotify(const QMetaMethod &signal)
QLatin1String(CONNMAN_MANAGER_INTERFACE),
QLatin1String("PropertyChanged"),
this,SIGNAL(propertyChanged(QString,QDBusVariant)))) {
- qWarning() << "PropertyCHanged not connected";
+ qWarning() << "PropertyChanged not connected";
}
}
@@ -118,7 +117,7 @@ void QConnmanManagerInterface::connectNotify(const QMetaMethod &signal)
QConnmanDBusHelper *helper;
helper = new QConnmanDBusHelper(this);
- dbusConnection.connect(QLatin1String(CONNMAN_SERVICE),
+ QDBusConnection::systemBus().connect(QLatin1String(CONNMAN_SERVICE),
QLatin1String(CONNMAN_MANAGER_PATH),
QLatin1String(CONNMAN_MANAGER_INTERFACE),
QLatin1String("PropertyChanged"),
@@ -379,7 +378,7 @@ void QConnmanProfileInterface::connectNotify(const QMetaMethod &signal)
{
static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QConnmanProfileInterface::propertyChanged);
if (signal == propertyChangedSignal) {
- dbusConnection.connect(QLatin1String(CONNMAN_SERVICE),
+ QDBusConnection::systemBus().connect(QLatin1String(CONNMAN_SERVICE),
this->path(),
QLatin1String(CONNMAN_PROFILE_INTERFACE),
QLatin1String("PropertyChanged"),
@@ -449,7 +448,7 @@ void QConnmanServiceInterface::connectNotify(const QMetaMethod &signal)
{
static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QConnmanServiceInterface::propertyChanged);
if (signal == propertyChangedSignal) {
- dbusConnection.connect(QLatin1String(CONNMAN_SERVICE),
+ QDBusConnection::systemBus().connect(QLatin1String(CONNMAN_SERVICE),
this->path(),
QLatin1String(CONNMAN_SERVICE_INTERFACE),
QLatin1String("PropertyChanged"),
@@ -460,7 +459,7 @@ void QConnmanServiceInterface::connectNotify(const QMetaMethod &signal)
QConnmanDBusHelper *helper;
helper = new QConnmanDBusHelper(this);
- dbusConnection.connect(QLatin1String(CONNMAN_SERVICE),
+ QDBusConnection::systemBus().connect(QLatin1String(CONNMAN_SERVICE),
this->path(),
QLatin1String(CONNMAN_SERVICE_INTERFACE),
QLatin1String("PropertyChanged"),
@@ -514,9 +513,6 @@ void QConnmanServiceInterface::remove()
QDBusReply<QVariantMap> reply = this->call(QLatin1String("Remove"));
}
-// void moveBefore(QDBusObjectPath &service);
-// void moveAfter(QDBusObjectPath &service);
-
// properties
QString QConnmanServiceInterface::getState()
{
@@ -779,7 +775,7 @@ void QConnmanTechnologyInterface::connectNotify(const QMetaMethod &signal)
{
static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QConnmanTechnologyInterface::propertyChanged);
if (signal == propertyChangedSignal) {
- dbusConnection.connect(QLatin1String(CONNMAN_SERVICE),
+ QDBusConnection::systemBus().connect(QLatin1String(CONNMAN_SERVICE),
this->path(),
QLatin1String(CONNMAN_TECHNOLOGY_INTERFACE),
QLatin1String("PropertyChanged"),
@@ -790,7 +786,7 @@ void QConnmanTechnologyInterface::connectNotify(const QMetaMethod &signal)
QConnmanDBusHelper *helper;
helper = new QConnmanDBusHelper(this);
- dbusConnection.connect(QLatin1String(CONNMAN_SERVICE),
+ QDBusConnection::systemBus().connect(QLatin1String(CONNMAN_SERVICE),
this->path(),
QLatin1String(CONNMAN_TECHNOLOGY_INTERFACE),
QLatin1String("PropertyChanged"),
@@ -861,23 +857,11 @@ QConnmanAgentInterface::~QConnmanAgentInterface()
void QConnmanAgentInterface::connectNotify(const QMetaMethod &signal)
{
Q_UNUSED(signal);
-// static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QConnmanAgentInterface::propertyChanged);
-// if (signal == propertyChangedSignal) {
-// dbusConnection.connect(QLatin1String(CONNMAN_SERVICE),
-// this->path(),
-// QLatin1String(CONNMAN_NETWORK_INTERFACE),
-// QLatin1String("PropertyChanged"),
-// this,SIGNAL(propertyChanged(QString,QVariant&)));
-// }
}
void QConnmanAgentInterface::disconnectNotify(const QMetaMethod &signal)
{
Q_UNUSED(signal);
-// static const QMetaMethod propertyChangedSignal = QMetaMethod::fromSignal(&QConnmanAgentInterface::propertyChanged);
-// if (signal == propertyChangedSignal) {
-
-// }
}
@@ -889,10 +873,6 @@ void QConnmanAgentInterface::reportError(QDBusObjectPath &/*path*/, const QStrin
{
}
-//dict QConnmanAgentInterface::requestInput(QDBusObjectPath &path, dict fields)
-//{
-//}
-
void QConnmanAgentInterface::cancel()
{
}
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
index f7c945c50d..55a23fda76 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
@@ -151,8 +151,7 @@
[kids addObject: element];
[element release];
}
- // ### maybe we should use NSAccessibilityUnignoredChildren(kids); this needs more profiling
- return kids;
+ return NSAccessibilityUnignoredChildren(kids);
} else if ([attribute isEqualToString:NSAccessibilityFocusedAttribute]) {
// Just check if the app thinks we're focused.
@@ -272,8 +271,7 @@
// No child found, meaning we hit this element.
if (!childInterface) {
// qDebug() << "Hit test returns: " << id << iface;
- return self;
- //return NSAccessibilityUnignoredAncestor(self);
+ return NSAccessibilityUnignoredAncestor(self);
}
QAccessible::Id childId = QAccessible::uniqueId(childInterface);
diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm
index 7dad4271b5..a37552d844 100644
--- a/src/plugins/platforms/cocoa/qcocoadrag.mm
+++ b/src/plugins/platforms/cocoa/qcocoadrag.mm
@@ -123,7 +123,7 @@ Qt::DropAction QCocoaDrag::drag(QDrag *o)
if (pm.isNull())
pm = defaultPixmap();
- NSImage *nsimage = static_cast<NSImage *>(qt_mac_create_nsimage(pm));
+ NSImage *nsimage = qt_mac_create_nsimage(pm);
QMacPasteboard dragBoard((CFStringRef) NSDragPboard, QMacPasteboardMime::MIME_DND);
m_drag->mimeData()->setData(QLatin1String("application/x-qt-mime-type-name"), QByteArray("dummy"));
@@ -145,6 +145,8 @@ Qt::DropAction QCocoaDrag::drag(QDrag *o)
source:m_lastView
slideBack:YES];
+ [nsimage release];
+
m_drag = 0;
return m_executed_drop_action;
}
diff --git a/src/plugins/platforms/cocoa/qcocoamenu.h b/src/plugins/platforms/cocoa/qcocoamenu.h
index 9100b9b15f..7224ee2ff8 100644
--- a/src/plugins/platforms/cocoa/qcocoamenu.h
+++ b/src/plugins/platforms/cocoa/qcocoamenu.h
@@ -49,6 +49,8 @@
QT_BEGIN_NAMESPACE
+class QCocoaMenuBar;
+
class QCocoaMenu : public QPlatformMenu
{
public:
@@ -87,6 +89,8 @@ public:
QList<QCocoaMenuItem *> items() const;
QList<QCocoaMenuItem *> merged() const;
+ void setMenuBar(QCocoaMenuBar *menuBar);
+ QCocoaMenuBar *menuBar() const;
private:
QCocoaMenuItem *itemOrNull(int index) const;
void insertNative(QCocoaMenuItem *item, QCocoaMenuItem *beforeItem);
@@ -97,6 +101,7 @@ private:
NSObject *m_delegate;
bool m_enabled;
quintptr m_tag;
+ QCocoaMenuBar *m_menuBar;
};
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm
index 08ae6c43bd..f6378d126f 100644
--- a/src/plugins/platforms/cocoa/qcocoamenu.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenu.mm
@@ -217,7 +217,8 @@ QT_BEGIN_NAMESPACE
QCocoaMenu::QCocoaMenu() :
m_enabled(true),
- m_tag(0)
+ m_tag(0),
+ m_menuBar(0)
{
m_delegate = [[QCocoaMenuDelegate alloc] initWithMenu:this];
m_nativeItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
@@ -536,4 +537,14 @@ void QCocoaMenu::syncModalState(bool modal)
}
}
+void QCocoaMenu::setMenuBar(QCocoaMenuBar *menuBar)
+{
+ m_menuBar = menuBar;
+}
+
+QCocoaMenuBar *QCocoaMenu::menuBar() const
+{
+ return m_menuBar;
+}
+
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.h b/src/plugins/platforms/cocoa/qcocoamenubar.h
index 8086676cc5..7a1bda74a4 100644
--- a/src/plugins/platforms/cocoa/qcocoamenubar.h
+++ b/src/plugins/platforms/cocoa/qcocoamenubar.h
@@ -75,6 +75,8 @@ private:
static QCocoaMenuBar *findGlobalMenubar();
bool shouldDisable(QCocoaWindow *active) const;
+ void insertNativeMenu(QCocoaMenu *menu, QCocoaMenu *beforeMenu);
+ void removeNativeMenu(QCocoaMenu *menu);
QList<QCocoaMenu*> m_menus;
NSMenu *m_nativeMenu;
diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.mm b/src/plugins/platforms/cocoa/qcocoamenubar.mm
index 315f192ff8..52bfdfa385 100644
--- a/src/plugins/platforms/cocoa/qcocoamenubar.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenubar.mm
@@ -83,9 +83,24 @@ QCocoaMenuBar::~QCocoaMenuBar()
}
}
-void QCocoaMenuBar::insertMenu(QPlatformMenu *platformMenu, QPlatformMenu *before)
+void QCocoaMenuBar::insertNativeMenu(QCocoaMenu *menu, QCocoaMenu *beforeMenu)
{
QCocoaAutoReleasePool pool;
+
+ if (beforeMenu) {
+ NSUInteger nativeIndex = [m_nativeMenu indexOfItem:beforeMenu->nsMenuItem()];
+ [m_nativeMenu insertItem: menu->nsMenuItem() atIndex: nativeIndex];
+ } else {
+ [m_nativeMenu addItem: menu->nsMenuItem()];
+ }
+
+ menu->setMenuBar(this);
+ syncMenu(static_cast<QPlatformMenu *>(menu));
+ [m_nativeMenu setSubmenu: menu->nsMenu() forItem: menu->nsMenuItem()];
+}
+
+void QCocoaMenuBar::insertMenu(QPlatformMenu *platformMenu, QPlatformMenu *before)
+{
QCocoaMenu *menu = static_cast<QCocoaMenu *>(platformMenu);
QCocoaMenu *beforeMenu = static_cast<QCocoaMenu *>(before);
#ifdef QT_COCOA_ENABLE_MENU_DEBUG
@@ -96,39 +111,36 @@ void QCocoaMenuBar::insertMenu(QPlatformMenu *platformMenu, QPlatformMenu *befor
qWarning() << Q_FUNC_INFO << "This menu already belongs to the menubar, remove it first";
return;
}
- if (beforeMenu) {
- if (!m_menus.contains(beforeMenu)) {
- qWarning() << Q_FUNC_INFO << "The before menu does not belong to the menubar";
- return;
- }
- m_menus.insert(m_menus.indexOf(beforeMenu), menu);
- NSUInteger nativeIndex = [m_nativeMenu indexOfItem:beforeMenu->nsMenuItem()];
- [m_nativeMenu insertItem: menu->nsMenuItem() atIndex: nativeIndex];
- } else {
- m_menus.append(menu);
- [m_nativeMenu addItem: menu->nsMenuItem()];
+
+ if (beforeMenu && !m_menus.contains(beforeMenu)) {
+ qWarning() << Q_FUNC_INFO << "The before menu does not belong to the menubar";
+ return;
}
- platformMenu->setParent(this);
- syncMenu(platformMenu);
- [m_nativeMenu setSubmenu: menu->nsMenu() forItem: menu->nsMenuItem()];
+ m_menus.insert(beforeMenu ? m_menus.indexOf(beforeMenu) : m_menus.size(), menu);
+ if (!menu->menuBar())
+ insertNativeMenu(menu, beforeMenu);
}
-void QCocoaMenuBar::removeMenu(QPlatformMenu *platformMenu)
+void QCocoaMenuBar::removeNativeMenu(QCocoaMenu *menu)
{
QCocoaAutoReleasePool pool;
+ if (menu->menuBar() == this)
+ menu->setMenuBar(0);
+ NSUInteger realIndex = [m_nativeMenu indexOfItem:menu->nsMenuItem()];
+ [m_nativeMenu removeItemAtIndex: realIndex];
+}
+
+void QCocoaMenuBar::removeMenu(QPlatformMenu *platformMenu)
+{
QCocoaMenu *menu = static_cast<QCocoaMenu *>(platformMenu);
if (!m_menus.contains(menu)) {
qWarning() << Q_FUNC_INFO << "Trying to remove a menu that does not belong to the menubar";
return;
}
m_menus.removeOne(menu);
-
- if (platformMenu->parent() == this)
- platformMenu->setParent(0);
- NSUInteger realIndex = [m_nativeMenu indexOfItem:menu->nsMenuItem()];
- [m_nativeMenu removeItemAtIndex: realIndex];
+ removeNativeMenu(menu);
}
void QCocoaMenuBar::syncMenu(QPlatformMenu *menu)
@@ -207,6 +219,20 @@ void QCocoaMenuBar::updateMenuBarImmediately()
m->syncModalState(disableForModal);
}
+ // reparent shared menu items if necessary.
+ // We browse the list in reverse order to be sure that the next items are redrawn before the current ones,
+ // in this way we are sure that "beforeMenu" (see below) is part of the native menu before "m" is redraw
+ for (int i = mb->m_menus.size() - 1; i >= 0; i--) {
+ QCocoaMenu *m = mb->m_menus.at(i);
+ QCocoaMenuBar *menuBar = m->menuBar();
+ if (menuBar != mb) {
+ QCocoaMenu *beforeMenu = i < (mb->m_menus.size() - 1) ? mb->m_menus.at(i + 1) : 0;
+ if (menuBar)
+ menuBar->removeNativeMenu(m);
+ mb->insertNativeMenu(m, beforeMenu);
+ }
+ }
+
QCocoaMenuLoader *loader = getMenuLoader();
[loader ensureAppMenuInMenu:mb->nsMenu()];
diff --git a/src/plugins/platforms/cocoa/qcocoatheme.mm b/src/plugins/platforms/cocoa/qcocoatheme.mm
index 31bbd63e36..5a5b2bc51f 100644
--- a/src/plugins/platforms/cocoa/qcocoatheme.mm
+++ b/src/plugins/platforms/cocoa/qcocoatheme.mm
@@ -283,7 +283,7 @@ QVariant QCocoaTheme::themeHint(ThemeHint hint) const
sizes << 16 << 32 << 64 << 128;
return QVariant::fromValue(sizes);
}
- case QPlatformTheme::PasswordMaskDelay:
+ case QPlatformTheme::PasswordMaskCharacter:
return QVariant(QChar(kBulletUnicode));
default:
break;
diff --git a/src/plugins/platforms/cocoa/qnsviewaccessibility.mm b/src/plugins/platforms/cocoa/qnsviewaccessibility.mm
index 6ebb1f6ba8..331a66417d 100644
--- a/src/plugins/platforms/cocoa/qnsviewaccessibility.mm
+++ b/src/plugins/platforms/cocoa/qnsviewaccessibility.mm
@@ -88,7 +88,7 @@
[element release];
}
- return kids;
+ return NSAccessibilityUnignoredChildren(kids);
} else {
return [super accessibilityAttributeValue:attribute];
}
diff --git a/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp b/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp
index 91a97ff977..c334f46c2c 100644
--- a/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp
+++ b/src/plugins/platforms/eglfs/qeglfshooks_stub.cpp
@@ -99,6 +99,7 @@ QSizeF QEglFSHooks::physicalScreenSize() const
struct fb_var_screeninfo vinfo;
int w = -1;
int h = -1;
+ QSize screenResolution;
if (framebuffer != -1) {
if (ioctl(framebuffer, FBIOGET_VSCREENINFO, &vinfo) == -1) {
@@ -106,12 +107,15 @@ QSizeF QEglFSHooks::physicalScreenSize() const
} else {
w = vinfo.width;
h = vinfo.height;
+ screenResolution = QSize(vinfo.xres, vinfo.yres);
}
+ } else {
+ screenResolution = screenSize();
}
const int defaultPhysicalDpi = 100;
- size.setWidth(w <= 0 ? vinfo.xres * Q_MM_PER_INCH / defaultPhysicalDpi : qreal(w));
- size.setHeight(h <= 0 ? vinfo.yres * Q_MM_PER_INCH / defaultPhysicalDpi : qreal(h));
+ size.setWidth(w <= 0 ? screenResolution.width() * Q_MM_PER_INCH / defaultPhysicalDpi : qreal(w));
+ size.setHeight(h <= 0 ? screenResolution.height() * Q_MM_PER_INCH / defaultPhysicalDpi : qreal(h));
if (w <= 0 || h <= 0) {
qWarning("EGLFS: Unable to query physical screen size, defaulting to %d dpi.\n"
diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp
index cd92a07f00..98c54e0ee0 100644
--- a/src/plugins/platforms/eglfs/qeglfswindow.cpp
+++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp
@@ -68,11 +68,11 @@ QEglFSWindow::~QEglFSWindow()
void QEglFSWindow::create()
{
- setWindowState(Qt::WindowFullScreen);
-
if (m_window)
return;
+ setWindowState(Qt::WindowFullScreen);
+
if (window()->type() == Qt::Desktop) {
QRect rect(QPoint(), QEglFSHooks::hooks()->screenSize());
QPlatformWindow::setGeometry(rect);
diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp
index f7fc5de8d7..cd79ae73fd 100644
--- a/src/plugins/platforms/qnx/qqnxwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxwindow.cpp
@@ -77,7 +77,7 @@ QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context)
#endif
m_screen(0),
m_parentWindow(0),
- m_visible(true),
+ m_visible(false),
m_windowState(Qt::WindowNoState),
m_requestedBufferSize(window->geometry().size())
{
@@ -153,7 +153,6 @@ QQnxWindow::QQnxWindow(QWindow *window, screen_context_t context)
if (window->parent() && window->parent()->handle())
setParent(window->parent()->handle());
setGeometryHelper(window->geometry());
- setVisible(window->isVisible());
}
QQnxWindow::~QQnxWindow()
@@ -272,6 +271,9 @@ void QQnxWindow::setVisible(bool visible)
{
qWindowDebug() << Q_FUNC_INFO << "window =" << window() << "visible =" << visible;
+ if (m_visible == visible)
+ return;
+
m_visible = visible;
QQnxWindow *root = this;
@@ -282,13 +284,13 @@ void QQnxWindow::setVisible(bool visible)
window()->requestActivate();
- if (window()->isTopLevel()) {
- QWindowSystemInterface::handleExposeEvent(window(), window()->geometry());
+ QWindowSystemInterface::handleExposeEvent(window(), window()->geometry());
- if (!visible) {
- // Flush the context, otherwise it won't disappear immediately
- screen_flush_context(m_screenContext, 0);
- }
+ if (visible) {
+ applyWindowState();
+ } else {
+ // Flush the context, otherwise it won't disappear immediately
+ screen_flush_context(m_screenContext, 0);
}
}
@@ -638,35 +640,10 @@ void QQnxWindow::setWindowState(Qt::WindowState state)
if (m_windowState == state)
return;
- switch (state) {
-
- // WindowActive is not an accepted parameter according to the docs
- case Qt::WindowActive:
- return;
-
- case Qt::WindowMinimized:
- minimize();
-
- if (m_unmaximizedGeometry.isValid())
- setGeometry(m_unmaximizedGeometry);
- else
- setGeometry(m_screen->geometry());
-
- break;
-
- case Qt::WindowMaximized:
- case Qt::WindowFullScreen:
- m_unmaximizedGeometry = geometry();
- setGeometry(state == Qt::WindowMaximized ? m_screen->availableGeometry() : m_screen->geometry());
- break;
-
- case Qt::WindowNoState:
- if (m_unmaximizedGeometry.isValid())
- setGeometry(m_unmaximizedGeometry);
- break;
- }
-
m_windowState = state;
+
+ if (m_visible)
+ applyWindowState();
}
void QQnxWindow::gainedFocus()
@@ -747,6 +724,37 @@ void QQnxWindow::updateZorder(int &topZorder)
childWindow->updateZorder(topZorder);
}
+void QQnxWindow::applyWindowState()
+{
+ switch (m_windowState) {
+
+ // WindowActive is not an accepted parameter according to the docs
+ case Qt::WindowActive:
+ return;
+
+ case Qt::WindowMinimized:
+ minimize();
+
+ if (m_unmaximizedGeometry.isValid())
+ setGeometry(m_unmaximizedGeometry);
+ else
+ setGeometry(m_screen->geometry());
+
+ break;
+
+ case Qt::WindowMaximized:
+ case Qt::WindowFullScreen:
+ m_unmaximizedGeometry = geometry();
+ setGeometry(m_windowState == Qt::WindowMaximized ? m_screen->availableGeometry() : m_screen->geometry());
+ break;
+
+ case Qt::WindowNoState:
+ if (m_unmaximizedGeometry.isValid())
+ setGeometry(m_unmaximizedGeometry);
+ break;
+ }
+}
+
void QQnxWindow::blitHelper(QQnxBuffer &source, QQnxBuffer &target, const QPoint &sourceOffset,
const QPoint &targetOffset, const QRegion &region, bool flush)
{
diff --git a/src/plugins/platforms/qnx/qqnxwindow.h b/src/plugins/platforms/qnx/qqnxwindow.h
index 4a327fd54b..63d5dc0979 100644
--- a/src/plugins/platforms/qnx/qqnxwindow.h
+++ b/src/plugins/platforms/qnx/qqnxwindow.h
@@ -124,6 +124,7 @@ private:
void setOffset(const QPoint &setOffset);
void updateVisibility(bool parentVisible);
void updateZorder(int &topZorder);
+ void applyWindowState();
void fetchBuffers();
diff --git a/src/plugins/platforms/windows/qplatformfunctions_wince.h b/src/plugins/platforms/windows/qplatformfunctions_wince.h
index 3190e39ec5..30fc66563e 100644
--- a/src/plugins/platforms/windows/qplatformfunctions_wince.h
+++ b/src/plugins/platforms/windows/qplatformfunctions_wince.h
@@ -74,6 +74,7 @@
#ifndef CWP_SKIPINVISIBLE
#define CWP_SKIPINVISIBLE 0x0001
+#define CWP_SKIPTRANSPARENT 0x0004
#define findPlatformWindowAt(a, b, c) findPlatformWindowAt(a, b)
#endif
diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp
index 814892b43a..fc2ba454df 100644
--- a/src/plugins/platforms/windows/qwindowsintegration.cpp
+++ b/src/plugins/platforms/windows/qwindowsintegration.cpp
@@ -433,6 +433,9 @@ QPlatformWindow *QWindowsIntegration::createPlatformWindow(QWindow *window) cons
return 0;
if (requested.flags != obtained.flags)
window->setFlags(obtained.flags);
+ // Trigger geometry change signals of QWindow.
+ if ((obtained.flags & Qt::Desktop) != Qt::Desktop && requested.geometry != obtained.geometry)
+ QWindowSystemInterface::handleGeometryChange(window, obtained.geometry);
return new QWindowsWindow(window, obtained);
}
diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.cpp b/src/plugins/platforms/windows/qwindowsmousehandler.cpp
index 5c096b7eca..c6cfa4dbbc 100644
--- a/src/plugins/platforms/windows/qwindowsmousehandler.cpp
+++ b/src/plugins/platforms/windows/qwindowsmousehandler.cpp
@@ -232,8 +232,10 @@ bool QWindowsMouseHandler::translateMouseEvent(QWindow *window, HWND hwnd,
}
const QPoint globalPosition = QWindowsGeometryHint::mapToGlobal(hwnd, winEventPosition);
+ // In this context, neither an invisible nor a transparent window (transparent regarding mouse
+ // events, "click-through") can be considered as the window under mouse.
QWindow *currentWindowUnderMouse = platformWindow->hasMouseCapture() ?
- QWindowsScreen::windowAt(globalPosition) : window;
+ QWindowsScreen::windowAt(globalPosition, CWP_SKIPINVISIBLE | CWP_SKIPTRANSPARENT) : window;
compressMouseMove(&msg);
// Qt expects the platform plugin to capture the mouse on
diff --git a/src/plugins/platforms/xcb/qxcbxsettings.cpp b/src/plugins/platforms/xcb/qxcbxsettings.cpp
index 7ffd3e105f..c106bd00f8 100644
--- a/src/plugins/platforms/xcb/qxcbxsettings.cpp
+++ b/src/plugins/platforms/xcb/qxcbxsettings.cpp
@@ -214,23 +214,37 @@ QXcbXSettings::QXcbXSettings(QXcbScreen *screen)
QByteArray settings_atom_for_screen("_XSETTINGS_S");
settings_atom_for_screen.append(QByteArray::number(screen->screenNumber()));
xcb_intern_atom_cookie_t atom_cookie = xcb_intern_atom(screen->xcb_connection(),
- false,
+ true,
settings_atom_for_screen.length(),
settings_atom_for_screen.constData());
- xcb_intern_atom_reply_t *atom_reply = xcb_intern_atom_reply(screen->xcb_connection(),atom_cookie,NULL);
+ xcb_generic_error_t *error = 0;
+ xcb_intern_atom_reply_t *atom_reply = xcb_intern_atom_reply(screen->xcb_connection(),atom_cookie,&error);
+ if (error) {
+ qWarning() << Q_FUNC_INFO << "Failed to find XSETTINGS_S atom";
+ return;
+ }
xcb_atom_t selection_owner_atom = atom_reply->atom;
free(atom_reply);
xcb_get_selection_owner_cookie_t selection_cookie =
xcb_get_selection_owner(screen->xcb_connection(), selection_owner_atom);
+
xcb_get_selection_owner_reply_t *selection_result =
- xcb_get_selection_owner_reply(screen->xcb_connection(), selection_cookie, NULL);
+ xcb_get_selection_owner_reply(screen->xcb_connection(), selection_cookie, &error);
+ if (error) {
+ qWarning() << Q_FUNC_INFO << "Failed to get selection owner for XSETTINGS_S atom";
+ return;
+ }
d_ptr->x_settings_window = selection_result->owner;
+ if (!d_ptr->x_settings_window) {
+ return;
+ }
free(selection_result);
+ const uint32_t event = XCB_CW_EVENT_MASK;
const uint32_t event_mask[] = { XCB_EVENT_MASK_STRUCTURE_NOTIFY|XCB_EVENT_MASK_PROPERTY_CHANGE };
- xcb_change_window_attributes(screen->xcb_connection(),d_ptr->x_settings_window,XCB_CW_EVENT_MASK,event_mask);
+ xcb_change_window_attributes(screen->xcb_connection(),d_ptr->x_settings_window,event,event_mask);
d_ptr->populateSettings(d_ptr->getSettings());
}