From 8a075c405709eab9c08ed4230d795ca45eabd5a7 Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Fri, 12 Dec 2014 14:37:36 +0300 Subject: xcb: Don't return 0 from QXcbKeyboard::possibleKeys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's possible to get 0 for baseQtKey in case Caps Lock is used as a layout switcher. So don't include this value in the result. Similar fix was in commit d904533acba1267431ca2c5f0d3e85cc59a20a26. Task-number: QTCREATORBUG-9589 Change-Id: I46fc91f9faf6fd0699f062a72fd2ca3187232f5a Reviewed-by: Jørgen Lind --- src/plugins/platforms/xcb/qxcbkeyboard.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp index 260fb46309..5fb745717b 100644 --- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp +++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp @@ -957,7 +957,8 @@ QList QXcbKeyboard::possibleKeys(const QKeyEvent *event) const QList result; int baseQtKey = keysymToQtKey(sym, modifiers, lookupString(kb_state, keycode)); - result += (baseQtKey + modifiers); // The base key is _always_ valid, of course + if (baseQtKey) + result += (baseQtKey + modifiers); xkb_mod_index_t shiftMod = xkb_keymap_mod_get_index(xkb_keymap, "Shift"); xkb_mod_index_t altMod = xkb_keymap_mod_get_index(xkb_keymap, "Alt"); -- cgit v1.2.3 From 627afca13cf1b23489a1c61d1eb66cbdafff91bd Mon Sep 17 00:00:00 2001 From: Roger Maclean Date: Mon, 15 Dec 2014 17:17:43 -0500 Subject: QNX: Handle the case where screen returns a refresh rate of 0. Screen sometimes returns a refresh rate of 0. This has been observed on VMWare though it is unknown if this is always the case and whether it happens on other platforms as well. Returning a refresh rate of 0 causes animations to fail so we're better off returning a value that might be wrong than returning 0. Change-Id: I4846017bcb0d6bd52faad727df4ef6dac1a6250f Reviewed-by: Rafael Roquetto --- src/plugins/platforms/qnx/qqnxscreen.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/qnx/qqnxscreen.cpp b/src/plugins/platforms/qnx/qqnxscreen.cpp index f3f93e7f64..d42babb8ab 100644 --- a/src/plugins/platforms/qnx/qqnxscreen.cpp +++ b/src/plugins/platforms/qnx/qqnxscreen.cpp @@ -329,7 +329,8 @@ qreal QQnxScreen::refreshRate() const { screen_display_mode_t displayMode; int result = screen_get_display_property_pv(m_display, SCREEN_PROPERTY_MODE, reinterpret_cast(&displayMode)); - if (result != 0) { + // Screen shouldn't really return 0 but it does so default to 60 or things break. + if (result != 0 || displayMode.refresh == 0) { qWarning("QQnxScreen: Failed to query screen mode. Using default value of 60Hz"); return 60.0; } -- cgit v1.2.3 From f7716732a5d406a21fa0ca1bcc8607eb21ba4e54 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 9 Dec 2014 16:27:29 +0100 Subject: Remove direct linkage to dbus and qdbus It appears that there is no code in the plugin that actually uses dbus. Change-Id: I654cf0b8f5ecc018f2c6ae8701220f7496915a60 Reviewed-by: Thiago Macieira --- src/plugins/platforms/xcb/xcb-plugin.pro | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/xcb/xcb-plugin.pro b/src/plugins/platforms/xcb/xcb-plugin.pro index f14fcde73f..129076c916 100644 --- a/src/plugins/platforms/xcb/xcb-plugin.pro +++ b/src/plugins/platforms/xcb/xcb-plugin.pro @@ -99,11 +99,6 @@ QMAKE_CFLAGS += $$QMAKE_CFLAGS_XCB CONFIG += qpa/genericunixfontdatabase -contains(QT_CONFIG, dbus) { -QT += dbus -LIBS += -ldbus-1 -} - OTHER_FILES += xcb.json README contains(QT_CONFIG, xcb-qt) { -- cgit v1.2.3 From c0853825551ec34f4052e8a86f1c47be7fb5b1d7 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Mon, 22 Dec 2014 09:15:06 +0100 Subject: Revert "OS X: rename special menu items instead of duplicating" This reverts commit 8c538d10da618add00aba1acbc8d8dc2f24445b4. This patch, unfortunately, do not combine well with another problematic code producing, as a result, a serious regression. While the proper/better fix in Cocoa menu not found, I'm reverting this patch. Change-Id: I1ff03dbe12805da447cb3cfe3e2f231528bf1a16 Task-number: QTBUG-43471 Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoamenu.mm | 9 ++------- src/plugins/platforms/cocoa/qcocoamenuitem.mm | 11 ++++------- 2 files changed, 6 insertions(+), 14 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/cocoa/qcocoamenu.mm b/src/plugins/platforms/cocoa/qcocoamenu.mm index d849389907..736e02a3ca 100644 --- a/src/plugins/platforms/cocoa/qcocoamenu.mm +++ b/src/plugins/platforms/cocoa/qcocoamenu.mm @@ -366,14 +366,9 @@ void QCocoaMenu::syncMenuItem(QPlatformMenuItem *menuItem) } bool wasMerged = cocoaItem->isMerged(); - NSMenu *oldMenu = m_nativeMenu; - if (wasMerged) { - QPlatformMenuItem::MenuRole role = cocoaItem->effectiveRole(); - if (role >= QPlatformMenuItem::ApplicationSpecificRole && role < QPlatformMenuItem::CutRole) - oldMenu = [getMenuLoader() applicationMenu]; - } - + NSMenu *oldMenu = wasMerged ? [getMenuLoader() applicationMenu] : m_nativeMenu; NSMenuItem *oldItem = [oldMenu itemWithTag:(NSInteger) cocoaItem]; + if (cocoaItem->sync() != oldItem) { // native item was changed for some reason if (oldItem) { diff --git a/src/plugins/platforms/cocoa/qcocoamenuitem.mm b/src/plugins/platforms/cocoa/qcocoamenuitem.mm index 251fe9485c..470788b6bf 100644 --- a/src/plugins/platforms/cocoa/qcocoamenuitem.mm +++ b/src/plugins/platforms/cocoa/qcocoamenuitem.mm @@ -256,8 +256,8 @@ NSMenuItem *QCocoaMenuItem::sync() if (depth == 3 || !menubar) break; // Menu item too deep in the hierarchy, or not connected to any menubar - MenuRole newDetectedRole = detectMenuRole(m_text); - switch (newDetectedRole) { + m_detectedRole = detectMenuRole(m_text); + switch (m_detectedRole) { case QPlatformMenuItem::AboutRole: if (m_text.indexOf(QRegExp(QString::fromLatin1("qt$"), Qt::CaseInsensitive)) == -1) mergeItem = [loader aboutMenuItem]; @@ -271,15 +271,12 @@ NSMenuItem *QCocoaMenuItem::sync() mergeItem = [loader quitMenuItem]; break; default: - if (newDetectedRole >= CutRole && newDetectedRole < RoleCount && menubar) - mergeItem = menubar->itemForRole(newDetectedRole); + if (m_detectedRole >= CutRole && m_detectedRole < RoleCount && menubar) + mergeItem = menubar->itemForRole(m_detectedRole); if (!m_text.isEmpty()) m_textSynced = true; break; } - - m_detectedRole = newDetectedRole; - break; } -- cgit v1.2.3 From 9a0c4fc479b2f46f569890a2821e56b2943efac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Martins?= Date: Tue, 2 Dec 2014 11:37:32 +0000 Subject: Fix win32-g++ build due to -Werror qwindowsprintdevice.cpp:182:85: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare] && DeviceCapabilities((LPWSTR)m_id.utf16(), NULL, DC_PAPERSIZE, NULL, NULL) == paperCount MinGW DeviceCapabilities is returning an int, although microsoft documents it as returning DWORD. Change-Id: I3acd76dde0b8b83f8a785ec84e3413115c847cb2 Reviewed-by: Friedemann Kleint Reviewed-by: Thiago Macieira --- src/plugins/printsupport/windows/qwindowsprintdevice.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/plugins') diff --git a/src/plugins/printsupport/windows/qwindowsprintdevice.cpp b/src/plugins/printsupport/windows/qwindowsprintdevice.cpp index a0a549da6f..c349655b1e 100644 --- a/src/plugins/printsupport/windows/qwindowsprintdevice.cpp +++ b/src/plugins/printsupport/windows/qwindowsprintdevice.cpp @@ -39,6 +39,10 @@ # define DC_COLLATE 22 #endif +#if defined (Q_CC_MINGW) +# pragma GCC diagnostic ignored "-Wsign-compare" +#endif + QT_BEGIN_NAMESPACE #ifndef QT_NO_PRINTER -- cgit v1.2.3