Accepting request 446432 from KDE:Qt5

Update to 5.7.1

OBS-URL: https://build.opensuse.org/request/show/446432
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libqt5-qtbase?expand=0&rev=58
This commit is contained in:
Ludwig Nussel 2016-12-22 15:06:06 +00:00 committed by Git OBS Bridge
parent 67a95093f9
commit bea8c543d0
13 changed files with 39 additions and 487 deletions

View File

@ -1,60 +0,0 @@
From 6f423555eba55ccdf7287071e10576bc1b687fd2 Mon Sep 17 00:00:00 2001
From: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Date: Mon, 1 Aug 2016 13:39:53 +0200
Subject: REG: Fix unwanted cache flush in Freetype engine
The Freetype cache was almost completely disabled by
134c6db8587a8ce156d4fa31ffa62605821851b2 because after that
change, the lockedAlphaMapForGlyph() function would no longer
cut off early for empty glyphs like spaces, but rather go
through all alpha map functions before it realized that there
was nothing to render. This would in turn invalidate the cache
for every empty glyph, causing all glyphs to be rerendered for
every isolated word.
This change adds back a cut off. This is only needed in the
lockedAlphaMapForGlyph() function, since the superclass implementation
of the other alpha map functions already contains a cut off for
width/height == 0.
[ChangeLog][Qt Gui][Text] Fixed a performance regression in Freetype
engine that was introduced in Qt 5.5.
Change-Id: I381285939909e99cc5fb5f3497fecf9fa871f29a
Task-number: QTBUG-49452
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
---
src/gui/text/qfontengine_ft.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp
index 4de41df..7c878da 100644
--- a/src/gui/text/qfontengine_ft.cpp
+++ b/src/gui/text/qfontengine_ft.cpp
@@ -1716,7 +1716,7 @@ glyph_metrics_t QFontEngineFT::alphaMapBoundingBox(glyph_t glyph, QFixed subPixe
static inline QImage alphaMapFromGlyphData(QFontEngineFT::Glyph *glyph, QFontEngine::GlyphFormat glyphFormat)
{
- if (glyph == Q_NULLPTR)
+ if (glyph == Q_NULLPTR || glyph->height == 0 || glyph->width == 0)
return QImage();
QImage::Format format = QImage::Format_Invalid;
@@ -1764,11 +1764,15 @@ QImage *QFontEngineFT::lockedAlphaMapForGlyph(glyph_t glyphIndex, QFixed subPixe
currentlyLockedAlphaMap = alphaMapFromGlyphData(glyph, neededFormat);
+ const bool glyphHasGeometry = glyph != Q_NULLPTR && glyph->height != 0 && glyph->width != 0;
if (!cacheEnabled && glyph != &emptyGlyph) {
currentlyLockedAlphaMap = currentlyLockedAlphaMap.copy();
delete glyph;
}
+ if (!glyphHasGeometry)
+ return Q_NULLPTR;
+
if (currentlyLockedAlphaMap.isNull())
return QFontEngine::lockedAlphaMapForGlyph(glyphIndex, subPixelPosition, neededFormat, t, offset);
--
cgit v1.0-4-g1e03

View File

@ -1,58 +0,0 @@
From ebf0b121084822ce754c14ed7255bde0f90bf42f Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macieira@intel.com>
Date: Tue, 6 Sep 2016 11:41:00 -0700
Subject: [PATCH] Make QDBusConnectionPrivate::relaySignal be called in the
right thread
This function sends D-Bus messages directly (in huntAndEmit), so it
should only be called from the QDBusConnectionManager thread. Somehow, I
missed this in the Qt 5.6 refactoring of QtDBus.
Being called in the wrong thread means that there's a visible behavior
change compared to Qt 5.5: if the user code sent a method call or method
return/error and then emitted a signal, we'd have two threads racing to
send the D-Bus messages. This was observed in Telepathy-Qt code: certain
signals arrived before a method return, even though they were clearly
emitted by a queued QMetaObject::invokeMethod.
In addition to that, we have has an internal problem (though not
observed): the libdbus-1 timer and socket callbacks would be called in
the wrong thread and we no longer have protection against that.
Unit testing not possible since this is a race condition.
Change-Id: I9e96ecd4f6aa4ff0ae08fffd1471d002142613d6
Reviewed-by: Gustavo Pichorim Boiko <gustavo.boiko@canonical.com>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
---
src/dbus/qdbusintegrator.cpp | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
index 878a582..c2cf7f4 100644
--- a/src/dbus/qdbusintegrator.cpp
+++ b/src/dbus/qdbusintegrator.cpp
@@ -1257,6 +1257,7 @@ void QDBusConnectionPrivate::relaySignal(QObject *obj, const QMetaObject *mo, in
break;
}
+ checkThread();
QDBusReadLocker locker(RelaySignalAction, this);
QDBusMessage message = QDBusMessage::createSignal(QLatin1String("/"), interface,
QLatin1String(memberName));
@@ -2368,12 +2369,9 @@ void QDBusConnectionPrivate::registerObject(const ObjectTreeNode *node)
connector->connectAllSignals(node->obj);
}
- // disconnect and reconnect to avoid duplicates
- connector->disconnect(SIGNAL(relaySignal(QObject*,const QMetaObject*,int,QVariantList)),
- this, SLOT(relaySignal(QObject*,const QMetaObject*,int,QVariantList)));
connect(connector, SIGNAL(relaySignal(QObject*,const QMetaObject*,int,QVariantList)),
this, SLOT(relaySignal(QObject*,const QMetaObject*,int,QVariantList)),
- Qt::DirectConnection);
+ Qt::ConnectionType(Qt::QueuedConnection | Qt::UniqueConnection));
}
}
--
2.7.4

