summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-01-16 01:22:45 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-01-16 01:22:45 +0100
commit7075e291998612a3c0a530bb37a515dd07739e28 (patch)
tree4e1992498d82ee3f6f92fd6d42754c92928dd581 /src/plugins
parent1161a8a62907796ea45b1877bec31e66aeef77f6 (diff)
parent3d9a40038f01bc2a3df0027a9be04e7fa3ce3850 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/widgets/styles/qstyleanimation.cpp Change-Id: Iae570895be6544de80f9c1ec309d1a08c59daff8
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/accessible/widgets/itemviews.cpp2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibility.mm3
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm12
-rw-r--r--src/plugins/platforms/cocoa/qnsviewaccessibility.mm7
-rw-r--r--src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp2
-rw-r--r--src/plugins/platforms/qnx/qqnxwindow.cpp10
-rw-r--r--src/plugins/platforms/windows/qwindowsbackingstore.cpp16
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp17
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.h1
-rw-r--r--src/plugins/platforms/xcb/qxcbbackingstore.cpp4
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp5
12 files changed, 57 insertions, 24 deletions
diff --git a/src/plugins/accessible/widgets/itemviews.cpp b/src/plugins/accessible/widgets/itemviews.cpp
index 92ba03753a..816970aeb0 100644
--- a/src/plugins/accessible/widgets/itemviews.cpp
+++ b/src/plugins/accessible/widgets/itemviews.cpp
@@ -575,7 +575,7 @@ int QAccessibleTree::childCount() const
QAccessibleInterface *QAccessibleTree::child(int index) const
{
- if ((index < 0) || (!view()->model()))
+ if (index < 0 || !view()->model() || !view()->model()->columnCount())
return 0;
int hHeader = horizontalHeader() ? 1 : 0;
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibility.mm b/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
index e643f22793..0587da706a 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibility.mm
@@ -71,7 +71,8 @@ void QCococaAccessibility::notifyAccessibilityUpdate(QAccessibleEvent *event)
case QAccessible::TextInserted :
case QAccessible::TextRemoved :
case QAccessible::TextUpdated : {
- QCocoaAccessibleElement *element = [QCocoaAccessibleElement elementWithInterface : interface parent : nil];
+ QCocoaAccessibleElement *element = [QCocoaAccessibleElement createElementWithInterface : interface parent : nil];
+ [element autorelease];
NSAccessibilityPostNotification(element, NSAccessibilityValueChangedNotification);
break; }
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h
index fce72da98f..eb810522d7 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h
@@ -56,7 +56,7 @@
}
- (id)initWithInterface:(void *)anQAccessibleInterface parent:(id)aParent;
-+ (QCocoaAccessibleElement *)elementWithInterface:(void *)anQAccessibleInterface parent:(id)aParent;
++ (QCocoaAccessibleElement *)createElementWithInterface:(void *)anQAccessibleInterface parent:(id)aParent;
@end
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
index d5841c1983..7c9ae963f6 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
@@ -68,9 +68,9 @@ static QAccessibleInterface *acast(void *ptr)
return self;
}
-+ (QCocoaAccessibleElement *)elementWithInterface:(void *)anQAccessibleInterface parent:(id)aParent
++ (QCocoaAccessibleElement *)createElementWithInterface:(void *)anQAccessibleInterface parent:(id)aParent
{
- return [[[self alloc] initWithInterface:anQAccessibleInterface parent:aParent] autorelease];
+ return [[self alloc] initWithInterface:anQAccessibleInterface parent:aParent];
}
- (void)dealloc {
@@ -136,7 +136,9 @@ static QAccessibleInterface *acast(void *ptr)
NSMutableArray *kids = [NSMutableArray arrayWithCapacity:numKids];
for (int i = 0; i < numKids; ++i) {
QAccessibleInterface *childInterface = acast(accessibleInterface)->child(i);
- [kids addObject:[QCocoaAccessibleElement elementWithInterface:(void*)childInterface parent:self]];
+ QCocoaAccessibleElement *element = [QCocoaAccessibleElement createElementWithInterface:(void*)childInterface parent:self];
+ [kids addObject: element];
+ [element release];
}
return kids;
@@ -251,7 +253,9 @@ static QAccessibleInterface *acast(void *ptr)
}
// hit a child, forward to child accessible interface.
- QCocoaAccessibleElement *accessibleElement = [QCocoaAccessibleElement elementWithInterface:childInterface parent:self];
+ QCocoaAccessibleElement *accessibleElement = [QCocoaAccessibleElement createElementWithInterface:childInterface parent:self];
+ [accessibleElement autorelease];
+
return [accessibleElement accessibilityHitTest:point];
}
diff --git a/src/plugins/platforms/cocoa/qnsviewaccessibility.mm b/src/plugins/platforms/cocoa/qnsviewaccessibility.mm
index da714d3326..9b94abf115 100644
--- a/src/plugins/platforms/cocoa/qnsviewaccessibility.mm
+++ b/src/plugins/platforms/cocoa/qnsviewaccessibility.mm
@@ -77,7 +77,9 @@
int numKids = m_accessibleRoot->childCount();
NSMutableArray *kids = [NSMutableArray arrayWithCapacity:numKids];
for (int i = 0; i < numKids; ++i) {
- [kids addObject:[QCocoaAccessibleElement elementWithInterface: m_accessibleRoot->child(i) parent:self ]];
+ QCocoaAccessibleElement *element = [QCocoaAccessibleElement createElementWithInterface: m_accessibleRoot->child(i) parent:self ];
+ [kids addObject: element];
+ [element release];
}
return kids;
@@ -98,7 +100,8 @@
// Hit a child, forward to child accessible interface.
- QCocoaAccessibleElement *accessibleElement = [QCocoaAccessibleElement elementWithInterface: childInterface parent:self ];
+ QCocoaAccessibleElement *accessibleElement = [QCocoaAccessibleElement createElementWithInterface: childInterface parent:self ];
+ [accessibleElement autorelease];
return [accessibleElement accessibilityHitTest:point];
}
diff --git a/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp b/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp
index 1dac60a745..4d170f15f2 100644
--- a/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp
+++ b/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp
@@ -264,7 +264,7 @@ static int openTtyDevice(const QString &device)
static bool switchToGraphicsMode(int ttyfd, int *oldMode)
{
- ioctl(ttyfd, KDGETMODE, &oldMode);
+ ioctl(ttyfd, KDGETMODE, oldMode);
if (*oldMode != KD_GRAPHICS) {
if (ioctl(ttyfd, KDSETMODE, KD_GRAPHICS) != 0)
return false;
diff --git a/src/plugins/platforms/qnx/qqnxwindow.cpp b/src/plugins/platforms/qnx/qqnxwindow.cpp
index af7a89a399..2cee666e23 100644
--- a/src/plugins/platforms/qnx/qqnxwindow.cpp
+++ b/src/plugins/platforms/qnx/qqnxwindow.cpp
@@ -271,8 +271,14 @@ void QQnxWindow::setVisible(bool visible)
window()->requestActivate();
- if (window()->isTopLevel() && visible)
- QWindowSystemInterface::handleExposeEvent(window(), window()->geometry());
+ if (window()->isTopLevel()) {
+ if (visible) {
+ QWindowSystemInterface::handleExposeEvent(window(), window()->geometry());
+ } else {
+ // Flush the context, otherwise it won't disappear immediately
+ screen_flush_context(m_screenContext, 0);
+ }
+ }
}
void QQnxWindow::updateVisibility(bool parentVisible)
diff --git a/src/plugins/platforms/windows/qwindowsbackingstore.cpp b/src/plugins/platforms/windows/qwindowsbackingstore.cpp
index b7937b4d84..5d3822d2cd 100644
--- a/src/plugins/platforms/windows/qwindowsbackingstore.cpp
+++ b/src/plugins/platforms/windows/qwindowsbackingstore.cpp
@@ -45,6 +45,7 @@
#include "qwindowscontext.h"
#include <QtGui/QWindow>
+#include <QtGui/QPainter>
#include <QtCore/QDebug>
@@ -147,8 +148,10 @@ void QWindowsBackingStore::resize(const QSize &size, const QRegion &region)
nsp << " from: " << m_image->image().size();
}
#endif
- m_image.reset(new QWindowsNativeImage(size.width(), size.height(),
- QWindowsNativeImage::systemFormat()));
+ QImage::Format format = QWindowsNativeImage::systemFormat();
+ if (format == QImage::Format_RGB32 && rasterWindow()->window()->format().hasAlpha())
+ format = QImage::Format_ARGB32;
+ m_image.reset(new QWindowsNativeImage(size.width(), size.height(), format));
}
}
@@ -168,9 +171,16 @@ bool QWindowsBackingStore::scroll(const QRegion &area, int dx, int dy)
void QWindowsBackingStore::beginPaint(const QRegion &region)
{
- Q_UNUSED(region);
if (QWindowsContext::verboseBackingStore > 1)
qDebug() << __FUNCTION__;
+
+ if (m_image->image().hasAlphaChannel()) {
+ QPainter p(&m_image->image());
+ p.setCompositionMode(QPainter::CompositionMode_Source);
+ const QColor blank = Qt::transparent;
+ foreach (const QRect &r, region.rects())
+ p.fillRect(r, blank);
+ }
}
QWindowsWindow *QWindowsBackingStore::rasterWindow() const
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 50fd7a0792..23ebd6bd9e 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -267,7 +267,7 @@ static void setWindowOpacity(HWND hwnd, Qt::WindowFlags flags, qreal level)
struct WindowCreationData
{
typedef QWindowsWindow::WindowData WindowData;
- enum Flags { ForceChild = 0x1 };
+ enum Flags { ForceChild = 0x1, ForceTopLevel = 0x2 };
WindowCreationData() : parentHandle(0), type(Qt::Widget), style(0), exStyle(0),
topLevel(false), popup(false), dialog(false), desktop(false),
@@ -319,7 +319,13 @@ void WindowCreationData::fromWindow(const QWindow *w, const Qt::WindowFlags flag
parentHandle = (HWND)prop.value<WId>();
}
- topLevel = ((creationFlags & ForceChild) || embedded) ? false : w->isTopLevel();
+ if (creationFlags & ForceChild) {
+ topLevel = false;
+ } else if (creationFlags & ForceTopLevel) {
+ topLevel = true;
+ } else {
+ topLevel = w->isTopLevel();
+ }
if (topLevel && flags == 1) {
flags |= Qt::WindowTitleHint|Qt::WindowSystemMenuHint|Qt::WindowMinimizeButtonHint
@@ -1022,10 +1028,9 @@ void QWindowsWindow::setParent_sys(const QPlatformWindow *parent) const
// WS_CHILD/WS_POPUP must be manually set/cleared in addition
// to dialog frames, etc (see SetParent() ) if the top level state changes.
- if (wasTopLevel != isTopLevel) {
- const unsigned flags = isTopLevel ? unsigned(0) : unsigned(WindowCreationData::ForceChild);
- setWindowFlags_sys(window()->flags(), flags);
- }
+ // Force toplevel state as QWindow::isTopLevel cannot be relied upon here.
+ if (wasTopLevel != isTopLevel)
+ setWindowFlags_sys(window()->flags(), unsigned(isTopLevel ? WindowCreationData::ForceTopLevel : WindowCreationData::ForceChild));
}
}
diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h
index 4e82938cf4..f98855d84d 100644
--- a/src/plugins/platforms/windows/qwindowswindow.h
+++ b/src/plugins/platforms/windows/qwindowswindow.h
@@ -158,6 +158,7 @@ public:
virtual void setVisible(bool visible);
bool isVisible() const;
+ virtual bool isExposed() const { return m_windowState != Qt::WindowMinimized && isVisible(); }
virtual bool isActive() const;
virtual bool isEmbedded(const QPlatformWindow *parentWindow) const;
virtual QPoint mapToGlobal(const QPoint &pos) const;
diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
index 649469ab9d..c953ab0049 100644
--- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp
+++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp
@@ -107,7 +107,7 @@ QXcbShmImage::QXcbShmImage(QXcbScreen *screen, const QSize &size, uint depth, QI
if (!segmentSize)
return;
- int id = shmget(IPC_PRIVATE, segmentSize, IPC_CREAT | 0777);
+ int id = shmget(IPC_PRIVATE, segmentSize, IPC_CREAT | 0600);
if (id == -1)
qWarning("QXcbShmImage: shmget() failed (%d) for size %d (%dx%d)",
errno, segmentSize, size.width(), size.height());
@@ -272,7 +272,6 @@ void QXcbBackingStore::beginPaint(const QRegion &region)
m_image->preparePaint(region);
-#if 0
if (m_image->image()->hasAlphaChannel()) {
QPainter p(m_image->image());
p.setCompositionMode(QPainter::CompositionMode_Source);
@@ -282,7 +281,6 @@ void QXcbBackingStore::beginPaint(const QRegion &region)
p.fillRect(*it, blank);
}
}
-#endif
}
void QXcbBackingStore::endPaint(const QRegion &)
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 528c4c6580..01f4d6d231 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -382,6 +382,11 @@ void QXcbWindow::create()
if (window()->flags() & Qt::WindowTransparentForInput)
setTransparentForMouseEvents(true);
+#ifdef XCB_USE_XLIB
+ // force sync to read outstanding requests - see QTBUG-29106
+ XSync(DISPLAY_FROM_XCB(m_screen), false);
+#endif
+
#ifndef QT_NO_DRAGANDDROP
connection()->drag()->dndEnable(this, true);
#endif