summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-04-13 07:39:30 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2016-04-13 09:45:58 +0000
commiteb3e3853c4de146410478fca652ea24f3943f774 (patch)
treedf215a0379d5ce40c5c7725d1f00af982b280c03 /src/plugins
parent33044b83c261c485faa0a6f367773138f9892f76 (diff)
parentb94773c9c838a0b3db1bced0bc8daf5b04aefc29 (diff)
Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/android/qandroidplatformtheme.cpp3
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm1
-rw-r--r--src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp2
-rw-r--r--src/plugins/platforms/winrt/qwinrtscreen.cpp50
4 files changed, 49 insertions, 7 deletions
diff --git a/src/plugins/platforms/android/qandroidplatformtheme.cpp b/src/plugins/platforms/android/qandroidplatformtheme.cpp
index f8d0b9c8ba..3949113240 100644
--- a/src/plugins/platforms/android/qandroidplatformtheme.cpp
+++ b/src/plugins/platforms/android/qandroidplatformtheme.cpp
@@ -368,6 +368,9 @@ QAndroidPlatformTheme::QAndroidPlatformTheme(QAndroidPlatformNativeInterface *an
// default in case the style has not set a font
m_systemFont = QFont(QLatin1String("Roboto"), 14.0 * 100 / 72); // keep default size the same after changing from 100 dpi to 72 dpi
+
+ // by default use native menu bar
+ QCoreApplication::setAttribute(Qt::AA_DontUseNativeMenuBar, false);
}
QPlatformMenuBar *QAndroidPlatformTheme::createPlatformMenuBar() const
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index cbb4888718..a2e3b9a949 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -170,6 +170,7 @@ static NSString *_q_NSWindowDidChangeOcclusionStateNotification = nil;
}
m_isMenuView = false;
+ self.focusRingType = NSFocusRingTypeNone;
}
return self;
}
diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp
index 80885df536..c4673edb11 100644
--- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp
+++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsdevice.cpp
@@ -429,7 +429,7 @@ void QEglFSKmsDevice::createScreens()
Q_FOREACH (QPlatformScreen *screen, siblings)
static_cast<QEglFSKmsScreen *>(screen)->setVirtualSiblings(siblings);
- if (primaryScreen)
+ if (primaryScreen && m_integration->hwCursor())
m_globalCursor = new QEglFSKmsCursor(primaryScreen);
}
}
diff --git a/src/plugins/platforms/winrt/qwinrtscreen.cpp b/src/plugins/platforms/winrt/qwinrtscreen.cpp
index 9b7f9cd5b0..562372d0b8 100644
--- a/src/plugins/platforms/winrt/qwinrtscreen.cpp
+++ b/src/plugins/platforms/winrt/qwinrtscreen.cpp
@@ -419,6 +419,23 @@ static inline Qt::Key qKeyFromVirtual(VirtualKey key)
}
}
+// Some keys like modifiers, caps lock etc. should not be automatically repeated if the key is held down
+static inline bool shouldAutoRepeat(Qt::Key key)
+{
+ switch (key) {
+ case Qt::Key_Shift:
+ case Qt::Key_Control:
+ case Qt::Key_Alt:
+ case Qt::Key_Meta:
+ case Qt::Key_CapsLock:
+ case Qt::Key_NumLock:
+ case Qt::Key_ScrollLock:
+ return false;
+ default:
+ return true;
+ }
+}
+
static inline Qt::Key qKeyFromCode(quint32 code, int mods)
{
if (code >= 'a' && code <= 'z')
@@ -873,12 +890,33 @@ HRESULT QWinRTScreen::onKeyDown(ABI::Windows::UI::Core::ICoreWindow *, ABI::Wind
Q_ASSERT_SUCCEEDED(hr);
Qt::Key key = qKeyFromVirtual(virtualKey);
- // Defer character key presses to onCharacterReceived
- if (key == Qt::Key_unknown || (key >= Qt::Key_Space && key <= Qt::Key_ydiaeresis)) {
+
+ const bool wasPressed = d->activeKeys.contains(key);
+ if (wasPressed) {
+ if (!shouldAutoRepeat(key))
+ return S_OK;
+
+ // If the key was pressed before trigger a key release before the next key press
+ QWindowSystemInterface::handleExtendedKeyEvent(
+ topWindow(),
+ QEvent::KeyRelease,
+ key,
+ keyboardModifiers(),
+ !status.ScanCode ? -1 : status.ScanCode,
+ virtualKey,
+ 0,
+ QString(),
+ status.WasKeyDown,
+ !status.RepeatCount ? 1 : status.RepeatCount,
+ false);
+ } else {
d->activeKeys.insert(key, KeyInfo(virtualKey));
- return S_OK;
}
+ // Defer character key presses to onCharacterReceived
+ if (key == Qt::Key_unknown || (key >= Qt::Key_Space && key <= Qt::Key_ydiaeresis))
+ return S_OK;
+
QWindowSystemInterface::handleExtendedKeyEvent(
topWindow(),
QEvent::KeyPress,
@@ -888,7 +926,7 @@ HRESULT QWinRTScreen::onKeyDown(ABI::Windows::UI::Core::ICoreWindow *, ABI::Wind
virtualKey,
0,
QString(),
- status.RepeatCount > 1,
+ status.WasKeyDown,
!status.RepeatCount ? 1 : status.RepeatCount,
false);
return S_OK;
@@ -915,7 +953,7 @@ HRESULT QWinRTScreen::onKeyUp(ABI::Windows::UI::Core::ICoreWindow *, ABI::Window
virtualKey,
0,
info.text,
- status.RepeatCount > 1,
+ false, // The final key release does not have autoRepeat set on Windows
!status.RepeatCount ? 1 : status.RepeatCount,
false);
return S_OK;
@@ -948,7 +986,7 @@ HRESULT QWinRTScreen::onCharacterReceived(ICoreWindow *, ICharacterReceivedEvent
virtualKey,
0,
text,
- status.RepeatCount > 1,
+ status.WasKeyDown,
!status.RepeatCount ? 1 : status.RepeatCount,
false);
d->activeKeys.insert(key, KeyInfo(text, virtualKey));