View File

@ -1,34 +0,0 @@
From 2c48695f04b0f4b3b11ec037b13132b146cad082 Mon Sep 17 00:00:00 2001
From: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Date: Thu, 15 Sep 2016 23:21:15 +0200
Subject: XCB Drop from external app: fix keyboard modifier state
Fix inspired by Qt 4 sources. When we get drop events that are not
coming from the same application, it's unlikely that the keyboard
modifiers are in a sensible state (the usual XCB events are not sent
during drag and drop), so set the keyboard modifier state explicitly.
Task-number: QTBUG-49645
Change-Id: I9360f2b7ffeaa5243a4dfe7ccf96df134c5d2156
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
---
src/plugins/platforms/xcb/qxcbdrag.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/plugins/platforms/xcb/qxcbdrag.cpp b/src/plugins/platforms/xcb/qxcbdrag.cpp
index f93e420..acfb580 100644
--- a/src/plugins/platforms/xcb/qxcbdrag.cpp
+++ b/src/plugins/platforms/xcb/qxcbdrag.cpp
@@ -960,6 +960,9 @@ void QXcbDrag::handleDrop(QPlatformWindow *, const xcb_client_message_event_t *e
} else {
dropData = platformDropData();
supported_drop_actions = accepted_drop_action;
+
+ // Drop coming from another app? Update keyboard modifiers.
+ QGuiApplicationPrivate::modifier_buttons = QGuiApplication::queryKeyboardModifiers();
}
if (!dropData)
--
cgit v1.0-4-g1e03

View File

@ -1,3 +1,20 @@
-------------------------------------------------------------------
Wed Dec 14 16:05:44 UTC 2016 - hrvoje.senjan@gmail.com
- Update to 5.7.1
* For more details please see:
https://blog.qt.io/blog/2016/12/14/qt-5-7-1-released/
and https://www.qt.io/qt5-7/
- Drop upstreamed patches:
xcb-Dont-activate-bypassed-windows-on-mouse-press.patch,
Fix-unwanted-cache-flush-in-Freetype-engine.patch,
xcb-Send-also-text-plain-when-a-text-uri-list-is-dropped.patch,
xcb-Dont-send-QtWindowNoState-event-when-hiding-minimized-window.patch,
XCB-Drop-from-external-app-fix-keyboard-modifier-state.patch,
xcb-Use-the-state-of-the-key-event-to-process-it.patch,
Make-QDBusConnectionPrivaterelaySignal-be-called-in-the-right-thread.patch
and use-freetype-default.patch
-------------------------------------------------------------------
Sun Oct 9 16:57:18 UTC 2016 - sor.alexei@meowr.ru

View File

