summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-02-12 13:53:21 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-02-12 13:53:22 +0100
commitd3b3be6865b78479da6c7e822b80064a6ea08554 (patch)
tree4843426950d1bc933ee8685c94f8905f20f3d678 /src/plugins/platforms
parent7472415f3f331ccd415cc644cc210d2457ef690c (diff)
parentfd88c152db0949e47613858a914a6ae4a825781d (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/cocoa/qcocoascreen.mm4
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.h1
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm16
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm8
-rw-r--r--src/plugins/platforms/cocoa/qnsview_mouse.mm66
-rw-r--r--src/plugins/platforms/windows/qwindowseglcontext.cpp10
-rw-r--r--src/plugins/platforms/winrt/qwinrtbackingstore.cpp7
-rw-r--r--src/plugins/platforms/winrt/qwinrteglcontext.cpp5
-rw-r--r--src/plugins/platforms/winrt/qwinrtinputcontext.cpp4
-rw-r--r--src/plugins/platforms/winrt/qwinrtinputcontext.h2
-rw-r--r--src/plugins/platforms/winrt/qwinrtscreen.cpp29
-rw-r--r--src/plugins/platforms/winrt/qwinrtscreen.h5
-rw-r--r--src/plugins/platforms/winrt/qwinrtwindow.cpp2
13 files changed, 73 insertions, 86 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoascreen.mm b/src/plugins/platforms/cocoa/qcocoascreen.mm
index afe14e623c..36c11ba8af 100644
--- a/src/plugins/platforms/cocoa/qcocoascreen.mm
+++ b/src/plugins/platforms/cocoa/qcocoascreen.mm
@@ -330,7 +330,7 @@ void QCocoaScreen::deliverUpdateRequests()
auto windows = QGuiApplication::allWindows();
for (int i = 0; i < windows.size(); ++i) {
QWindow *window = windows.at(i);
- QPlatformWindow *platformWindow = window->handle();
+ auto *platformWindow = static_cast<QCocoaWindow*>(window->handle());
if (!platformWindow)
continue;
@@ -341,7 +341,7 @@ void QCocoaScreen::deliverUpdateRequests()
continue;
// Skip windows that are not doing update requests via display link
- if (!(window->format().swapInterval() > 0))
+ if (!platformWindow->updatesWithDisplayLink())
continue;
platformWindow->deliverUpdateRequest();
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h
index 8f1bdb8af0..0a913ef66e 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.h
+++ b/src/plugins/platforms/cocoa/qcocoawindow.h
@@ -129,6 +129,7 @@ public:
bool isForeignWindow() const override;
void requestUpdate() override;
+ bool updatesWithDisplayLink() const;
void deliverUpdateRequest() override;
void requestActivateWindow() override;
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index beb17ec44e..bf0a1216be 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -1102,6 +1102,9 @@ void QCocoaWindow::setEmbeddedInForeignView()
void QCocoaWindow::viewDidChangeFrame()
{
+ if (isContentView())
+ return; // Handled below
+
handleGeometryChange();
}
@@ -1474,11 +1477,10 @@ void QCocoaWindow::recreateWindowIfNeeded()
void QCocoaWindow::requestUpdate()
{
- const int swapInterval = format().swapInterval();
- qCDebug(lcQpaDrawing) << "QCocoaWindow::requestUpdate" << window() << "swapInterval" << swapInterval;
+ qCDebug(lcQpaDrawing) << "QCocoaWindow::requestUpdate" << window()
+ << "using" << (updatesWithDisplayLink() ? "display-link" : "timer");
- if (swapInterval > 0) {
- // Vsync is enabled, deliver via CVDisplayLink
+ if (updatesWithDisplayLink()) {
static_cast<QCocoaScreen *>(screen())->requestUpdate();
} else {
// Fall back to the un-throttled timer-based callback
@@ -1486,6 +1488,12 @@ void QCocoaWindow::requestUpdate()
}
}
+bool QCocoaWindow::updatesWithDisplayLink() const
+{
+ // Update via CVDisplayLink if Vsync is enabled
+ return format().swapInterval() != 0;
+}
+
void QCocoaWindow::deliverUpdateRequest()
{
// Don't send update requests for views that need display, as the update
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 7f826942f3..17063f6e92 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -85,6 +85,7 @@
@end
@interface QT_MANGLE_NAMESPACE(QNSView) (Mouse)
+- (void)initMouse;
- (NSPoint)screenMousePoint:(NSEvent *)theEvent;
- (void)mouseMovedImpl:(NSEvent *)theEvent;
- (void)mouseEnteredImpl:(NSEvent *)theEvent;
@@ -114,7 +115,6 @@
@implementation QT_MANGLE_NAMESPACE(QNSView) {
QPointer<QCocoaWindow> m_platformWindow;
- NSTrackingArea *m_trackingArea;
Qt::MouseButtons m_buttons;
Qt::MouseButtons m_acceptedMouseDowns;
Qt::MouseButtons m_frameStrutButtons;
@@ -150,7 +150,6 @@
m_currentlyInterpretedKeyEvent = nil;
m_dontOverrideCtrlLMB = qt_mac_resolveOption(false, platformWindow->window(),
"_q_platform_MacDontOverrideCtrlLMB", "QT_MAC_DONT_OVERRIDE_CTRL_LMB");
- m_trackingArea = nil;
self.focusRingType = NSFocusRingTypeNone;
self.cursor = nil;
@@ -159,6 +158,7 @@
self.previousWindow = nil;
[self initDrawing];
+ [self initMouse];
[self registerDragTypes];
[[NSNotificationCenter defaultCenter] addObserver:self
@@ -173,10 +173,6 @@
{
qCDebug(lcQpaWindow) << "Deallocating" << self;
- if (m_trackingArea) {
- [self removeTrackingArea:m_trackingArea];
- [m_trackingArea release];
- }
[m_inputSource release];
[[NSNotificationCenter defaultCenter] removeObserver:self];
[m_mouseMoveHelper release];
diff --git a/src/plugins/platforms/cocoa/qnsview_mouse.mm b/src/plugins/platforms/cocoa/qnsview_mouse.mm
index 3d6471005d..49c94f18db 100644
--- a/src/plugins/platforms/cocoa/qnsview_mouse.mm
+++ b/src/plugins/platforms/cocoa/qnsview_mouse.mm
@@ -39,6 +39,22 @@
// This file is included from qnsview.mm, and only used to organize the code
+/*
+ The reason for using this helper is to ensure that QNSView doesn't implement
+ the NSResponder callbacks for mouseEntered, mouseExited, and mouseMoved.
+
+ If it did, we would get mouse events though the responder chain as well,
+ for example if a subview has a tracking area of its own and calls super
+ in the handler, which results in forwarding the event though the responder
+ chain. The same applies if NSWindow.acceptsMouseMovedEvents is YES.
+
+ By having a helper as the target for our tracking areas, we know for sure
+ that the events we are getting stem from our own tracking areas.
+
+ FIXME: Ideally we wouldn't need this workaround, and would correctly
+ interact with the responder chain by e.g. calling super if Qt does not
+ accept the mouse event
+*/
@implementation QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper) {
QNSView *view;
}
@@ -135,6 +151,28 @@
@implementation QT_MANGLE_NAMESPACE(QNSView) (Mouse)
+- (void)initMouse
+{
+ NSUInteger trackingOptions = NSTrackingActiveInActiveApp
+ | NSTrackingMouseEnteredAndExited | NSTrackingCursorUpdate;
+
+ // Ideally, NSTrackingMouseMoved should be turned on only if QWidget::mouseTracking
+ // is enabled, hover is on, or a tool tip is set. Unfortunately, Qt will send "tooltip"
+ // events on mouse moves, so we need to turn it on in ALL case. That means EVERY QWindow
+ // gets to pay the cost of mouse moves delivered to it (Apple recommends keeping it OFF
+ // because there is a performance hit).
+ trackingOptions |= NSTrackingMouseMoved;
+
+ // Using NSTrackingInVisibleRect means AppKit will automatically synchronize the
+ // tracking rect with changes in the view's visible area, so leave it undefined.
+ trackingOptions |= NSTrackingInVisibleRect;
+ static const NSRect trackingRect = NSZeroRect;
+
+ QMacAutoReleasePool pool;
+ [self addTrackingArea:[[[NSTrackingArea alloc] initWithRect:trackingRect
+ options:trackingOptions owner:m_mouseMoveHelper userInfo:nil] autorelease]];
+}
+
- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent
{
Q_UNUSED(theEvent)
@@ -406,35 +444,9 @@
[super otherMouseUp:theEvent];
}
-- (void)updateTrackingAreas
-{
- [super updateTrackingAreas];
-
- QMacAutoReleasePool pool;
-
- // NSTrackingInVisibleRect keeps care of updating once the tracking is set up, so bail out early
- if (m_trackingArea && [[self trackingAreas] containsObject:m_trackingArea])
- return;
-
- // Ideally, we shouldn't have NSTrackingMouseMoved events included below, it should
- // only be turned on if mouseTracking, hover is on or a tool tip is set.
- // Unfortunately, Qt will send "tooltip" events on mouse moves, so we need to
- // turn it on in ALL case. That means EVERY QWindow gets to pay the cost of
- // mouse moves delivered to it (Apple recommends keeping it OFF because there
- // is a performance hit). So it goes.
- NSUInteger trackingOptions = NSTrackingMouseEnteredAndExited | NSTrackingActiveInActiveApp
- | NSTrackingInVisibleRect | NSTrackingMouseMoved | NSTrackingCursorUpdate;
- [m_trackingArea release];
- m_trackingArea = [[NSTrackingArea alloc] initWithRect:[self frame]
- options:trackingOptions
- owner:m_mouseMoveHelper
- userInfo:nil];
- [self addTrackingArea:m_trackingArea];
-}
-
- (void)cursorUpdate:(NSEvent *)theEvent
{
- qCDebug(lcQpaMouse) << "[QNSView cursorUpdate:]" << self.cursor;
+ qCDebug(lcQpaMouse) << "Updating cursor for" << self << "to" << self.cursor;
// Note: We do not get this callback when moving from a subview that
// uses the legacy cursorRect API, so the cursor is reset to the arrow
diff --git a/src/plugins/platforms/windows/qwindowseglcontext.cpp b/src/plugins/platforms/windows/qwindowseglcontext.cpp
index 70ba2784e9..063e81150e 100644
--- a/src/plugins/platforms/windows/qwindowseglcontext.cpp
+++ b/src/plugins/platforms/windows/qwindowseglcontext.cpp
@@ -393,8 +393,14 @@ QWindowsEGLContext::QWindowsEGLContext(QWindowsEGLStaticContext *staticContext,
m_shareContext = share ? static_cast<QWindowsEGLContext *>(share)->m_eglContext : nullptr;
QVector<EGLint> contextAttrs;
- contextAttrs.append(EGL_CONTEXT_CLIENT_VERSION);
- contextAttrs.append(m_format.majorVersion());
+ const int major = m_format.majorVersion();
+ const int minor = m_format.minorVersion();
+ if (major > 3 || (major == 3 && minor > 0))
+ qWarning("QWindowsEGLContext: ANGLE only partially supports OpenGL ES > 3.0");
+ contextAttrs.append(EGL_CONTEXT_MAJOR_VERSION);
+ contextAttrs.append(major);
+ contextAttrs.append(EGL_CONTEXT_MINOR_VERSION);
+ contextAttrs.append(minor);
contextAttrs.append(EGL_NONE);
QWindowsEGLStaticContext::libEGL.eglBindAPI(m_api);
diff --git a/src/plugins/platforms/winrt/qwinrtbackingstore.cpp b/src/plugins/platforms/winrt/qwinrtbackingstore.cpp
index c23d48b2dd..fbf611d7f7 100644
--- a/src/plugins/platforms/winrt/qwinrtbackingstore.cpp
+++ b/src/plugins/platforms/winrt/qwinrtbackingstore.cpp
@@ -45,8 +45,7 @@
#include <QtGui/QOpenGLContext>
#include <QtGui/QOpenGLFramebufferObject>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
+#include <GLES3/gl3.h>
QT_BEGIN_NAMESPACE
@@ -83,7 +82,7 @@ bool QWinRTBackingStore::initialize()
return true;
d->context.reset(new QOpenGLContext);
- QSurfaceFormat format = window()->requestedFormat();
+ QSurfaceFormat format = window()->format();
d->context->setFormat(format);
d->context->setScreen(window()->screen());
if (!d->context->create())
@@ -138,7 +137,7 @@ void QWinRTBackingStore::flush(QWindow *window, const QRegion &region, const QPo
const int y2 = y1 + bounds.height();
const int x1 = bounds.x();
const int x2 = x1 + bounds.width();
- glBlitFramebufferANGLE(x1, y1, x2, y2,
+ glBlitFramebuffer(x1, y1, x2, y2,
x1, d->size.height() - y1, x2, d->size.height() - y2,
GL_COLOR_BUFFER_BIT, GL_NEAREST);
diff --git a/src/plugins/platforms/winrt/qwinrteglcontext.cpp b/src/plugins/platforms/winrt/qwinrteglcontext.cpp
index eeb79be2e6..aa64ac1f99 100644
--- a/src/plugins/platforms/winrt/qwinrteglcontext.cpp
+++ b/src/plugins/platforms/winrt/qwinrteglcontext.cpp
@@ -134,11 +134,14 @@ void QWinRTEGLContext::initialize()
const EGLint flags = d->format.testOption(QSurfaceFormat::DebugContext)
? EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR : 0;
+ const int major = d->format.majorVersion();
+ const int minor = d->format.minorVersion();
+ if (major > 3 || (major == 3 && minor > 0))
+ qWarning("QWinRTEGLContext: ANGLE only partially supports OpenGL ES > 3.0");
const EGLint attributes[] = {
EGL_CONTEXT_CLIENT_VERSION, d->format.majorVersion(),
EGL_CONTEXT_MINOR_VERSION_KHR, d->format.minorVersion(),
EGL_CONTEXT_FLAGS_KHR, flags,
- EGL_CONTEXT_OPENGL_NO_ERROR_KHR, true,
EGL_NONE
};
d->eglContext = eglCreateContext(g->eglDisplay, d->eglConfig, d->eglShareContext, attributes);
diff --git a/src/plugins/platforms/winrt/qwinrtinputcontext.cpp b/src/plugins/platforms/winrt/qwinrtinputcontext.cpp
index f7e91bb047..5ae94ba613 100644
--- a/src/plugins/platforms/winrt/qwinrtinputcontext.cpp
+++ b/src/plugins/platforms/winrt/qwinrtinputcontext.cpp
@@ -158,8 +158,6 @@ HRESULT QWinRTInputContext::handleVisibilityChange(IInputPane *pane)
return S_OK;
}
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
-
static HRESULT getInputPane(ComPtr<IInputPane2> *inputPane2)
{
ComPtr<IInputPaneStatics> factory;
@@ -221,6 +219,4 @@ void QWinRTInputContext::hideInputPanel()
});
}
-#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
-
QT_END_NAMESPACE
diff --git a/src/plugins/platforms/winrt/qwinrtinputcontext.h b/src/plugins/platforms/winrt/qwinrtinputcontext.h
index 13a0088ddc..59db90231f 100644
--- a/src/plugins/platforms/winrt/qwinrtinputcontext.h
+++ b/src/plugins/platforms/winrt/qwinrtinputcontext.h
@@ -74,10 +74,8 @@ public:
bool isInputPanelVisible() const override;
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
void showInputPanel() override;
void hideInputPanel() override;
-#endif
private slots:
void updateScreenCursorRect();
diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp
index bd2bbcb81c..7f1854c601 100644
--- a/src/plugins/platforms/winrt/qwinrtscreen.cpp
+++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp
@@ -91,13 +91,10 @@ typedef ITypedEventHandler<CoreWindow*, CharacterReceivedEventArgs*> CharacterRe
typedef ITypedEventHandler<CoreWindow*, InputEnabledEventArgs*> InputEnabledHandler;
typedef ITypedEventHandler<CoreWindow*, KeyEventArgs*> KeyHandler;
typedef ITypedEventHandler<CoreWindow*, PointerEventArgs*> PointerHandler;
-typedef ITypedEventHandler<CoreWindow*, WindowSizeChangedEventArgs*> SizeChangedHandler;
typedef ITypedEventHandler<CoreWindow*, VisibilityChangedEventArgs*> VisibilityChangedHandler;
typedef ITypedEventHandler<DisplayInformation*, IInspectable*> DisplayInformationHandler;
typedef ITypedEventHandler<ICorePointerRedirector*, PointerEventArgs*> RedirectHandler;
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
typedef ITypedEventHandler<ApplicationView*, IInspectable*> VisibleBoundsChangedHandler;
-#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
QT_BEGIN_NAMESPACE
@@ -479,10 +476,8 @@ typedef HRESULT (__stdcall IDisplayInformation::*DisplayCallbackRemover)(EventRe
uint qHash(DisplayCallbackRemover key) { void *ptr = *(void **)(&key); return qHash(ptr); }
typedef HRESULT (__stdcall ICorePointerRedirector::*RedirectorCallbackRemover)(EventRegistrationToken);
uint qHash(RedirectorCallbackRemover key) { void *ptr = *(void **)(&key); return qHash(ptr); }
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
typedef HRESULT (__stdcall IApplicationView2::*ApplicationView2CallbackRemover)(EventRegistrationToken);
uint qHash(ApplicationView2CallbackRemover key) { void *ptr = *(void **)(&key); return qHash(ptr); }
-#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
class QWinRTScreenPrivate
{
@@ -509,10 +504,8 @@ public:
QHash<CoreWindowCallbackRemover, EventRegistrationToken> windowTokens;
QHash<DisplayCallbackRemover, EventRegistrationToken> displayTokens;
QHash<RedirectorCallbackRemover, EventRegistrationToken> redirectTokens;
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
QHash<ApplicationView2CallbackRemover, EventRegistrationToken> view2Tokens;
ComPtr<IApplicationView2> view2;
-#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
QAtomicPointer<QWinRTWindow> mouseGrabWindow;
QAtomicPointer<QWinRTWindow> keyboardGrabWindow;
QWindow *currentPressWindow = nullptr;
@@ -603,10 +596,8 @@ QWinRTScreen::QWinRTScreen()
d->cursor.reset(new QWinRTCursor);
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
hr = d->view.As(&d->view2);
Q_ASSERT_SUCCEEDED(hr);
-#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
}
QWinRTScreen::~QWinRTScreen()
@@ -630,12 +621,10 @@ QWinRTScreen::~QWinRTScreen()
hr = (d->redirect.Get()->*i.key())(i.value());
Q_ASSERT_SUCCEEDED(hr);
}
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
for (QHash<ApplicationView2CallbackRemover, EventRegistrationToken>::const_iterator i = d->view2Tokens.begin(); i != d->view2Tokens.end(); ++i) {
hr = (d->view2.Get()->*i.key())(i.value());
Q_ASSERT_SUCCEEDED(hr);
}
-#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
return hr;
});
RETURN_VOID_IF_FAILED("Failed to unregister screen event callbacks");
@@ -777,14 +766,8 @@ void QWinRTScreen::initialize()
Q_ASSERT_SUCCEEDED(hr);
hr = d->coreWindow->add_PointerWheelChanged(Callback<PointerHandler>(this, &QWinRTScreen::onPointerUpdated).Get(), &d->windowTokens[&ICoreWindow::remove_PointerWheelChanged]);
Q_ASSERT_SUCCEEDED(hr);
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
hr = d->view2->add_VisibleBoundsChanged(Callback<VisibleBoundsChangedHandler>(this, &QWinRTScreen::onWindowSizeChanged).Get(), &d->view2Tokens[&IApplicationView2::remove_VisibleBoundsChanged]);
Q_ASSERT_SUCCEEDED(hr);
-#else
- hr = d->coreWindow->add_SizeChanged(Callback<SizeChangedHandler>(this, &QWinRTScreen::onWindowSizeChanged).Get(), &d->windowTokens[&ICoreWindow::remove_SizeChanged]);
- Q_ASSERT_SUCCEEDED(hr)
-#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
-
hr = d->coreWindow->add_Activated(Callback<ActivatedHandler>(this, &QWinRTScreen::onActivated).Get(), &d->windowTokens[&ICoreWindow::remove_Activated]);
Q_ASSERT_SUCCEEDED(hr);
hr = d->coreWindow->add_Closed(Callback<ClosedHandler>(this, &QWinRTScreen::onClosed).Get(), &d->windowTokens[&ICoreWindow::remove_Closed]);
@@ -820,7 +803,6 @@ void QWinRTScreen::setKeyboardRect(const QRectF &keyboardRect)
return;
}
d->logicalRect = QRectF(windowSize.X, windowSize.Y, windowSize.Width, windowSize.Height);
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
Rect visibleRect;
hr = d->view2->get_VisibleBounds(&visibleRect);
if (FAILED(hr)) {
@@ -828,9 +810,6 @@ void QWinRTScreen::setKeyboardRect(const QRectF &keyboardRect)
return;
}
visibleRectF = QRectF(visibleRect.X, visibleRect.Y, visibleRect.Width, visibleRect.Height);
-#else
- visibleRectF = d->logicalRect;
-#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
// if keyboard is snapped to the bottom of the screen and would cover the cursor the content is
// moved up to make it visible
if (keyboardRect.intersects(mCursorRect)
@@ -1528,11 +1507,7 @@ HRESULT QWinRTScreen::onRedirectReleased(ICorePointerRedirector *, IPointerEvent
return onPointerUpdated(nullptr, args);
}
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
HRESULT QWinRTScreen::onWindowSizeChanged(IApplicationView *, IInspectable *)
-#else
-HRESULT QWinRTScreen::onWindowSizeChanged(ICoreWindow *, IWindowSizeChangedEventArgs *)
-#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
{
Q_D(QWinRTScreen);
@@ -1543,14 +1518,10 @@ HRESULT QWinRTScreen::onWindowSizeChanged(ICoreWindow *, IWindowSizeChangedEvent
RETURN_OK_IF_FAILED("Failed to get window bounds");
d->logicalRect = QRectF(windowSize.X, windowSize.Y, windowSize.Width, windowSize.Height);
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
Rect visibleRect;
hr = d->view2->get_VisibleBounds(&visibleRect);
RETURN_OK_IF_FAILED("Failed to get window visible bounds");
d->visibleRect = QRectF(visibleRect.X, visibleRect.Y, visibleRect.Width, visibleRect.Height);
-#else
- d->visibleRect = QRectF(windowSize.X, windowSize.Y, windowSize.Width, windowSize.Height);
-#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
qCDebug(lcQpaWindows) << __FUNCTION__ << d->logicalRect;
QWindowSystemInterface::handleScreenGeometryChange(screen(), geometry(), availableGeometry());
diff --git a/src/plugins/platforms/winrt/qwinrtscreen.h b/src/plugins/platforms/winrt/qwinrtscreen.h
index cde148a638..e28cfd8cc8 100644
--- a/src/plugins/platforms/winrt/qwinrtscreen.h
+++ b/src/plugins/platforms/winrt/qwinrtscreen.h
@@ -59,7 +59,6 @@ namespace ABI {
struct IPointerEventArgs;
struct IVisibilityChangedEventArgs;
struct IWindowActivatedEventArgs;
- struct IWindowSizeChangedEventArgs;
}
namespace Xaml {
struct IDependencyObject;
@@ -154,11 +153,7 @@ private:
HRESULT onOrientationChanged(ABI::Windows::Graphics::Display::IDisplayInformation *, IInspectable *);
HRESULT onDpiChanged(ABI::Windows::Graphics::Display::IDisplayInformation *, IInspectable *);
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
HRESULT onWindowSizeChanged(ABI::Windows::UI::ViewManagement::IApplicationView *, IInspectable *);
-#else
- HRESULT onWindowSizeChanged(ABI::Windows::UI::Core::ICoreWindow *, ABI::Windows::UI::Core::IWindowSizeChangedEventArgs *);
-#endif
HRESULT onRedirectReleased(ABI::Windows::UI::Core::ICorePointerRedirector *, ABI::Windows::UI::Core::IPointerEventArgs *);
QScopedPointer<QWinRTScreenPrivate> d_ptr;
diff --git a/src/plugins/platforms/winrt/qwinrtwindow.cpp b/src/plugins/platforms/winrt/qwinrtwindow.cpp
index 29d234d276..83c3715bfd 100644
--- a/src/plugins/platforms/winrt/qwinrtwindow.cpp
+++ b/src/plugins/platforms/winrt/qwinrtwindow.cpp
@@ -112,6 +112,8 @@ QWinRTWindow::QWinRTWindow(QWindow *window)
d->screen = static_cast<QWinRTScreen *>(screen());
handleContentOrientationChange(window->contentOrientation());
+ d->surfaceFormat.setMajorVersion(3);
+ d->surfaceFormat.setMinorVersion(0);
d->surfaceFormat.setAlphaBufferSize(0);
d->surfaceFormat.setRedBufferSize(8);
d->surfaceFormat.setGreenBufferSize(8);