summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbconnection.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QXcbConnection: use erase and std::remove_if with QVectorAnton Kudryavtsev2016-01-091-7/+6
| | | | | | | ... instead of using erase in a loop, with quadratic complexity. Change-Id: Ia5201e0bedca7abec6d485505f61f3f76a028bd1 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Merge remote-tracking branch 'origin/5.6' into devFrederik Gladhorn2016-01-081-6/+53
|\ | | | | | | | | | | Based on merge done by Liang Qi Change-Id: Id566e5b9f284d29bff2199f13f9417c660f5b26f
| * xcb: fix drag and drop when window is hiddenBłażej Szczygieł2016-01-051-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes drag and drop operation on XCB platform when window will be hidden. The window can be hidden during dnd operation by switching virtual desktops or by minimizing all windows (show desktop) using key shortcut. The ShapedPixmapWindow must grab mouse before dnd operation if mouse is not grabbed by other window (like in Qt4). Task-number: QTBUG-46243 Change-Id: I807bc842719a2d0ea0f4dcb733c06c1fd08813e1 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
| * xcb: Add Xinerama supportBłażej Szczygieł2015-12-221-6/+48
| | | | | | | | | | | | | | | | | | This patch makes possible to use Xinerama screens in XCB platform plugin. Task-number: QTBUG-48615 Change-Id: Ib4dbfcdfadc46d2875a2fc09e8b852181edfbed2 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-12-181-121/+152
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/painting/painting.pri src/plugins/platforms/xcb/qxcbconnection.cpp tests/auto/corelib/thread/qthreadstorage/qthreadstorage.pro tests/auto/corelib/tools/qlocale/test/test.pro tests/auto/gui/kernel/qwindow/tst_qwindow.cpp tools/configure/environment.cpp Change-Id: I9c40f458b89b2c206de2d2c24e90b5f679c93495
| * xcb: Use a placeholder QScreen when there are no outputs connectedBłażej Szczygieł2015-12-111-121/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If no screens are available, windows could disappear, could stop rendering graphics, or the application could crash. This is a real use case in several scenarios: with x11vnc, when all monitors are physically disconnected from a desktop machine, or in some cases even when the monitor sleeps. Now when the last screen is disconnected, it is transformed into a fake screen. When a physical screen appears, the fake QScreen is transformed into a representation of the physical screen. Every virtual desktop has its own fake screen, and primary screens must belong to the primary virtual desktop. It fixes updating screen geometry on temporarily disabled screens in the middle of the mode switch. Expected results: Windows don't disappear, the application doesn't crash, and QMenu is displayed on the appropriate screen. This reverts patch 51ada7734ad780178ecced11e0dff454dfc2e5f2 Change-Id: I6e8eb682b0c8425d08ffdaecbd4c6c7700c914b4 Task-number: QTBUG-42985 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* | Xcb: Fix debugging codeUlf Hermann2015-12-101-4/+7
| | | | | | | | | | | | | | | | | | | | We need to pass the correct connection and we need a specialization for reply pointers. Also, there is not much of a point in first creating a QString from a QByteArray, only to retrieve a QByteArray again. Change-Id: Ia1bb5655f6229638e3bd2339acadeffc80561b9e Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* | Use Q_UNLIKELY for every qFatal()/qCritical()Marc Mutz2015-11-291-2/+2
|/ | | | | | | | | | | | | | | | | | | | | If, after checking a condition, we issue a qFatal() or a qCritical(), by definition that check is unlikely to be true. Tell the compiler so it can move the error handling code out of the normal code path to increase the effective icache size. Moved conditional code around where possible so that we could always use Q_UNLIKELY, instead of having to revert to Q_LIKELY here and there. In some cases, simplified the expressions newly wrapped in Q_UNLIKELY as a drive-by. Change-Id: I67537d62b04bc6977d69254690c5ebbdf98bfd6d Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* xcb: Fix windows opened from keyboard are not active on Marco or Xfwm4Błażej Szczygieł2015-11-231-1/+5
| | | | | | | | | | | Windows opened from keyboard (e.g. keyboard shortcut) are not active on Marco or Xfwm4. These windows are under the window which received the key event. This patch fixes the problem by updating XCB timestamp on every key press like Qt4 does. Task-number: QTBUG-49567 Change-Id: I9ea483784ac361d0b645d0f11f643868b367ac2c Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* xcb: Process _NET_WORKAREA and screen geometry changes separatelyAlexander Volkov2015-11-171-1/+10
| | | | | | | | | | | | | | This commit allows to avoid superfluous calls to the X server. We don't request _NET_WORKAREA values when the screen geometry changes, and we avoid RandR calls on each _NET_WORKAREA change. Besides, update the available geometry of all screens with the same root window, rather than only that one which corresponds to Qt::Desktop window. Change-Id: I5ec624717f5f261c986cd9aaf2425f22985e11c0 Reviewed-by: Błażej Szczygieł <spaz16@wp.pl> Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* xcb: Handle screen siblings in QXcbVirtualDesktopAlexander Volkov2015-11-171-10/+5
| | | | | | Change-Id: I2f3c3ad75bb3914667cf6f27dc2d91aac103607b Reviewed-by: Błażej Szczygieł <spaz16@wp.pl> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* xcb: Use XShape for DnD when a compositing manager is not runningAlexander Volkov2015-10-141-3/+42
| | | | | | | | | Otherwise transparent areas of the drag'n'drop pixmap are painted with the black color. Task-number: QTBUG-45193 Change-Id: I55b7c7caababe13584fa1c7a52835f112e20f920 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Libraries: Fix single-character string literals.Friedemann Kleint2015-10-131-1/+1
| | | | | | | Use character literals where applicable. Change-Id: I8e198774c2247c1cc1d852a41b59b301199b7878 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* xcb: fix yet another crash when screens are disconnectedShawn Rutledge2015-09-241-2/+4
| | | | | | | | | Can't assume that m_screens is not an empty list. Task-number: QTBUG-42985 Change-Id: I6f9422638c219123dc898813910d03c7afbd1450 Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Silence the _COMPIZ_TOOLKIT_ACTION warning.Gatis Paeglis2015-09-221-1/+2
| | | | | | | | | | It is still unclear how to act on those messages. We are already doing this for other Compiz messages -_COMPIZ_DECOR_*. Change-Id: I45f76b5f56ee1b07eb4c7398cc85b5d7bed86c4c Task-number: QTBUG-46954 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* xcb: Compress mouse motion and touch update eventsGatis Paeglis2015-09-221-73/+147
| | | | | | | | | | | | | | | | | | | | | | The current version of the mouse motion event compression algorithm does not work with certain configurations - situations where we get one XCB_GE_GENERIC event between every XCB_MOTION_NOTIFY event. The new implementation tries to be less fragile. The previous approach checked "is *the next* event the same type as the current event", the new check asks "have we buffered more events of the same type as the current event". We buffer events of the same type only when the main thread is unresponsive. This patch adds event compression for XI_TouchUpdate in addition to the fix for motion even compression. Change-Id: Ie215eb5969e2060e463ebe48e3d3007390a30deb Task-number: QTBUG-40889 Task-number: QTBUG-47069 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Notify when the primary screen changesAleix Pol2015-09-081-6/+3
| | | | | | | | | | | | | Makes it possible to notify that the QGuiApplication::primaryScreen has changed. XCB backend adopts the new API, as it was accessing QGuiApplication private API directly. Change-Id: Icde05c44138265f865fa42d2cd6974c552fdc5e2 Task-number: QTBUG-38404 Task-number: QTBUG-40659 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* Harmonize input context selectionBernd Weimer2015-08-251-3/+0
| | | | | | | | | | | | | | | | | Input context selection works differently across platforms. On some platforms it is not possible to request a specific context at all (e.g. Wayland). This will be unified, depending on the environment variable "QT_IM_MODULE", you will get: - null: default (platform) context, if defined (otherwise no context) - empty: no context - set: set one, if it exists and is valid (otherwise no context) [ChangeLog][Platform Specific Changes] Haromnized input context selection. QT_IM_MODULE environment variable will be taken into account. Change-Id: Ic8f826fbc6ace25941cd19b9b086943e848fbe01 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Nedim Hadzic <nedim.hadzic@pelagicore.com>
* Merge remote-tracking branch 'origin/5.5' into devFrederik Gladhorn2015-08-061-19/+45
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: doc/global/qt-cpp-defines.qdocconf src/3rdparty/forkfd/forkfd.c src/corelib/codecs/qtextcodec.cpp src/corelib/kernel/qmetatype.cpp src/corelib/tools/qset.qdoc src/gui/accessible/qaccessible.cpp src/gui/image/qpixmapcache.cpp src/opengl/qgl.cpp src/tools/qdoc/generator.cpp src/widgets/kernel/qwidget.cpp tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp Change-Id: I4fbe1fa756a54c6843aa75f4ef70a1069ba7b085
| * Let the linker find xcb_poll_for_queued_event for usThiago Macieira2015-07-281-6/+9
| | | | | | | | | | | | | | | | It's more efficient than we are. This also enables the code to work in the unlikely case of an ELF platform without RTLD_DEFAULT. Change-Id: Ib306f8f647014b399b87ffff13f12f8aeeb2589a Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
| * Make the function pointer to xcb_poll_for_queued_event not a memberThiago Macieira2015-07-281-13/+20
| | | | | | | | | | | | | | | | | | | | | | | | In the normal case, this change is a no-op. In case RTLD_DEFAULT isn't defined, this makes the job of the optimizer easier to detect that the static variable is never modified and that it can do a lot of dead code elimination. This also enables the optimization in the next commit. Change-Id: Ib306f8f647014b399b87ffff13f12f40a359233b Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
| * xcb: Ignore disabling of outputs in the middle of the mode switchAlexander Volkov2015-07-221-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | X server may send RROutputChangeNotify event with null crtc and mode, when it switches an output mode. Request RROutputInfo to distinguish this case from the case when the output is explicitly disabled. Change-Id: I4c2356ec71dbcc8013009ea8a6f46dd11f19d6bb Task-number: QTBUG-44158 Task-number: QTBUG-46786 Task-number: QTBUG-46822 Reviewed-by: Daniel Vrátil <dvratil@redhat.com> Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
| * When a screen comes back online, the windows need to be told about itRalf Jung2015-07-221-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On my system, this fixes the misbehavior of Qt applications when the (only) active screen is switched, e.g. from an external screen to the laptop. This behavior is caused by the screen() of widgets to be set to NULL when their screen goes away. When a new screen comes online, the widgets *should* be told about it, but they are not. The only place that "maybeSetScreen" is called is when an existing screen changes its geometry, but not when a screen gets enabled without its geometry being affected in any way (e.g. because it was just disabled via xrandr, but has been connected all along). This makes sure that "maybeSetScreen" is also called when a screen gets enabled. Task-number: QTBUG-47041 Change-Id: Ic72d6beaa544bf9a4efdbea0830b1bc0d6ce5362 Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into HEADSimon Hausmann2015-07-171-0/+54
|\| | | | | | | | | | | | | Conflicts: src/plugins/platforms/windows/qwindowsopengltester.cpp Change-Id: Ia7abeba9395ccf84e2fa81b91a5725a86dedb9fe
| * xcb: set SM_CLIENT_ID propertyStefan Becker2015-07-081-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | SM_CLIENT_ID is required by kwin for proper session management. - move client leader initialization from screen to connection - add SM_CLIENT_ID property to client leader Change-Id: I19fb0d098811c865f6f13d5bc3e59a173c596a65 Task-number: QTBUG-46310 Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru> Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
| * xcb: Use _NET_FRAME_EXTENTS to get frame marginsAlexander Volkov2015-07-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Some window managers don't reparent the client window into the frame, so the old method of calculating frame margins by the geometries of the window and it's frame window is not suitable for them. Use it only as a fallback. Change-Id: Ie4d62370425effef4dd91bf27d98e3746e8a375e Task-number: QTBUG-2280 Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com> Reviewed-by: Uli Schlachter <psychon@znc.in>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-07-011-3/+8
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp src/corelib/global/qglobal.h src/corelib/global/qsysinfo.h src/corelib/global/qsystemdetection.h src/corelib/kernel/qobjectdefs.h src/plugins/plugins.pro tests/auto/widgets/itemviews/qlistview/qlistview.pro Change-Id: Ib55aa79d707c4c1453fb9d697f6cf92211ed665c
| * xcb: make it possible to disable gl integrationsLaszlo Agocs2015-06-221-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | By setting QT_XCB_GL_INTEGRATION to the special value "none", no plugins will be considered for loading. This matches what eglfs does with QT_QPA_EGLFS_INTEGRATION. This allows widget or raster-QWindow-only apps to start up faster by not spending time on plugin loading and potential initialization steps there. Task-number: QTBUG-46765 Change-Id: Ifeec3548a9b58f619a18e0be75fe4a9f489677a9 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devSimon Hausmann2015-06-031-44/+35
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qnamespace.qdoc src/corelib/io/qwindowspipereader.cpp src/corelib/io/qwindowspipereader_p.h src/corelib/statemachine/qstatemachine.cpp src/corelib/statemachine/qstatemachine_p.h src/plugins/platforms/xcb/qxcbconnection.h tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/auto/tools/qmake/tst_qmake.cpp tests/manual/touch/main.cpp Change-Id: I917d694890e79ee3da7d65134b5b085e23e0dd62
| * xcb: Use XIGrabDevice instead of xcb_grab_pointer with XI 2.2Laszlo Agocs2015-06-011-44/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch to using the pointer events from XI2 when touch is available (i.e. version is >= 2.2). This allows us to select and grab the button and motion events together with the touch ones. This prevents the issue of not getting touch events when grabbing via the plain xcb functions. To prevent touch sequences from being replayed after ungrabbing (for example after dismissing a popup that caused a grab), we try to accept touches via XIAllowTouchEvents. Unfortunately this leads to a deadlock and therefore we can only do it when we know we have a new enough libXi. This is a configure time check which is not ideal since the system on which apps run can have a newer libXi than the machine that did the Qt build, but seems like the best we can do. The environment variable QT_XCB_NO_XI2_MOUSE can be set to 1 in order to prevent processing mouse events through XInput. This restores the old behavior with broken grabbing. [ChangeLog][QtGui] Pointer event delivery on X11 is now done via XInput 2.2+ when available. Done-with: Michal Klocek <michal.klocek@theqtcompany.com> Done-with: Alexander Volkov <a.volkov@rusbitech.ru> Task-number: QTBUG-43525 Task-number: QTBUG-45054 Task-number: QTBUG-30417 Change-Id: I7cb2002b31bef4cd527aa427549dcf2d5467968e Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-271-2/+0
|\| | | | | | | | | | | | | | | Conflicts: src/tools/qdoc/tree.cpp tests/auto/gui/painting/qcolor/tst_qcolor.cpp Change-Id: Iaa78f601a63191fa643aabf853520f913f2f0fdc
| * Remove unused counter variableGatis Paeglis2015-04-231-2/+0
| | | | | | | | | | Change-Id: I4069fdb75c2ef27fd4ac30de0963472c89165b20 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-221-24/+50
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/statemachine/qstatemachine.cpp src/corelib/statemachine/qstatemachine_p.h src/gui/painting/qdrawhelper.cpp src/plugins/platforms/xcb/qxcbnativeinterface.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/plugins/platforms/xcb/qxcbwindow.h src/testlib/qtestblacklist.cpp src/tools/qdoc/node.cpp src/tools/qdoc/node.h tests/auto/gui/painting/qcolor/tst_qcolor.cpp Change-Id: I6c78b7b162001712d5774293f501b06b4ff32684
| * Make it possible to use the -visual argumentJørgen Lind2015-04-151-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | for xcb applications to use a specific visual id when creating windows. Also make it possible to retrieve the visual id of a specific window with QXcbWindowFunctions::visualId(QWindow *window). UINT_MAX is used as an invalid visualId. Change-Id: If62ada119ce8f9174cc211f53bbf1ce1bb7d021a Reviewed-by: Andy Shaw <andy.shaw@digia.com>
| * xcb: Handle XSettings for a virtual desktop rather than for an outputAlexander Volkov2015-04-101-22/+22
| | | | | | | | | | | | | | | | | | | | | | The virtual desktop may be composed of several outputs which are represented by the QXcbScreen class. XSettings are related to the virtual desktop, so introduce a QXcbVirtualDesktop class and store QXcbXSettings in it. Change-Id: Ib2261675ef8e5136592d4b856bc84646db3a3af4 Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
| * Add missing event types in printXcbEventGatis Paeglis2015-04-091-1/+10
| | | | | | | | | | | | | | | | And replace Xlib define GenericEvent with XCB define XCB_GE_GENERIC. Change-Id: Ie82cb7f58b18fc0d253e4b7fd65495608df0a7d9 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-011-61/+79
|\| | | | | | | | | | | | | | | Conflicts: src/testlib/qtestblacklist.cpp src/widgets/accessible/qaccessiblewidgets.cpp Change-Id: If032adb9296428f62384ed835dbf41ee7a0b886c
| * xcb: set WM_NAME window propertyShawn Rutledge2015-03-311-0/+1
| | | | | | | | | | | | | | | | | | | | Some older window managers and utilities still ignore _NET_WM_NAME. Task-number: QTBUG-42209 Change-Id: Iff93c8188a0a73b04cdf361add153cd818ac670f Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Martin Gräßlin <mgraesslin@kde.org> Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
| * xcb: Do not crash with VNCLaszlo Agocs2015-03-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When having a vnc server with pixel format bgr888, we may not have a working GL integration. (we may not have one regardless of the pixel format in fact) We should still keep on attempting to create a regular SHM window for RasterGLSurface windows too, to keep regular widgets apps working. Task-number: QTBUG-42776 Change-Id: Idbf8de29694613b240bd27affcc3d80810ce1460 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
| * xcb: Speed up screens' initializationAlexander Volkov2015-03-271-60/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | Use RRGetScreenResourcesCurrent to get the screen's outputs. It is fast but it may return nothing if the configuration is not initialized wrt to the hardware. Call RRGetScreenResources in this case to get the up-to-date configuration. Task-number: QTBUG-40207 Change-Id: I84dc8a45b89d0bf8881a72b02e81f701637cdb6a Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Daniel Vrátil <dvratil@redhat.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-03-241-5/+21
|\| | | | | | | Change-Id: If5d2e621c2fa5476c3ab687a3f4620c54fc3b32e
| * xcb: create a screen if dimensions are known but outputs are notShawn Rutledge2015-03-171-5/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This partially reverts 51ada7734ad780178ecced11e0dff454dfc2e5f2 because it's necessary to keep some scenarios with vnc and remote X servers working. When an application is starting, if we don't find the xrandr outputs but we know the dimensions of the screen, we should still be able to put windows onto that screen; but when we already had known xrandr outputs and then they were removed, that's the case where we want to stop rendering (and have no screen instances) until the screen(s) are reattached. Task-number: QTBUG-31389 Task-number: QTBUG-40174 Task-number: QTBUG-42985 Change-Id: I13d0996ba6ece78c4ebcd2c3a59f1617c1c7f0fa Reviewed-by: Uli Schlachter <psychon@znc.in> Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devSimon Hausmann2015-03-161-81/+215
|\| | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/xcb/qxcbnativeinterface.cpp src/plugins/platforms/xcb/qxcbnativeinterface.h Change-Id: I31b38ba439b9341d51a01c0fd54bea33f7410076
| * Fix segfault when requesting root window and there are no screensJan Kundrát2015-03-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was easy to hit with KDE Plasma 5.2.1; KWindowSystem called QX11Info::appRootWindow() which in turn tried to dereference a nullptr returned from QXcbConnection::primaryScreen(). #0 QXcbConnection::rootWindow (this=<optimized out>) at qtgui-5.5.9999/src/plugins/platforms/xcb/qxcbconnection.cpp:1303 #1 0x00007fc26da096d7 in QXcbNativeInterface::rootWindow (this=this@entry=0x7fc27d1734d0) at qtgui-5.5.9999/work/qtgui-5.5.9999/src/plugins/platforms/xcb/qxcbnativeinterface.cpp:425 #2 0x00007fc26da0ab21 in QXcbNativeInterface::nativeResourceForIntegration (this=0x7fc27d1734d0, resourceString=...) at qtgui-5.5.9999/work/qtgui-5.5.9999/src/plugins/platforms/xcb/qxcbnativeinterface.cpp:223 #3 0x00007fc27c563148 in QX11Info::appRootWindow (screen=screen@entry=-1) at qtx11extras-5.5.9999/work/qtx11extras-5.5.9999/src/x11extras/qx11info_x11.cpp:158 #4 0x00007fc27a98c444 in NETEventFilter::nativeEventFilter (this=0x7fc27d425b60, ev=0x7fc264004ad0) at kwindowsystem-5.7.0/work/kwindowsystem-5.7.0/src/kwindowsystem_x11.cpp:192 #5 0x00007fc2795d0a8a in QAbstractEventDispatcher::filterNativeEvent (this=<optimized out>, eventType=..., message=message@entry=0x7fc264004ad0, result=result@entry=0x7ffc96ecf348) at qtcore-5.5.9999/work/qtcore-5.5.9999/src/corelib/kernel/qabstracteventdispatcher.cpp:460 #6 0x00007fc26d9ea941 in QXcbConnection::handleXcbEvent (this=this@entry=0x7fc27d173580, event=event@entry=0x7fc264004ad0) at qtgui-5.5.9999/src/plugins/platforms/xcb/qxcbconnection.cpp:971 Change-Id: I98a5d767cd7e143f00666f6fc78e9dc10893513d Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
| * Improve handling of XRandR events in XCB backendDaniel Vrátil2015-03-111-80/+213
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Querying X server for data can be very expensive, especially when there are multiple processes querying it at the same time (which is exactly what happens when screen configuration changes and all Qt applications receive XRandR change notifications). This patch is aiming to reduce the number of queries to X server as much as possible by making use of detailed information available in the RRCrtcChangeNotify and RROutputChangeNotify events. Firstly, the backend now does not rebuild all QXcbScreens on any change (which involved the very expensive xcb_randr_get_screen_resources() call), but only builds the full set of QXcbScreens once in initializeScreens(), and then just incrementally updates it. Secondly, it avoids querying X server for all screens geometry as much as possible, and only does so when CRTC/Output change notification for a particular screen is delivered. As a result, handling of all XRandR events on screen change is reduced from tens of seconds to less then a seconds and applications are better responsive after that, because we don't block the event loop for long. The X server is also more responsive after the screen change, since we are not overloading it with requests. Change-Id: I9b8308341cada71dfc9590030909b1e68a335a1f Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | Merge remote-tracking branch 'origin/5.5' into devFrederik Gladhorn2015-03-091-10/+5
|\| | | | | | | Change-Id: I9d10911c51700965f2cf0e3173b88fd9116bd3ee
| * xcb: do not create a dummy QScreen when there are no outputsShawn Rutledge2015-03-061-10/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Whenever a QWindow is associated with a QScreen, the screen is expected to be a real working one, so that rendering continues to be possible. This partially reverts 52f5e50f11a3ba82e32dc2efc656e4021a3fa4f5 [ChangeLog][QPA][Xcb] If all QScreens (xcb outputs) are disconnected while an application is running, QGuiApplication::primaryScreen() will return null until a screen is connected again. Task-number: QTBUG-40174 Task-number: QTBUG-42985 Change-Id: Id1b29dd70eaf3f2e7fd477516ce7e2bf24e095f6 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devOswald Buddenhagen2015-03-031-37/+57
|\| | | | | | | | | | | | | Conflicts: src/plugins/platforms/xcb/qxcbscreen.cpp Change-Id: Ie42931791a849b34b63d814d2eb5ac653986d868
| * xcb: Don't log mouse moves by defaultShawn Rutledge2015-02-271-2/+4
| | | | | | | | | | | | | | | | | | It produces too much log output, so now it must be enabled by both defining Q_XCB_DEBUG and enabling the qt.qpa.input category. Change-Id: Id2eb7545a7cd07dadd70da31a1f17c2999feec0d Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
| * Decide whether to synthesize mouse events on a per device basisAlexander Volkov2015-02-251-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently Qt uses the QPlatformIntegration::StyleHint SynthesizeMouseFromTouchEvents to check whether to synthesize mouse events from touch events. But not only platform plugins can produce touch events, they can be created by e.g. QTest::touchEvent() and in this case we almost definitely need synthesizing regardless of the platform. This commit introduces a QTouchDevice::MouseEmulation capability which replaces use of the QPlatformIntegration::SynthesizeMouseFromTouchEvents. So it's possible to pass QTouchDevice without this capability to QTest::touchEvent() and be sure that mouse events will be synthesized. Notice that touch pads always emulate mouse events. As a result we can activate some tests which were disabled for specific platform configurations by commits 6c1670d8c273819435867c42725c0db0eee597dc and e9760f1559361c39f269fb89f1ebd01f6ee8378d. Change-Id: Idc82fa4007a095fc1cb5934979361b0023d2b793 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>