From 216da37cc55c38a9901501ecb04f768ff4e78d8f Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 18 Jul 2017 14:14:17 +0200 Subject: Windows QPA: Compare against correct geometry when checking for fullscreen Do not scale the QPlatformScreen's geometry. Fixes tst_QWidget::showFullScreen() when run with a scale factor. Change-Id: I4a2e743303ff70b01fd3d2086281a790737d2c1d Reviewed-by: Oliver Wolff --- src/plugins/platforms/windows/qwindowswindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 3a5baf40f0..97550cbcf6 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1763,7 +1763,7 @@ bool QWindowsWindow::isFullScreen_sys() const if (testFlag(HasBorderInFullScreen)) geometry += QMargins(1, 1, 1, 1); QPlatformScreen *screen = screenForGeometry(geometry); - return screen && geometry == QHighDpi::toNativePixels(screen->geometry(), screen); + return screen && geometry == screen->geometry(); } /*! -- cgit v1.2.3 From ea4fae0df689843fbcd6cf7f170d825557646ea2 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 17 Jul 2017 14:58:45 +0200 Subject: Windows QPA: Do not call enableNonClientDpiScaling() for embedded windows Do not call if the property indicating embedded windows is set. Task-number: QTBUG-61972 Change-Id: I8f34dd8a59f1e5c9c8064646bcb15acea115cd68 Reviewed-by: Oliver Wolff Reviewed-by: Joerg Bornemann --- src/plugins/platforms/windows/qwindowscontext.cpp | 4 +++- src/plugins/platforms/windows/qwindowswindow.cpp | 4 +++- src/plugins/platforms/windows/qwindowswindow.h | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 7115d074c9..9ab131808b 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -970,8 +970,10 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message, d->m_creationContext->obtainedGeometry.moveTo(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); return true; case QtWindows::NonClientCreate: - if (QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS10 && d->m_creationContext->window->isTopLevel()) + if (QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS10 && d->m_creationContext->window->isTopLevel() + && !d->m_creationContext->window->property(QWindowsWindow::embeddedNativeParentHandleProperty).isValid()) { enableNonClientDpiScaling(msg.hwnd); + } return false; case QtWindows::CalculateSize: return QWindowsGeometryHint::handleCalculateSize(d->m_creationContext->customMargins, msg, result); diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 97550cbcf6..3c79c8aefe 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -489,7 +489,7 @@ void WindowCreationData::fromWindow(const QWindow *w, const Qt::WindowFlags flag // Sometimes QWindow doesn't have a QWindow parent but does have a native parent window, // e.g. in case of embedded ActiveQt servers. They should not be considered a top-level // windows in such cases. - QVariant prop = w->property("_q_embedded_native_parent_handle"); + QVariant prop = w->property(QWindowsWindow::embeddedNativeParentHandleProperty); if (prop.isValid()) { embedded = true; parentHandle = reinterpret_cast(prop.value()); @@ -1035,6 +1035,8 @@ QWindowCreationContext::QWindowCreationContext(const QWindow *w, \ingroup qt-lighthouse-win */ +const char *QWindowsWindow::embeddedNativeParentHandleProperty = "_q_embedded_native_parent_handle"; + QWindowsWindow::QWindowsWindow(QWindow *aWindow, const QWindowsWindowData &data) : QWindowsBaseWindow(aWindow), m_data(data), diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h index e541b110a6..aa8ce7e73a 100644 --- a/src/plugins/platforms/windows/qwindowswindow.h +++ b/src/plugins/platforms/windows/qwindowswindow.h @@ -319,6 +319,8 @@ public: void setHasBorderInFullScreen(bool border); static QString formatWindowTitle(const QString &title); + static const char *embeddedNativeParentHandleProperty; + private: inline void show_sys() const; inline QWindowsWindowData setWindowFlags_sys(Qt::WindowFlags wt, unsigned flags = 0) const; -- cgit v1.2.3 From 13bceecc6bd3046772b2e662e08e0de3b37603a7 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 19 Jul 2017 11:02:05 +0200 Subject: Windows QPA: Fix local position reported for enter events Use QPlatformWindow::mapFromGlobal() instead of QWindow:::mapFromGlobal() as QPA operates in device pixels. Task-number: QTBUG-62028 Change-Id: I64ec4f4c9a536e122676d738db58805b98a45c82 Reviewed-by: Oliver Wolff --- src/plugins/platforms/windows/qwindowsmousehandler.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/windows/qwindowsmousehandler.cpp b/src/plugins/platforms/windows/qwindowsmousehandler.cpp index 34c34fd28e..d21581ba8a 100644 --- a/src/plugins/platforms/windows/qwindowsmousehandler.cpp +++ b/src/plugins/platforms/windows/qwindowsmousehandler.cpp @@ -387,12 +387,13 @@ bool QWindowsMouseHandler::translateMouseEvent(QWindow *window, HWND hwnd, && (!hasCapture || currentWindowUnderMouse == window)) || (m_previousCaptureWindow && window != m_previousCaptureWindow && currentWindowUnderMouse && currentWindowUnderMouse != m_previousCaptureWindow)) { + QPoint localPosition; qCDebug(lcQpaEvents) << "Entering " << currentWindowUnderMouse; - if (QWindowsWindow *wumPlatformWindow = QWindowsWindow::windowsWindowOf(currentWindowUnderMouse)) + if (QWindowsWindow *wumPlatformWindow = QWindowsWindow::windowsWindowOf(currentWindowUnderMouse)) { + localPosition = wumPlatformWindow->mapFromGlobal(globalPosition); wumPlatformWindow->applyCursor(); - QWindowSystemInterface::handleEnterEvent(currentWindowUnderMouse, - currentWindowUnderMouse->mapFromGlobal(globalPosition), - globalPosition); + } + QWindowSystemInterface::handleEnterEvent(currentWindowUnderMouse, localPosition, globalPosition); } // We need to track m_windowUnderMouse separately from m_trackedWindow, as // Windows mouse tracking will not trigger WM_MOUSELEAVE for leaving window when -- cgit v1.2.3 From e71f7d7736ec2c845206daa5a48921affbcf8e44 Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Wed, 19 Jul 2017 09:09:16 +0200 Subject: xcb: fix freeze when (un)plugging input devices .. in an application that has many native windows. We don't need to select XI_HierarchyChangedMask and XI_DeviceChangedMask for every window. It is enough to register one window for these events to update state of our X11 client (application). Furthermore, XIAllDevices and XIAllMasterDevices always apply, even if the device has been added after the client has selected for events. So there is no need to call XISelectEvents on XIAllDevices/XIAllMasterDevices again, if we are not updating event masks. With this patch and the test application from QTBUG-57013, removing/attaching a device takes few hundred milliseconds instead of 23-24 seconds. Task-number: QTBUG-57013 Change-Id: Ieb0b5ee25feef2922f901165825cb4a1289fc852 Reviewed-by: Allan Sandfeld Jensen --- src/plugins/platforms/xcb/qxcbconnection.h | 1 + src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 28 ++++++++++++++---------- 2 files changed, 18 insertions(+), 11 deletions(-) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/xcb/qxcbconnection.h b/src/plugins/platforms/xcb/qxcbconnection.h index bba987983e..1129090eca 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.h +++ b/src/plugins/platforms/xcb/qxcbconnection.h @@ -428,6 +428,7 @@ public: #if QT_CONFIG(xinput2) void xi2Select(xcb_window_t window); + void xi2SelectStateEvents(); #endif #ifdef XCB_USE_XINPUT21 bool isAtLeastXI21() const { return m_xi2Enabled && m_xi2Minor >= 1; } diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp index 4d2a83b3cf..38ea2d9ab9 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp @@ -90,12 +90,29 @@ void QXcbConnection::initializeXInput2() #else qCDebug(lcQpaXInputDevices, "XInput version %d.%d is available and Qt supports 2.0", xiMajor, m_xi2Minor); #endif + xi2SelectStateEvents(); } xi2SetupDevices(); } } +void QXcbConnection::xi2SelectStateEvents() +{ + // These state events do not depend on a specific X window, but are global + // for the X client's (application's) state. + unsigned int bitMask = 0; + unsigned char *xiBitMask = reinterpret_cast(&bitMask); + XIEventMask xiEventMask; + bitMask = XI_HierarchyChangedMask; + bitMask |= XI_DeviceChangedMask; + xiEventMask.deviceid = XIAllDevices; + xiEventMask.mask_len = sizeof(bitMask); + xiEventMask.mask = xiBitMask; + Display *dpy = static_cast(m_xlib_display); + XISelectEvents(dpy, DefaultRootWindow(dpy), &xiEventMask, 1); +} + void QXcbConnection::xi2SetupDevices() { #if QT_CONFIG(tabletevent) @@ -371,17 +388,6 @@ void QXcbConnection::xi2Select(xcb_window_t window) #else Q_UNUSED(xiBitMask); #endif - - { - // Listen for hotplug events - XIEventMask xiEventMask; - bitMask = XI_HierarchyChangedMask; - bitMask |= XI_DeviceChangedMask; - xiEventMask.deviceid = XIAllDevices; - xiEventMask.mask_len = sizeof(bitMask); - xiEventMask.mask = xiBitMask; - XISelectEvents(xDisplay, window, &xiEventMask, 1); - } } XInput2TouchDeviceData *QXcbConnection::touchDeviceForId(int id) -- cgit v1.2.3 From 82f701ed00546a01602413e90390388a1ec6dfbe Mon Sep 17 00:00:00 2001 From: James McDonnell Date: Wed, 10 May 2017 07:52:30 -0400 Subject: Skip EGL surface re-creation when the buffer size is unchanged Skip EGL surface re-creation when a sequence of unprocessed resizing requests leaves the buffer size unchanged. In this situation, the buffers won't be resized. Recreating the surface without resizing the buffers leads to screen providing incorrect information about the buffers. Change-Id: I1f75ab99eb1dffe0bcf9660bf014f047407b0c1b Reviewed-by: Rafael Roquetto --- src/plugins/platforms/qnx/qqnxeglwindow.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/qnx/qqnxeglwindow.cpp b/src/plugins/platforms/qnx/qqnxeglwindow.cpp index aa2e4db193..33ce0f924c 100644 --- a/src/plugins/platforms/qnx/qqnxeglwindow.cpp +++ b/src/plugins/platforms/qnx/qqnxeglwindow.cpp @@ -140,11 +140,17 @@ EGLSurface QQnxEglWindow::getSurface() if (m_newSurfaceRequested.testAndSetOrdered(true, false)) { const QMutexLocker locker(&m_mutex); //Set geomety must not reset the requestedBufferSize till //the surface is created - if (m_eglSurface != EGL_NO_SURFACE) { - platformOpenGLContext()->doneCurrent(); - destroyEGLSurface(); + + if ((m_requestedBufferSize != bufferSize()) || (m_eglSurface == EGL_NO_SURFACE)) { + if (m_eglSurface != EGL_NO_SURFACE) { + platformOpenGLContext()->doneCurrent(); + destroyEGLSurface(); + } + createEGLSurface(); + } else { + // Must've been a sequence of unprocessed changes returning us to the original size. + resetBuffers(); } - createEGLSurface(); } return m_eglSurface; -- cgit v1.2.3 From 922e410ebbf3b589385863b70e261e267968b9a4 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Wed, 19 Jul 2017 16:07:34 -0700 Subject: Fix 32-bit build on macOS Some customers still need this for interoperability with legacy code. Let's continue to keep it working in 5.9.x, and then move to 64-bit exclusive features (thus dropping 32-bit entirely) in 5.10. Task-number: QTBUG-58401 Change-Id: Ibb7200c1885e9caba70439df5f7c86c81b1312b5 Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoahelpers.h | 7 ++++++- src/plugins/platforms/cocoa/qcocoahelpers.mm | 5 +++++ src/plugins/platforms/cocoa/qnswindowdelegate.mm | 4 ++-- 3 files changed, 13 insertions(+), 3 deletions(-) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.h b/src/plugins/platforms/cocoa/qcocoahelpers.h index a2e0876073..4478895538 100644 --- a/src/plugins/platforms/cocoa/qcocoahelpers.h +++ b/src/plugins/platforms/cocoa/qcocoahelpers.h @@ -167,7 +167,12 @@ QT_END_NAMESPACE - (void)onCancelClicked; @end -@interface QT_MANGLE_NAMESPACE(QNSPanelContentsWrapper) : NSView +@interface QT_MANGLE_NAMESPACE(QNSPanelContentsWrapper) : NSView { + NSButton *_okButton; + NSButton *_cancelButton; + NSView *_panelContents; + NSEdgeInsets _panelContentsMargins; +} @property (nonatomic, readonly) NSButton *okButton; @property (nonatomic, readonly) NSButton *cancelButton; diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm index 232e40769b..5d0f13c5a9 100644 --- a/src/plugins/platforms/cocoa/qcocoahelpers.mm +++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm @@ -303,6 +303,11 @@ QT_END_NAMESPACE */ @implementation QNSPanelContentsWrapper +@synthesize okButton = _okButton; +@synthesize cancelButton = _cancelButton; +@synthesize panelContents = _panelContents; +@synthesize panelContentsMargins = _panelContentsMargins; + - (instancetype)initWithPanelDelegate:(id)panelDelegate { if ((self = [super initWithFrame:NSZeroRect])) { diff --git a/src/plugins/platforms/cocoa/qnswindowdelegate.mm b/src/plugins/platforms/cocoa/qnswindowdelegate.mm index 8295d4a36c..1224d138d9 100644 --- a/src/plugins/platforms/cocoa/qnswindowdelegate.mm +++ b/src/plugins/platforms/cocoa/qnswindowdelegate.mm @@ -75,7 +75,7 @@ // window.screen.visibleFrame directly, as that ensures we have the same // behavior for both use-cases/APIs. Q_ASSERT(window == m_cocoaWindow->nativeWindow()); - return m_cocoaWindow->screen()->availableGeometry().toCGRect(); + return NSRectFromCGRect(m_cocoaWindow->screen()->availableGeometry().toCGRect()); } #if QT_MACOS_DEPLOYMENT_TARGET_BELOW(__MAC_10_11) @@ -90,7 +90,7 @@ { Q_UNUSED(proposedSize); Q_ASSERT(window == m_cocoaWindow->nativeWindow()); - return m_cocoaWindow->screen()->geometry().size().toCGSize(); + return NSSizeFromCGSize(m_cocoaWindow->screen()->geometry().size().toCGSize()); } #endif -- cgit v1.2.3 From a493170a94907242360584890c4158ed38b394b1 Mon Sep 17 00:00:00 2001 From: Jesus Fernandez Date: Tue, 25 Jul 2017 13:42:50 +0200 Subject: Fix memory leak CID 10994 (#1 of 1): Resource leak in object (CTOR_DTOR_LEAK) The font database was not destroyed in the destructor. Coverity-Id: 10994 Change-Id: Ibd4cb0b65d1e554593295a3654e8d8c946551cc2 Reviewed-by: Laszlo Agocs Reviewed-by: Jesus Fernandez --- src/plugins/platforms/minimalegl/qminimaleglintegration.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp b/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp index 81512b1561..a716a6092a 100644 --- a/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp +++ b/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp @@ -100,6 +100,7 @@ QMinimalEglIntegration::QMinimalEglIntegration() QMinimalEglIntegration::~QMinimalEglIntegration() { destroyScreen(mScreen); + delete mFontDb; } bool QMinimalEglIntegration::hasCapability(QPlatformIntegration::Capability cap) const -- cgit v1.2.3 From 50275fbcaf60ed41bd4486f8239cc7914c8af0f5 Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Wed, 26 Jul 2017 21:20:50 +1000 Subject: Use correct DRM event context version Explicitly declare which DRM event context version we want to use, rather than just the latest one libdrm supports. New versions may change semantics, or extend the structure, in ways we're unaware of. Stick with version 2, which is the version that introduced page_flip_handler. Change-Id: I1d2066d5ab485ea571f016a8660829f435821c82 Reviewed-by: Simon Hausmann Reviewed-by: Oswald Buddenhagen Reviewed-by: Laszlo Agocs --- .../platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.cpp | 2 +- src/plugins/platforms/linuxfb/qlinuxfbdrmscreen.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.cpp index 5f85e4b0b0..e218d580a2 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.cpp +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmdevice.cpp @@ -142,7 +142,7 @@ void QEglFSKmsGbmDevice::handleDrmEvent() { drmEventContext drmEvent; memset(&drmEvent, 0, sizeof(drmEvent)); - drmEvent.version = DRM_EVENT_CONTEXT_VERSION; + drmEvent.version = 2; drmEvent.vblank_handler = nullptr; drmEvent.page_flip_handler = pageFlipHandler; diff --git a/src/plugins/platforms/linuxfb/qlinuxfbdrmscreen.cpp b/src/plugins/platforms/linuxfb/qlinuxfbdrmscreen.cpp index c9fbb8281c..e15d6fee24 100644 --- a/src/plugins/platforms/linuxfb/qlinuxfbdrmscreen.cpp +++ b/src/plugins/platforms/linuxfb/qlinuxfbdrmscreen.cpp @@ -314,7 +314,7 @@ void QLinuxFbDevice::swapBuffers(Output *output) while (output->backFb == fbIdx) { drmEventContext drmEvent; memset(&drmEvent, 0, sizeof(drmEvent)); - drmEvent.version = DRM_EVENT_CONTEXT_VERSION; + drmEvent.version = 2; drmEvent.vblank_handler = nullptr; drmEvent.page_flip_handler = pageFlipHandler; // Blocks until there is something to read on the drm fd -- cgit v1.2.3 From 0fcc7ea02a327219ae4b870079221cd962ae03f7 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Wed, 26 Jul 2017 13:54:14 +0200 Subject: winrt: Fix platform theme for non-phone devices When running on a desktop machine (using Windws SDK 10.0.14393) the palette had fully transparent text colors which were assigned in the "phone only" part of the theme's initialization. By checking the API contract we can avoid that part of the initialization and thus return proper values. Change-Id: Id770a686c1c7e447a9594830fd7670352116eb21 Reviewed-by: Maurice Kalinowski --- src/plugins/platforms/winrt/qwinrttheme.cpp | 37 +++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 5 deletions(-) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/winrt/qwinrttheme.cpp b/src/plugins/platforms/winrt/qwinrttheme.cpp index 5696ae7a10..283825a880 100644 --- a/src/plugins/platforms/winrt/qwinrttheme.cpp +++ b/src/plugins/platforms/winrt/qwinrttheme.cpp @@ -61,6 +61,26 @@ QT_BEGIN_NAMESPACE Q_LOGGING_CATEGORY(lcQpaTheme, "qt.qpa.theme") +class QWinRTApiInformationHandler { +public: + QWinRTApiInformationHandler() + { + HRESULT hr; + hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Foundation_Metadata_ApiInformation).Get(), + IID_PPV_ARGS(&m_apiInformationStatics)); + Q_ASSERT_SUCCEEDED(hr); + } + + ComPtr apiInformationStatics() const + { + return m_apiInformationStatics; + } + +private: + ComPtr m_apiInformationStatics; +}; +Q_GLOBAL_STATIC(QWinRTApiInformationHandler, gApiHandler); + static IUISettings *uiSettings() { static ComPtr settings; @@ -86,17 +106,16 @@ static inline QColor fromColor(const Color &color) static bool uiColorSettings(const wchar_t *value, UIElementType type, Color *color) { - static ComPtr apiInformationStatics; - HRESULT hr; + ComPtr apiInformationStatics = gApiHandler->apiInformationStatics(); if (!apiInformationStatics) { - hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Foundation_Metadata_ApiInformation).Get(), - IID_PPV_ARGS(&apiInformationStatics)); - RETURN_FALSE_IF_FAILED("Could not get ApiInformationStatics"); + qErrnoWarning("Could not get ApiInformationStatics"); + return false; } static const HStringReference enumRef(L"Windows.UI.ViewManagement.UIElementType"); HStringReference valueRef(value); + HRESULT hr; boolean exists; hr = apiInformationStatics->IsEnumNamedValuePresent(enumRef.Get(), valueRef.Get(), &exists); @@ -149,6 +168,14 @@ static void nativeColorSettings(QPalette &p) // Starting with SDK 15063 those have been removed. #ifndef QT_WINRT_DISABLE_PHONE_COLORS //Phone related + ComPtr apiInformationStatics = gApiHandler->apiInformationStatics(); + boolean phoneApiPresent = false; + HRESULT hr; + HStringReference phoneRef(L"Windows.Phone.PhoneContract"); + hr = apiInformationStatics.Get()->IsApiContractPresentByMajor(phoneRef.Get(), 1, &phoneApiPresent); + if (FAILED(hr) || !phoneApiPresent) + return; + if (uiColorSettings(L"PopupBackground", UIElementType_PopupBackground, &color)) { p.setColor(QPalette::ToolTipBase, fromColor(color)); p.setColor(QPalette::AlternateBase, fromColor(color)); -- cgit v1.2.3 From 286c53f217d5a8d634cb2b8c08d2c5a3db67158b Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 12 Jun 2017 13:33:46 +0200 Subject: Fix composition on xcb with misconfigured ibus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If ibus has been set, but either isn't installed or doesn't launch, all composition fails on xcb. This ensures we fallback to "compose" which is needed for working composition on XCB. Change-Id: Ic2061c330bcb907759a13920c3eede14f3036563 Reviewed-by: René J.V. Bertin Reviewed-by: Thiago Macieira --- src/plugins/platforms/xcb/qxcbintegration.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 859b55b0d8..b372ecd7c4 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -289,12 +289,15 @@ QAbstractEventDispatcher *QXcbIntegration::createEventDispatcher() const void QXcbIntegration::initialize() { + const QLatin1String defaultInputContext("compose"); // Perform everything that may potentially need the event dispatcher (timers, socket // notifiers) here instead of the constructor. QString icStr = QPlatformInputContextFactory::requested(); if (icStr.isNull()) - icStr = QLatin1String("compose"); + icStr = defaultInputContext; m_inputContext.reset(QPlatformInputContextFactory::create(icStr)); + if (!m_inputContext && icStr != defaultInputContext && icStr != QLatin1String("none")) + m_inputContext.reset(QPlatformInputContextFactory::create(defaultInputContext)); } void QXcbIntegration::moveToScreen(QWindow *window, int screen) -- cgit v1.2.3