summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb
Commit message (Collapse)AuthorAgeFilesLines
...
| * xcb: remove xlib dependency from core keymap assemblingGatis Paeglis2018-02-244-24/+238
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the Xlib dependency by extracting XConvertCase from libxkbcommon sources (xkbcommon/src/keysym.c). libxkbcommon >= 0.8.0 exposes case conversion APIs, but we should prefer using the slightly adjusted version (see the patch for more details). This change also is necessary for follow-up cleanups. Change-Id: Icf1716e0ad26f46a7aefb23722cfc57957754d5e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-02-234-49/+32
|\| | | | | | | Change-Id: I01dfc41e18333ac55954296cef8f01475adab27e
| * xcb: remove fragile and unnecessary missing-latin-keymap workaroundGatis Paeglis2018-02-224-49/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... which was trying to fix a rarely occurring situation where system settings from a desktop environment does not set any latin keymap on X. This is a DE bug and it has a simple workaround (details in the patch). Ubuntu has fixed this issue sometime between 12.10 -> 14.04. Gnome 3 always appends 'us' layout, even if you have only e.g. 'gr' listed in keyboard layouts (can be checked via setxkbmap -query). In KDE, the global system shorcuts seem to stop working as soon as latin keymap is not the first in the list, which means that KDE users won't be affected as they will likely always have a latin keymap present in the list. This patch removes parts of 2b666d9576210aa98700e219dba6b1bd4f93d793, the parts that in the commit message I was referring to by this quote: "lookupLatinKeysym() also handles the cases that did not work in Qt4 with XLookupString". Since finding a latin key is not working by XLookupString() in this rare case, then it would not work pretty much across the whole desktop. And users would be more interested at finding a solution that works across the desktop. We should not workaround this issue. Desktops that are doing it wrong should learn about this and not repeat the same mistakes on Wayland systems, where XKB keymap is assembled by compositor and passed to clients. Clients should work with the provided keymap as is. The missing-latin-keymap workaround is considered fragile for several reasons - it might not work with legacy or enterprise X server key codes and it relies on global _XKB_RULES_NAMES (there might be several connected keyboards). And theoretical limitation: client might be running in a restricted environment where we don't have access to keymaps on the file system. Change-Id: Ib445b2ea46174248cfa0e5da0eb642cd2a5cf2f6 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-02-211-0/+3
|\| | | | | | | Change-Id: I9c90d71fde002544fd97df7e8a2690953cf9f817
| * xcb: Fix developer buildFriedemann Kleint2018-02-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Add Q_UNUSED, fixing: qxcbbackingstore.cpp:344:45: error: unused parameter 'segmentSize' [-Werror=unused-parameter] on Kubuntu 17.10. Amends 24adaa9a742e6f95ff897d0eb9a2bce0527dd042. Task-number: QTBUG-46017 Change-Id: I64f21d8f1d1ac21340cfbba66b97768140ce23a8 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-02-165-47/+172
|\| | | | | | | | | | | | | Conflicts: src/corelib/tools/tools.pri Change-Id: I705630f9cecbf0ce51a22fc6116b8c49611259e9
| * xcb: Fix access to shm for X server running from another userAlexander Volkov2018-02-153-35/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use ShmCreateSegment call, that was added in MIT-SHM 1.2, to create shared memory segments on the server side. It returns a POSIX shared memory object that is used to mmap memory. It's in effect a file descriptor that is passed through the X server socket and thus avoids permission checks. On the other hand this scheme is more secure, because the file descriptor, and thus the shared memory, are accessible only by the X server and the application. Task-number: QTBUG-46017 Change-Id: I202eead9d01aee2ab5b65f4f74f4c13da7cb2239 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
| * xcb: Enhance SHM management codeAlexander Volkov2018-02-153-44/+91
| | | | | | | | | | | | | | | | | | | | - extract the creation of a shared memory segment into a separate function - do extra checks for errors - check that MIT-SHM extension is present once in QXcbConnection Change-Id: I956bdf76b879ec5c95a7ed219a59ae722dc5afba Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
| * Fix crash when reading window titles with XCBSimon Hausmann2018-02-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a regression introduced with commit cb142954c54b7a6e391950d9209b5cea9252092b that changed the code from using QString:fromUtf8(name, propertyLength) to QString::fromUtf8(name), assuming that the property name is a zero-terminated string. That however is not correct. ASAN trace: ==4039==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60400001e0b4 at pc 0x7f3383c7d66e bp 0x7ffdc8e3d9b0 sp 0x7ffdc8e3d158 READ of size 5 at 0x60400001e0b4 thread T0 #0 0x7f3383c7d66d (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x5166d) #1 0x7f337602f32a in QString::fromUtf8(char const*, int) ../../../../include/QtCore/../../src/corelib/tools/qstring.h:569 #2 0x7f337602f32a in QXcbWindow::windowTitle(QXcbConnection const*, unsigned int) /home/simon/dev/qt-5.11/qtbase/src/plugins/platforms/xcb/qxcbwindow.cpp:2861 [...] 0x60400001e0b4 is located 0 bytes to the right of 36-byte region [0x60400001e090,0x60400001e0b4) allocated by thread T1 (QXcbEventReader) here: #0 0x7f3383d0ab50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50) #1 0x7f337b397e2b (/usr/lib/x86_64-linux-gnu/libxcb.so.1+0xde2b) Change-Id: Ia5024602d3aacb924b5dcd3956672da2a8f10feb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Merge remote-tracking branch 'origin/5.9' into 5.11Liang Qi2018-02-142-2/+6
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/corelib/animation/qvariantanimation.cpp src/corelib/global/qglobal.cpp src/corelib/global/qlogging.cpp src/corelib/io/qprocess_win.cpp src/corelib/json/qjsonarray.cpp src/corelib/tools/qsimd_p.h src/corelib/tools/qtimezoneprivate_p.h src/corelib/xml/qxmlstream_p.h src/gui/kernel/qsimpledrag.cpp src/gui/kernel/qsimpledrag_p.h src/plugins/generic/generic.pro src/plugins/platforms/cocoa/qcocoamenu.mm src/widgets/styles/qmacstyle_mac.mm tests/auto/concurrent/qtconcurrentmap/BLACKLIST tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/gui/kernel/qwindow/BLACKLIST tests/auto/widgets/dialogs/qmessagebox/BLACKLIST Change-Id: I508d686cf20f7f8cc6a7119b9bc7c3bbb505c58e
| | * Fix QXcbWindow::mapFrom/ToGlobal()J-P Nurmi2018-02-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Call the base class implementations to avoid returning an unmapped values for non-embedded windows. Task-number: QTBUG-55251 Change-Id: Ib05fd530498dd4d72d3d4ef37caf4e2f0ebcd2e4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
| | * glx: Avoid losing the stereo flag in QSurfaceFormatLaszlo Agocs2018-01-231-0/+4
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-59636 Change-Id: I38394009993e92ab9db853a1450687fc48e471f5 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-02-114-25/+41
|\| | | | | | | | | | | Change-Id: Ia443f6eb1c854c99c68127a376b78c1986675a9d
| * | Merge remote-tracking branch 'origin/dev' into 5.11Liang Qi2018-02-105-10/+75
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qvarlengtharray.qdoc src/corelib/tools/qvector.qdoc Resolved documentation changes in favor of 017569f702b6dd0, which keeps the move overloads along with its const-ref sibling. Change-Id: I0835b0b3211a418e5e50defc4cf315f0964fab79
| * | | QPlatformWindow: add startSystemMove()Alexander Volkov2018-02-044-25/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It can be used by custom widgets or for example by the Breeze style from KDE, which allows to drag windows by some widgets. It's important on X11 because _NET_WM_MOVERESIZE requests induced by touch sequences require support from Qt. Task-number: QTBUG-58044 Change-Id: I31c37534555a9050cf361cad85bdef13c2808572 Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | | xcb: Drop _QT_SETTINGS_TIMESTAMP_ atomAlexander Volkov2018-02-082-7/+1
| |/ / |/| | | | | | | | | | | | | | | | | | | | It was used in Qt 4 to make applications reload Trolltech.conf, which is not supported by Qt 5. Change-Id: Ic75c117f22a23a8f26b3f19ce57322878613f5b0 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | | XCB: Implement native window dump for diaglibFriedemann Kleint2018-01-245-10/+75
|/ / | | | | | | | | | | | | | | | | Extract a helper function to determine the window title from QXcbConnection and add an invokable function to the native interface that dumps the window tree similar to existing functionality on Windows. Change-Id: I5544d69ea2b801eb16d3b5b8d64021b3e567b0d8 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2018-01-203-6/+6
|\ \ | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: If089d5010d15c33b3c1f13912d4386207456c1a9
| * | XCB: Replace qDebug with qCDebugOrgad Shaneh2018-01-153-6/+6
| | | | | | | | | | | | | | | Change-Id: I984c3e3288aa4d0b7185ea88ae0c4cf4627a2da3 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Add missing dead key symbolsMatt Whitlock2018-01-151-5/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt was missing symbols for many dead keys defined in <X11/keysymdef.h>. These dead keys were thus ignored by the "compose" input module. This commit adds the missing dead key symbols. [ChangeLog][Linux/XCB] Added missing dead key symbols, enabling their use with the "compose" input module. Task-number: QTBUG-56452 Change-Id: Ib5c37168990c9d9fa99fdd50f63b934c793e8dc4 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io> Reviewed-by: Matt Whitlock <qt@mattwhitlock.name>
* | | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2018-01-1114-188/+268
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/harfbuzz-ng/src/hb-private.hh src/sql/doc/snippets/code/doc_src_sql-driver.cpp src/sql/doc/src/sql-driver.qdoc Change-Id: I38f0e82fcd37926cbf3c1915e009a731040d4598
| * | Fix license headersJani Heikkinen2018-01-1113-182/+260
| | | | | | | | | | | | | | | | | | | | | | | | Remove usage of outdated header.LGPL21 and replace those with proper one (header.LGPL in src, header.GPL-EXCEPT in tests) Change-Id: Ia4d1c0d84b77f09787fe7c30670747a1fe2aff29 Reviewed-by: Liang Qi <liang.qi@qt.io>
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2018-01-091-6/+8
| |\| | | | | | | | | | Change-Id: I840849c072075a69819eb185b20bc42c3de0f825
| | * Avoid providing bad pixelDeltas on X11Allan Sandfeld Jensen2018-01-091-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With libinput we now get a hardcoded resolution that is unrelated to the hardware. So avoid using that as a real pixel delta and document pixel deltas as being driver specific and unreliable on X11. Task-number: QTBUG-59261 Change-Id: I9fe86d80e7ccd290ed2e4091d7eafa52cb537d34 Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Marco Martin <mart@kde.org> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | | XCB: Undef KeyPress and KeyRelease also when not using xinput2Ulf Hermann2018-01-081-0/+2
| | | | | | | | | | | | | | | | | | | | | The defines come from X.h here, which is included via Xutil.h. Change-Id: I19887424cff28567fcbb1c352b42bb9d750b1928 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | | Send NET_WM_SYNC on swapBuffers when using EGLDavid Edmundson2018-01-071-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a user is using EGL on X, we need to reply to sync requests in the same way that we do in the GLX backend. Change-Id: I950de284685dc0ead896688c434828ab1b9c673f Reviewed-by: Aleix Pol Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | | Support legacy X11 keymapsFrank Richter2018-01-042-3/+321
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not all X server vendors support the XKB protocol. Furthermore, while X.org seems to use keycodes that match the usual keyboard scancodes, other vendors may not do so. This means that using an XKB keymap suitable for an X.org server results in garbled input with servers for other vendors. Both of these issues are addressed by using the core keycode information as a fallback. [ChangeLog][X11] Fall back to X11 core keycode information if an XKB keymap could not be determined through the connection. Task-number: QTBUG-44938 Change-Id: I64568aa31113d5a3fd90f70c63320a497db21477 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | | xcb: fix and optimize QXcbConnection::xi2SetMouseGrabEnabledGatis Paeglis2018-01-033-54/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | What was broken: - m_xiGrab on successful ungrab (XIUngrabDevice) was never set to 'false'. Which means that we would unnecessarily call XIAllowTouchEvents, even when we are not grabbing (this did not have any apparent side effects). What was non optimal: - Redundant XIQueryDevice calls. XIQueryDevice with XIAllMasterDevices flag already returns all required devices. Calling XIQueryDevice for every id again does not make sense. - Querying for master pointer info on every grab is unnecessary. Simply cache ids of master devices whenever hierarchy changes. What remains to be investigated some time later (or never): The original and the re-factored code grabs all master pointer devices. Not sure if that is the expected behavior on MPX (Multi-pointer X) systems. Could there be two context menus, each dismissed separately? MPX concept was introduced in XI2.0, but testing shows that this setup is not very well supported even on modern desktop environments. Tested on Ubuntu 16.04, where multiple pointers is enough for crashing a terminal. Also AFAIK there isn't any bug reports about broken MPX support in Qt. Change-Id: I53f99c6efd44abc43a0985e15cff8aae7ebba8f1 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Merge remote-tracking branch 'origin/5.10' into devLars Knoll2018-01-026-28/+62
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf sc/corelib/io/qfsfileengine_p.h src/corelib/io/qstorageinfo_unix.cpp src/platformsupport/eglconvenience/qeglpbuffer_p.h src/platformsupport/input/libinput/qlibinputkeyboard.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/plugins/platforms/cocoa/qcocoamenu.mm src/plugins/platforms/ios/qiosscreen.h src/plugins/platforms/ios/qioswindow.h src/plugins/platforms/ios/quiview.mm src/printsupport/dialogs/qpagesetupdialog_unix_p.h src/printsupport/dialogs/qprintpreviewdialog.cpp src/printsupport/widgets/qcupsjobwidget_p.h src/widgets/widgets/qmenu.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: Iecb4883122efe97ef0ed850271e6c51bab568e9c
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Lars Knoll2017-12-303-4/+6
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf mkspecs/win32-g++/qmake.conf src/corelib/global/qglobal_p.h src/corelib/global/qoperatingsystemversion_p.h src/corelib/io/qfilesystemengine_win.cpp src/network/bearer/qbearerengine.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/sql/doc/snippets/code/doc_src_sql-driver.cpp src/widgets/kernel/qwidget_p.h src/widgets/kernel/qwidgetwindow.cpp src/widgets/styles/qfusionstyle.cpp tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp Change-Id: I80e2722f481b12fff5d967c28f89208c0e9a1dd8
| | * xcb: update libXi version requirement in the README fileGatis Paeglis2017-12-132-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... from 1.7.4 to 1.7.5 (released Sep, 2015). Some more locking issues were fixed after 1.7.4. Testing for a prolonged period of time has showed that 1.7.5 does not cause a system lock-up. [ChangeLog][Platform Specific Changes][X11 / XCB] Minimal libXi version requirement has been updated from 1.7.4 to 1.7.5. This is because XIAllowTouchEvents is known to deadlock with libXi 1.7.4 and earlier. When touch events are never received, this is not an issue. Plain mouse / keyboard systems are not affected. Task-number: QTBUG-62224 Change-Id: Ie70264b9af0390df33c417f660350d4bce48c6d3 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| | * xcb_qpa_lib: Fix "undefined reference to `dlsym'" errorDongmei Wang2017-12-051-0/+2
| | | | | | | | | | | | | | | Change-Id: I37515542571ef37f4361e72b8db4547ff1e1b86a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * | xcb: verify if xrandr present before using xcb_randr* APIsGatis Paeglis2017-12-071-12/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | Not doing so might break the connection. We have had similar issues before, e.g. QTBUG-45312. Change-Id: I95f15d24773fc92b052578bd72d1ba264d0a5f63 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Uli Schlachter <psychon@znc.in>
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-12-052-0/+15
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/ios/quiview.mm Change-Id: I88384c70047391c75d9ff166c8d9881ff6751dbf
| | * xcb: Set executed drop action when drop is outside the applicationBłażej Szczygieł2017-11-292-0/+15
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-62815 Change-Id: I13ee1a3a7e9515d827d29ada38bc0d396f4800d7 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * | xcb: fix regression with missing XI_PropertyEventGatis Paeglis2017-12-041-12/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wacom stylus proximity detection had stopped working: it was not detecting which type of tool is in use, so all stylus types acted as a generic drawing stylus. Selecting XI_PropertyEvent on a root window fixes the problem. There is nothing in the XI2 specification that says that this property would not be supported on non-root windows. Possibly it is bug in the X server. Anyways, selecting XI_PropertyEvent on a root window in this case actually is better. Property event contains a global state information, there is nothing window specific in it, so there is no need to select it for every native sub-window. It is worth noting that XI_HierarchyChanged also seems to work only when selected on the root window (according to my testing results). And on XI2 author's blog post about XI_HierarchyChanged it says [1]: "These events are sent to all windows, so it doesn't really matter where you register. The traditional approach is to register on the root window." This kind of further confirms that it might be bug in X Server's implementation. [1] http://who-t.blogspot.no/2009/06/xi2-recipies-part-2.html Task-number: QTBUG-64911 Change-Id: I8582675bf835239932e23f4596966dc167495e30 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Chop a possible trailing \0 from retrieved textLars Knoll2017-12-291-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some apps (e.g. Chromium) explicitly append a \0 to the text they transmit through the clipboard. Remove that one, when we retrieve the text, so it doesn't become part of the text we're pasting. This was e.g. visible when pasting from chromium to the textedit example. Change-Id: I9445319e6e5ef304a364e14f794b16557a3cc919 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | | Refactor QXcbKeyboard::updateModifiers()Frank Richter2017-12-192-26/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation is poorly documented and hides the mapping between keysyms and modifier bits. This changeset adds documentation about the inner workings and makes the keysym/modifier bit mapping reusable. (The latter will be needed for xkb keymap synthesis if the XKEYBOARD extension is unavailable.) Change-Id: I70c6d204b2357365db4dafeda680132ab6823ca3 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | | Cleanup: Use QThread::msleep to sleep instead of selectMilian Wolff2017-12-191-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old code used select with all-zero parameters and a timeval struct configured to wait for 50ms. This can be drastically simplified by just calling QThread::msleep which makes the intention much more clear. Change-Id: I115b56ae67ae2c2cd03354e16a7bfdf56f8c15b8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | | xcb: port away from last QRegion::rects()Marc Mutz2017-12-061-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use begin()/end() instead. In QXcbShmImage::flushPixmap(), instead of gettings different rects(), depending on a bool parameter, just call yourself again with the modified QRegion, which we can then just iterate over. Change-Id: I6d4f7c6e4e5d2a24520716847ca9331bf39337c8 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | xcb: share code for QRegion -> xcb_rectangle_t[] conversionMarc Mutz2017-12-063-14/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... between QXcbWindow and QxcbShmImage. Replaces one QRegion::rects() call (to be deprecated), fixes potential overflows that QXcbShmImage did not handle, but QXcbWindow did, and saves ~1KiB of text size. Change-Id: I55d37021164feefe0cb3e60bd6d22b1976a6467b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | xcb: use a more efficient unique_ptr instantiationMarc Mutz2017-12-061-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wrap std::free() in a function object, to avoid having to carry around state (the function pointer) inside unique_ptr objects. This shrinks unique_ptrs back to sizeof(void*). Change-Id: I32a711192c5485dc04e3b36a1ddabf02d1e9d4f9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* | | xcb: remove redundant QT_XCB_DEBUG_XINPUT* envvarsGatis Paeglis2017-12-061-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Qt 5.4 these envvars were replaced with categorized logging 59ba84d31cf17d86e615e2958fece6f6e0bbefe2. This is not a public API, the log output is useful mostly for developers and it can still be used via QT_LOGGING_RULES, so there is no good reason to keep the old envvars around. By using QT_LOGGING_RULES, we can access even more xinput2 logs than is available via QT_XCB_DEBUG_XINPUT*. Change-Id: I2b12b8696043bc8bf8310f49f0cdc2ba1b8708ba Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | platform plugins: port away from QRegion::rects()Marc Mutz2017-12-061-1/+1
| | | | | | | | | | | | | | | | | | | | | Use begin()/end()/rectCount() instead. Change-Id: I5c642c4a2c64da65d3f37159396c86073818ca95 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | | macx-clang: Opt-in xcb QPA support with XQuartzGabriel de Dietrich2017-12-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable xcb QPA plugin when XQuartz is available. This is done in a single build, alongside the Cocoa version. We delegate part of the configuration stage to pkg-config, so this becomes a requirement. Ensure that PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig:/opt/X11/share/pkgconfig is in your environment, or pkg-config is properly set up. Tested with the following configure options: configure \ -pkg-config \ -fontconfig -system-freetype \ -system-xcb -xkb -no-opengl \ -qt-xkbcommon -qt-xkbcommon-x11 Change-Id: I2eb5a0491172368afc4c629c540cbef08580348d Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | | Merge "Merge remote-tracking branch 'origin/5.10' into dev" into ↵Thiago Macieira2017-11-301-1/+1
|\ \ \ | | | | | | | | | | | | refs/staging/dev
| * | | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-231-1/+1
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/access/qhttp2protocolhandler_p.h src/network/kernel/kernel.pri src/network/ssl/qsslkey_qt.cpp src/plugins/platforms/cocoa/qcocoascreen.mm src/plugins/platforms/windows/accessible/iaccessible2.cpp src/plugins/platforms/windows/accessible/iaccessible2.h src/plugins/platforms/windows/accessible/qwindowsaccessibility.cpp src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.h src/widgets/widgets/qmenu_p.h tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/auto/other/qaccessibility/tst_qaccessibility.cpp tests/auto/testlib/selftests/expected_cmptest.lightxml tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt tests/auto/testlib/selftests/expected_cmptest.xml Done-with: Edward Welbourne <edward.welbourne@qt.io> Change-Id: I4217cc7d840cbae3e3dd28574741544469c4c6b9
| | * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-11-091-1/+1
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qwindow.cpp src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/windows/qwindowssystemtrayicon.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp tests/auto/corelib/io/qtemporarydir/tst_qtemporarydir.cpp tests/auto/widgets/kernel/qaction/tst_qaction.cpp Change-Id: Ifa515dc0ece7eb1471b00c1214149629a7e6a233
| | | * Xinput: Avoid misdetecting certain trackballs as tabletsEirik Aavitsland2017-11-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The algorithm triggers on the word "cursor" in the device name, which would also happen for devices from the manufacturer Cursor Controls. Task-number: QTBUG-48034 Change-Id: I9645c0d0bc1fa951d0ea00480572fd0df0220eb5 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | | xcb: Use fallbacks for Xcursor namesAlexander Volkov2017-11-231-40/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some cursor themes may not contain cursors with common names, then fallback names should be used. The fallbacks in this change were taken from the wayland plugin. Change-Id: I7fcc47a71cafe41c88a21a7168acd3a274b71693 Reviewed-by: Andy Nichols <andy.nichols@qt.io>