@ -26,15 +26,15 @@
%endif
Name: libqt5-qtbase
Version: 5.7.0
Version: 5.7.1
Release: 0
Summary: C++ Program Library, Core Components
License: GPL-3.0 or SUSE-LGPL-2.1-with-digia-exception-1.1
Group: System/Libraries
Url: http://qt.digia.com
%define base_name libqt5
%define real_version 5.7.0
%define so_version 5.7.0
%define real_version 5.7.1
%define so_version 5.7.1
%define tar_version qtbase-opensource-src-%{real_version}
Source: %{tar_version}.tar.xz
# to get mtime of file:
@ -43,8 +43,6 @@ Source2: macros.qt5
Source3: baselibs.conf
Source99: libqt5-qtbase-rpmlintrc
# patches 0-1000 are openSUSE and/or non-upstream(able) patches #
# PATCH-FIX-UPSTREAM use-freetype-default.patch -- allow using lcd-default filter regardless of how freetype2 library has been built (w/ & w/o subpixel)
Patch2: use-freetype-default.patch
# PATCH-FIX-SUSE libqt5-Fix-Gujarati-font.patch bnc#878292 fix broken Gujarati font rendering
Patch3: libqt5-Fix-Gujarati-font.patch
# Patch-FIX-SUSE libqt5-do-not-use-shm-if-display-name-doesnt-look-local.patch -- bnc#888858
@ -52,17 +50,10 @@ Patch5: libqt5-do-not-use-shm-if-display-name-doesnt-look-local.patch
# PATCH-FIX-OPENSUSE disable-rc4-ciphers-bnc865241.diff bnc#865241-- Exclude rc4 ciphers from being used by default
Patch6: disable-rc4-ciphers-bnc865241.diff
Patch7: tell-the-truth-about-private-api.patch
Patch8: xcb-Dont-activate-bypassed-windows-on-mouse-press.patch
Patch9: Fix-unwanted-cache-flush-in-Freetype-engine.patch
# PATCH-FIX-OPENSUSE libqt5-prioritise-gtk2-platformtheme.patch boo#1002900 -- Give Gtk2 Platform Theme (from qtstyleplugins) a priority over Gtk3 PT which currently lacks QGtk3Style.
Patch10: libqt5-prioritise-gtk2-platformtheme.patch
# patches 1000-2000 and above from upstream 5.7 branch #
Patch1000: xcb-Send-also-text-plain-when-a-text-uri-list-is-dropped.patch
Patch1001: xcb-Dont-send-QtWindowNoState-event-when-hiding-minimized-window.patch
Patch1002: XCB-Drop-from-external-app-fix-keyboard-modifier-state.patch
Patch1003: xcb-Use-the-state-of-the-key-event-to-process-it.patch
Patch1004: Stop-unloading-plugins-in-QPluginLoader-and-QFactoryLoader.patch
Patch1005: Make-QDBusConnectionPrivaterelaySignal-be-called-in-the-right-thread.patch
Patch1006: Merge-the-QDBusMetaTypes-custom-information-to-QDBusConnectionManager.patch
Patch1007: Fix-some-QtDBus-crashes-during-application-destruction.patch
# patches 2000-3000 and above from upstream 5.8 branch #
@ -146,20 +137,12 @@ handling.
%prep
%setup -q -n qtbase-opensource-src-%{real_version}
%patch2 -p1
%patch3 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch1000 -p1
%patch1001 -p1
%patch1002 -p1
%patch1003 -p1
%patch1004 -p1
%patch1005 -p1
%patch1006 -p1
%patch1007 -p1
@ -801,7 +784,8 @@ find %{buildroot}%{libqt5_libdir} -type f -name '*la' -print -exec perl -pi -e "
find %{buildroot}%{libqt5_libdir} -type f -name '*pc' -print -exec perl -pi -e "s, -L$RPM_BUILD_DIR/?\S+,,g" {} \; -exec sed -i -e "s,^moc_location=.*,moc_location=%libqt5_bindir/moc," -e "s,uic_location=.*,uic_location=%libqt5_bindir/uic," {} \;
find %{buildroot}%{libqt5_libdir}/ -name 'lib*.a' -exec chmod -x -- {} \;
# kill .la files
rm -f %{buildroot}%{libqt5_libdir}/lib*.la
rm -fv %{buildroot}%{libqt5_libdir}/lib*.la
rm -fv %{buildroot}%{libqt5_libdir}/libqtpng.*
#
rm -fv %{buildroot}%{libqt5_libdir}/cmake/Qt5*/Q*Plugin.cmake
@ -1052,7 +1036,7 @@ popd
%{libqt5_libdir}/sse2/libQt5Gui.so.*
%endif
%{libqt5_libdir}/libQt5EglDeviceIntegration.so.*
%if %gles
%if 0%{?is_opensuse}
%{libqt5_libdir}/libQt5EglFsKmsSupport.so.*
%endif
%{libqt5_libdir}/libQt5XcbQpa.so.*
@ -1074,7 +1058,7 @@ popd
%doc *.txt LICENSE.*
%{libqt5_libdir}/libQt5Gui.so
%{libqt5_libdir}/libQt5Gui.prl
%if %gles
%if 0%{?is_opensuse}
%{libqt5_libdir}/libQt5EglFsKmsSupport.prl
%{libqt5_libdir}/libQt5EglFsKmsSupport.so
%endif

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3e7b6d123cab23a587ccbc45173296b33786faa409dba0494e4658fda3ede646
size 43993020

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:edcdf549d94d98aff08e201dcb3ca25bc3628a37b1309e320d5f556b6b66557e
size 44992616

View File

@ -2,11 +2,13 @@ diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
index aefd3ae..53a3f60 100644
--- a/mkspecs/features/qt_module.prf
+++ b/mkspecs/features/qt_module.prf
@@ -195,12 +195,14 @@ android: CONFIG += qt_android_deps no_li
@@ -195,16 +195,18 @@
!header_module:unix:!isEmpty(QMAKE_LFLAGS_VERSION_SCRIPT):!no_linker_version_script:!static {
verscript = $${TARGET}.version
QMAKE_LFLAGS += $${QMAKE_LFLAGS_VERSION_SCRIPT}$$verscript
+ private_api_headers = $$SYNCQT.PRIVATE_HEADER_FILES $$SYNCQT.QPA_HEADER_FILES
+ private_api_headers = $$SYNCQT.PRIVATE_HEADER_FILES $$SYNCQT.QPA_HEADER_FILES
+
internal_module {
- verscript_content = "Qt_$${QT_MAJOR_VERSION}_PRIVATE_API { *; };"
@ -20,12 +22,18 @@ index aefd3ae..53a3f60 100644
verscript_content += " @FILE:$${_PRO_FILE_PWD_}/$$header@"
verscript_content += "};"
@@ -221,7 +223,7 @@ android: CONFIG += qt_android_deps no_li
current = Qt_$$QT_MAJOR_VERSION
verscript_content += "$$current { *; };"
@@ -221,11 +223,11 @@
# Add a post-processing step to replace the @FILE:filename@
verscript_in = $${verscript}.in
verscriptprocess.name = linker version script ${QMAKE_FILE_BASE}
verscriptprocess.input = verscript_in
verscriptprocess.CONFIG += no_link target_predeps
- for(header, SYNCQT.PRIVATE_HEADER_FILES): \
+ for(header, private_api_headers)): \
+ for(header, private_api_headers): \
verscriptprocess.depends += $${_PRO_FILE_PWD_}/$$header
verscriptprocess.output = $$verscript
verscriptprocess.commands = perl $${PWD}/data/unix/findclasslist.pl < ${QMAKE_FILE_IN} > $@
silent:verscriptprocess.commands = @echo creating linker version script ${QMAKE_FILE_BASE} && $$verscriptprocess.commands
QMAKE_EXTRA_COMPILERS += verscriptprocess

View File

@ -1,13 +0,0 @@
diff --git a/src/gui/text/qfontengine_ft.cpp b/src/gui/text/qfontengine_ft.cpp
index 05bd014..a3d8edf 100644
--- a/src/gui/text/qfontengine_ft.cpp
+++ b/src/gui/text/qfontengine_ft.cpp
@@ -69,7 +69,7 @@
#include FT_CONFIG_OPTIONS_H
#endif
-#if defined(FT_LCD_FILTER_H) && defined(FT_CONFIG_OPTION_SUBPIXEL_RENDERING)
+#if defined(FT_LCD_FILTER_H)
#define QT_USE_FREETYPE_LCDFILTER
#endif

View File

@ -1,49 +0,0 @@
From 444ba31a0a68421ee9ff7de788f6026599202455 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= <spaz16@wp.pl>
Date: Fri, 10 Jun 2016 00:11:35 +0200
Subject: xcb: Don't activate bypassed windows on mouse press
Windows with "Qt::BypassWindowManagerHint" flag can't be activated by
mouse. They can be activated only from code calling "activateWindow()"
or "requestActivate()" methods.
The patch applies also for "Qt::ToolTip" and "Qt::Popup" windows which
have implicit "Qt::BypassWindowManagerHint" flag.
The patch fixes some major issues:
- don't activate tooltips on mouse press - this causes that Qt "thinks"
that original windows loses its focus causing e.g. that text cursor
stops blinking,
- don't activate X11 tray icon - this causes that the active window
looses its focus by clicking tray icon.
The patch restores the Qt4 behavior.
Task-number: QTBUG-53993
Change-Id: I80b226f2f5ea0ebbfe8922c90d9da9f4132e8cce
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
---
src/plugins/platforms/xcb/qxcbwindow.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 0c2f0d7..b5cde14 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -2201,8 +2201,11 @@ void QXcbWindow::handleButtonPressEvent(int event_x, int event_y, int root_x, in
const bool isWheel = detail >= 4 && detail <= 7;
if (!isWheel && window() != QGuiApplication::focusWindow()) {
QWindow *w = static_cast<QWindowPrivate *>(QObjectPrivate::get(window()))->eventReceiver();
- if (!(w->flags() & Qt::WindowDoesNotAcceptFocus))
+ if (!(w->flags() & (Qt::WindowDoesNotAcceptFocus | Qt::BypassWindowManagerHint))
+ && w->type() != Qt::ToolTip
+ && w->type() != Qt::Popup) {
w->requestActivate();
+ }
}
updateNetWmUserTime(timestamp);
--
cgit v1.0-4-g1e03

View File

@ -1,42 +0,0 @@
From 2cf3dee10be1d2163eff0893f51f9ece643c2540 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?B=C5=82a=C5=BCej=20Szczygie=C5=82?= <spaz16@wp.pl>
Date: Mon, 12 Sep 2016 15:22:20 +0200
Subject: xcb: Don't send "Qt::WindowNoState" event when hiding minimized
window
This prevents getting "QWidget::showEvent()" when hiding minimized
widget on some WMs like Marco or Xfwm4.
If QWindow is minimized and it gets the new "XCB_WM_STATE_WITHDRAWN"
event from XCB, then don't change the QWindow state.
Task-number: QTBUG-55942
Change-Id: I90cfc2bf55e507864ad8f26c8f569ea562c27314
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
---
src/plugins/platforms/xcb/qxcbwindow.cpp | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index da50201..d46228c 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -2543,8 +2543,13 @@ void QXcbWindow::handlePropertyNotifyEvent(const xcb_property_notify_event_t *ev
if (reply && reply->format == 32 && reply->type == atom(QXcbAtom::WM_STATE)) {
const quint32 *data = (const quint32 *)xcb_get_property_value(reply);
- if (reply->length != 0 && XCB_WM_STATE_ICONIC == data[0])
- newState = Qt::WindowMinimized;
+ if (reply->length != 0) {
+ if (data[0] == XCB_WM_STATE_ICONIC
+ || (data[0] == XCB_WM_STATE_WITHDRAWN
+ && m_lastWindowStateEvent == Qt::WindowMinimized)) {
+ newState = Qt::WindowMinimized;
+ }
+ }
}
free(reply);
} else { // _NET_WM_STATE can't change minimized state
--
cgit v1.0-4-g1e03

View File

@ -1,52 +0,0 @@
From 3d621af54be7b34e6cc6357b48c4d15f911937ee Mon Sep 17 00:00:00 2001
From: Urs Fleisch <ufleisch@users.sourceforge.net>
Date: Sun, 15 May 2016 16:56:40 +0200
Subject: [PATCH] xcb: Send also "text/plain" when a "text/uri-list" is
dropped.
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit
This will allow dropping of files from Qt applications to applications
like Skype, which only accept "text/plain", but not "text/uri-list" or
"text/x-moz-url".
Task-number: QTBUG-53238
Change-Id: I01bca5c8e20647cedfc9323f542ab07f0cc48658
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Błażej Szczygieł <spaz16@wp.pl>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
---
src/plugins/platforms/xcb/qxcbmime.cpp | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/plugins/platforms/xcb/qxcbmime.cpp b/src/plugins/platforms/xcb/qxcbmime.cpp
index 7fea068..cc90da3 100644
--- a/src/plugins/platforms/xcb/qxcbmime.cpp
+++ b/src/plugins/platforms/xcb/qxcbmime.cpp
@@ -125,6 +125,11 @@ bool QXcbMime::mimeDataForAtom(QXcbConnection *connection, xcb_atom_t a, QMimeDa
ret = true;
} else if ((a == XCB_ATOM_PIXMAP || a == XCB_ATOM_BITMAP) && mimeData->hasImage()) {
ret = true;
+ } else if (atomName == QLatin1String("text/plain")
+ && mimeData->hasFormat(QLatin1String("text/uri-list"))) {
+ // Return URLs also as plain text.
+ *data = QInternalMimeData::renderDataHelper(atomName, mimeData);
+ ret = true;
}
return ret;
}
@@ -143,8 +148,10 @@ QVector<xcb_atom_t> QXcbMime::mimeAtomsForFormat(QXcbConnection *connection, con
}
// special cases for uris
- if (format == QLatin1String("text/uri-list"))
+ if (format == QLatin1String("text/uri-list")) {
atoms.append(connection->internAtom("text/x-moz-url"));
+ atoms.append(connection->internAtom("text/plain"));
+ }
//special cases for images
if (format == QLatin1String("image/ppm"))
--
2.7.4

View File

@ -1,149 +0,0 @@
From 76adb6c29f9284a3d7cceb8fb09c3bb7c4cd5e1b Mon Sep 17 00:00:00 2001
From: Albert Astals Cid <aacid@kde.org>
Date: Thu, 21 Apr 2016 01:39:27 +0200
Subject: xcb: Use the state of the key event to process it
Instead of the global state
Task-number: QTBUG-48795
Change-Id: Ic2c545718adb68df41730e5a3bf25adb374ffce3
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
---
src/plugins/platforms/xcb/qxcbkeyboard.cpp | 72 ++++++++++++++++++------------
src/plugins/platforms/xcb/qxcbkeyboard.h | 2 +
2 files changed, 46 insertions(+), 28 deletions(-)
diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
index 28de86b..e0fcc01 100644
--- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp
+++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
@@ -742,8 +742,7 @@ void QXcbKeyboard::updateKeymap()
// update xkb state object
xkb_state_unref(xkb_state);
xkb_state = new_state;
- if (!connection()->hasXKB())
- updateXKBMods();
+ updateXKBMods();
checkForLatinLayout();
}
@@ -768,32 +767,37 @@ void QXcbKeyboard::updateXKBState(xcb_xkb_state_notify_event_t *state)
}
#endif
+void QXcbKeyboard::updateXKBStateFromState(struct xkb_state *kb_state, quint16 state)
+{
+ const quint32 modsDepressed = xkb_state_serialize_mods(kb_state, XKB_STATE_MODS_DEPRESSED);
+ const quint32 modsLatched = xkb_state_serialize_mods(kb_state, XKB_STATE_MODS_LATCHED);
+ const quint32 modsLocked = xkb_state_serialize_mods(kb_state, XKB_STATE_MODS_LOCKED);
+ const quint32 xkbMask = xkbModMask(state);
+
+ const quint32 latched = modsLatched & xkbMask;
+ const quint32 locked = modsLocked & xkbMask;
+ quint32 depressed = modsDepressed & xkbMask;
+ // set modifiers in depressed if they don't appear in any of the final masks
+ depressed |= ~(depressed | latched | locked) & xkbMask;
+
+ const xkb_state_component newState
+ = xkb_state_update_mask(kb_state,
+ depressed,
+ latched,
+ locked,
+ 0,
+ 0,
+ (state >> 13) & 3); // bits 13 and 14 report the state keyboard group
+
+ if ((newState & XKB_STATE_LAYOUT_EFFECTIVE) == XKB_STATE_LAYOUT_EFFECTIVE) {
+ //qWarning("TODO: Support KeyboardLayoutChange on QPA (QTBUG-27681)");
+ }
+}
+
void QXcbKeyboard::updateXKBStateFromCore(quint16 state)
{
if (m_config && !connection()->hasXKB()) {
- const quint32 modsDepressed = xkb_state_serialize_mods(xkb_state, XKB_STATE_MODS_DEPRESSED);
- const quint32 modsLatched = xkb_state_serialize_mods(xkb_state, XKB_STATE_MODS_LATCHED);
- const quint32 modsLocked = xkb_state_serialize_mods(xkb_state, XKB_STATE_MODS_LOCKED);
- const quint32 xkbMask = xkbModMask(state);
-
- const quint32 latched = modsLatched & xkbMask;
- const quint32 locked = modsLocked & xkbMask;
- quint32 depressed = modsDepressed & xkbMask;
- // set modifiers in depressed if they don't appear in any of the final masks
- depressed |= ~(depressed | latched | locked) & xkbMask;
-
- const xkb_state_component newState
- = xkb_state_update_mask(xkb_state,
- depressed,
- latched,
- locked,
- 0,
- 0,
- (state >> 13) & 3); // bits 13 and 14 report the state keyboard group
-
- if ((newState & XKB_STATE_LAYOUT_EFFECTIVE) == XKB_STATE_LAYOUT_EFFECTIVE) {
- //qWarning("TODO: Support KeyboardLayoutChange on QPA (QTBUG-27681)");
- }
+ updateXKBStateFromState(xkb_state, state);
}
}
@@ -1455,7 +1459,16 @@ void QXcbKeyboard::handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type,
if (type == QEvent::KeyPress)
targetWindow->updateNetWmUserTime(time);
- xcb_keysym_t sym = xkb_state_key_get_one_sym(xkb_state, code);
+ // Have a temporary keyboard state filled in from state
+ // this way we allow for synthetic events to have different state
+ // from the current state i.e. you can have Alt+Ctrl pressed
+ // and receive a synthetic key event that has neither Alt nor Ctrl pressed
+ struct xkb_state *kb_state = xkb_state_new(xkb_keymap);
+ if (!kb_state)
+ return;
+ updateXKBStateFromState(kb_state, state);
+
+ xcb_keysym_t sym = xkb_state_key_get_one_sym(kb_state, code);
QPlatformInputContext *inputContext = QGuiApplicationPrivate::platformIntegration()->inputContext();
QMetaMethod method;
@@ -1474,11 +1487,13 @@ void QXcbKeyboard::handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type,
Q_ARG(uint, code),
Q_ARG(uint, state),
Q_ARG(bool, type == QEvent::KeyPress));
- if (retval)
+ if (retval) {
+ xkb_state_unref(kb_state);
return;
+ }
}
- QString string = lookupString(xkb_state, code);
+ QString string = lookupString(kb_state, code);
// Ιf control modifier is set we should prefer latin character, this is
// used for standard shortcuts in checks like "key == QKeySequence::Copy",
@@ -1547,6 +1562,7 @@ void QXcbKeyboard::handleKeyEvent(xcb_window_t sourceWindow, QEvent::Type type,
QWindowSystemInterface::handleExtendedKeyEvent(window, time, QEvent::KeyPress, qtcode, modifiers,
code, sym, state, string, isAutoRepeat);
}
+ xkb_state_unref(kb_state);
}
QString QXcbKeyboard::lookupString(struct xkb_state *state, xcb_keycode_t code) const
diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.h b/src/plugins/platforms/xcb/qxcbkeyboard.h
index 457a27a..dc27511 100644
--- a/src/plugins/platforms/xcb/qxcbkeyboard.h
+++ b/src/plugins/platforms/xcb/qxcbkeyboard.h
@@ -98,6 +98,8 @@ protected:
void checkForLatinLayout();
private:
+ void updateXKBStateFromState(struct xkb_state *kb_state, quint16 state);
+
bool m_config;
xcb_keycode_t m_autorepeat_code;
--
cgit v1.0-4-g1e03