summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbwindow.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Add correct event mask for Qt::WindowTransparentForInput in xcb pluginJørgen Lind2011-11-151-1/+5
| | | | | Change-Id: I4c683c08876cc6fa934971399af7e48b160168fc Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Properly handle position in non-synthetic ConfigureNotify with xcbLaszlo Agocs2011-11-151-1/+18
| | | | | | | | | | | | | | | The received window position cannot be trusted blindly, e.g. in case of resizing a window via the mouse or calling showMaximized() the position is bogus (for our purposes). Instead, it needs to be queried. Before 37f338e5edc6d7b70b5a4eaf63326f2a22d7bfbd an incomplete workaround was in place however it got removed in that commit, resulting in weird off-by-a-certain-amount mouse position issues in certain use cases. This patch aims to fix the issue similarly to how it was done in Qt4. Change-Id: I2d2a69b81a2782117b700fe366fae4c102aca1f4 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Support 31 mouse buttons (with platform plugins xcb and xlib).Rick Stockton2011-11-141-9/+30
| | | | | | | | | | | | | This commit includes changes for mouse button support within the XCB and XLIB platform plugins. Support in other platform plugins will be added in the future. The namespace update is prerequisite to compile the the Plugins, and the update in qguiapplication.cpp is required for the enhancements to actually work. Task-number: QTBUG-22642 Change-Id: Ie18fca3b9c86d0b6abbf2103a4f8582e6ce83e7d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Add multipoint touch support for Harmattan to the xcb platform plugin.Jocelyn Turcotte2011-10-171-0/+21
| | | | | | | | | | | Proper multipoint touch support was only introduced in XInput2.1, but Harmattan uses a tweaked version of XInput2.0 that transfers touch data through mouse events. This patch applies on the xcb plugin a subset of the changes that were applied on the Qt 4.7 that was shipped to Harmattan to get similar multipoint touch support. Change-Id: Ifda7ad40de29d7ded1443d4f78b3ec3807303a9f Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
* Do not fail user time window creation when xcb is using xlibLaszlo Agocs2011-10-171-2/+6
| | | | | | | | | | | | | | | | | | | QXcbWindow::updateNetWmUserTime() creates a new window using the actual window as its parent. This operation was failing when Xlib usage and GLX (or EGL) was enabled because in these cases the real window was created with a different visual using XCreateWindow. For the user time window however we were passing the xcb_screen's root_visual always, and this cannot work when Xlib+GLX/EGL is in use, resulting in a BAD_MATCH (followed by some annoying flicker on the screen on Ubuntu at least, or a full log off (X crash?) on Fedora). The patch saves the visual id used to create the actual window and passes that when creating the user time window. This way the creation of the user time window succeeds with Xlib+GLX too. Change-Id: If3925d9ac1670d385dcc7c2b475c196908569f06 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Minor build fix for newer XCB versionsJani Uusi-Rantala2011-10-101-0/+1
| | | | | | | | | | - Defines XCB_WM_STATE_WITHDRAWN as XCB_ICCCM_WM_STATE_WITHDRAWN if necessary Change-Id: I4212a0e1d7f14ac6695d23d6586dd97f898d3f2b Signed-off-by: Jani Uusi-Rantala <jani.uusi-rantala@nokia.com> Reviewed-on: http://codereview.qt-project.org/6267 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Make sure window state is synced back to Qt from the XCB plugin.Samuel Rødal2011-10-071-0/+47
| | | | | | | | | | We should properly react to the property notify events. Task-number: QTBUG-21856 Change-Id: I0d2aa90b7d8da3b96acf4d88684b0200de7d7413 Reviewed-on: http://codereview.qt-project.org/6266 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix QMouse/Wheel/TouchEvent::modifiers with the XCB back-endSimon Hausmann2011-10-071-7/+10
| | | | | | | | | | | | The modifiers are provided by X and need to be propagated through the QWindowSystemInterface. Change-Id: I127d0b6e9918b558ca15d9302c4cc0cbd94eb757 Reviewed-on: http://codereview.qt-project.org/6244 Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com> Sanity-Review: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
* Fix XCB back-end on HarmattanSimon Hausmann2011-10-041-3/+15
| | | | | | | | | | | Use RGB16 as image format on 16-bpp displays. Based on patch by Jocelyn Change-Id: Ic91ab33132769da59a2097abb43b64a2d09c0009 Reviewed-on: http://codereview.qt-project.org/5971 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Make qtbase build with Qt-in-namespace againKent Hansen2011-09-281-0/+4
| | | | | | | Change-Id: I5faa8690a05d6ec352fc69c0b69848539f2ed216 Reviewed-on: http://codereview.qt-project.org/5460 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Implemented QWidget's move() vs setGeometry() distinction in QWindow.Samuel Rødal2011-09-231-3/+8
| | | | | | | | | | | | | | QWidget's move() sets the position of the window including the window frame, unlike setGeometry(). There was no equivalent for this in QWindow, so several QWidget auto-tests were failing. Now we add setFramePos() to achieve the same purpose in QWindow. This fixes tst_QWidget::windowState(), which uses move(). Change-Id: I9a3e558bd615a8f0234cc3dd94fbb2bf5ecbc148 Reviewed-on: http://codereview.qt-project.org/5405 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Don't flood expose events in the xcb plugin.Samuel Rødal2011-09-231-1/+11
| | | | | | | | | | | | The X server sends a series of expose events, where the count member specifies how many expose events are remaining in the current series. By merging them into an expose region we can send a single expose event to the lighthouse interface. Change-Id: If73c9972fe02c5e4137e8742aaaf5679ccea5a09 Reviewed-on: http://codereview.qt-project.org/5366 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Only set frame margins as dirty when we get a configure notify event.Samuel Rødal2011-09-231-5/+2
| | | | | | | | | | | It's dangerous to set them as dirty in anticipation of a configure notify event, as if frameMargins() is called before the event is received the computed values are bogus. Change-Id: Ib6db975fba5fcb13a2511e4716cbb5ca79265c34 Reviewed-on: http://codereview.qt-project.org/5365 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fixed geometry issues.Samuel Rødal2011-09-231-9/+3
| | | | | | | | | | | We need to compare against the window's currently known geometry to know when to send resize and move events. Also make sure at least one resize event is sent, instead of sending one before each expose. Change-Id: Id7ebe4c1c0e723af9198c668a0c736d64efdbf3e Reviewed-on: http://codereview.qt-project.org/5364 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Add Qt::WindowTransparentForMouseEventsLars Knoll2011-09-211-0/+39
| | | | | | | | | | | Add a flag for output only windows that are transparent for mouse events and implement it for the xcb backend. Change-Id: I24afdb6b27de34bcdf0c061a5a4987ac2880e4ae Reviewed-on: http://codereview.qt-project.org/5260 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Fix xcb-icccm 3.8 supportJędrzej Nowacki2011-09-151-3/+15
| | | | | | | | | Build fix on platforms having xcb-icccm >= 3.8 Change-Id: Ia20c9a439d57e147db90d635679e471bfa02c840 Reviewed-on: http://codereview.qt-project.org/4779 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Cocoa: Fix qmlscene flicker on startup.Morten Sorvig2011-08-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | The SG render thread was racing window creation in the GUI thread, which would cause flicker if the window won the race and was shown before the SG thread had a frame ready. Send a synchronous expose event before showing the window - this will wait for the SG render thread. In addition, don't defer NSwindow creation. The GL context setup is done before the window is shown and needs a fully created window. New API: QWindowSystemInterface::handleSynchronousExposeEvent Retire: QWindowSystemInterface::handleExposeEvent Change-Id: I0bb46089d16ec4882aaac8db67b57d15e0f51531 Reviewed-on: http://codereview.qt.nokia.com/3399 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@nokia.com>
* Always relay configure notify events from XCB plugin.Samuel Rødal2011-08-291-3/+0
| | | | | | | | | | QWindow no longer sets its geometry member in setGeometry(), so it needs to happen through handleGeometryChange() from the platform plugin. Change-Id: Ia22b788c65dba4fc4b1efed1965ccd9473f1f743 Reviewed-on: http://codereview.qt.nokia.com/3709 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* xcb: Disable GLX when xcb-xlib is not present due xlib usageHolger Hans Peter Freyther2011-08-261-1/+1
| | | | | | | | | | The GLX and EGL code is using DISPLAY_FROM_XCB which requires xlib support, disable GLX when when xlib is not present. Change-Id: I55126e48e52390fdcfb1348a11fbf9628d32b13c Reviewed-on: http://codereview.qt.nokia.com/3665 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* xcb: Be able to compile without xlib supportHolger Hans Peter Freyther2011-08-261-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use XCB types for events instead of indirectly depending on Xlib includes because of the GLX includes. Manually verified the right values. ButtonPressMask (1L<<2) XCB_EVENT_MASK_BUTTON_PRESS = 4, define ButtonReleaseMask (1L<<3) XCB_EVENT_MASK_BUTTON_RELEASE = 8, ButtonMotionMask (1L<<13) XCB_EVENT_MASK_BUTTON_MOTION = 8192, EnterWindowMask (1L<<4) XCB_EVENT_MASK_ENTER_WINDOW = 16, LeaveWindowMask (1L<<5) XCB_EVENT_MASK_LEAVE_WINDOW = 32, PointerMotionMask (1L<<6) XCB_EVENT_MASK_POINTER_MOTION = 64, GrabModeAsync 1 XCB_GRAB_MODE_ASYNC = 1 Change-Id: I1fade68947b1e2f39ca3514573c10fae7ee2dfb1 Reviewed-on: http://codereview.qt.nokia.com/3664 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix some compiler warnings, shut up QIbusPlatformInputContext.Friedemann Kleint2011-08-261-1/+0
| | | | | | Change-Id: Idadf40b2bbe53928d8577a099f38a2be0a2d6e16 Reviewed-on: http://codereview.qt.nokia.com/3640 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Merge branch 'master' into refactorGunnar Sletta2011-08-251-0/+10
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qapplication_qpa.cpp src/gui/kernel/qcursor_qpa.cpp src/gui/kernel/qwindowsysteminterface_qpa.cpp src/gui/kernel/qwindowsysteminterface_qpa.h src/gui/kernel/qwindowsysteminterface_qpa_p.h src/gui/text/qtextcontrol.cpp src/plugins/platforms/wayland/wayland.pro src/widgets/accessible/qaccessible2.h src/widgets/widgets/qwidgetlinecontrol_p.h Change-Id: I5e6f4eb184159dccc67e8f13673edb884d179c74
| * support xcb-icccm 3.8Oswald Buddenhagen2011-08-051-0/+10
| | | | | | | | | | | | | | | | | | this is a rather crude hack, but whatever. Change-Id: I3fa363572842b207202d4aac8526951c0e16bf5b Reviewed-on: http://codereview.qt.nokia.com/2602 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* | Prevent X errors being generated when setting 0 as width or height.Samuel Rødal2011-08-191-0/+3
| | | | | | | | | | | | | | Change-Id: I38b12471f2c327952c4b5f6acb01c1f1ef53da28 Reviewed-on: http://codereview.qt.nokia.com/2823 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
* | Removed unnecessary debug output in xcb plugin.Samuel Rødal2011-08-101-5/+0
| | | | | | | | | | | | | | Change-Id: I3b354a8649971a5d8c68a0b4f6bbdf6475116d65 Reviewed-on: http://codereview.qt.nokia.com/2808 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* | Properly initialize window properties in xcb plugin.Samuel Rødal2011-08-051-2/+3
| | | | | | | | | | | | | | | | | | Since 833090abb9a277 these need to be called manually. Change-Id: Iabc263d499e724d4d39c3d8350563feb57749879 Reviewed-on: http://codereview.qt.nokia.com/2704 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* | Added workable QScreen API on top of QPlatformScreen.Samuel Rødal2011-07-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QPlatformIntegration::screens() no longer has to be implemented, implementations should call QPlatformIntegration::screenAdded() for each screen instead. This is for being able to support adding screens at run-time later on, by connecting it to a signal in QGuiApplication. The QGuiGLContext API has changed a bit, by not sending in all the parameters in the constructor but instead having a create() function. The createPlatformGLContext() factory in QPlatformIntegration takes a QGuiGLContext * instead of a QSurfaceFormat and a share context, similar to how the window and backing store factory functions work. The XCB plugin has experimental support for connecting to multiple X displays simultaneously, creating one or more QScreen for each. Change-Id: I248a22a4fd3481280710110272c04a30a8021e8f Reviewed-on: http://codereview.qt.nokia.com/2103 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* | OpenGL API refactor.Samuel Rødal2011-06-211-26/+33
| | | | | | | | | | | | Rename QGuiGLFormat to QSurfaceFormat, and make QWindow sub-class of QSurface and QPlatformWindow sub-class of QPlatformSurface, instead of having QPlatformGLSurface accessor in QWindow.
* | Rename QWindowSurface -> QBackingStore and split into platform / public.Samuel Rødal2011-06-211-7/+3
| | | | | | | | Also get rid of GL window surface and related classes.
* | Use XCB_GRAVITY_STATIC in XCB plugin for frame independent geometry.Samuel Rødal2011-06-101-0/+2
| |
* | Added frameMargins() API and support in XCB plugin.Samuel Rødal2011-06-101-0/+92
| |
* | Fix QtPlatformSupport when compiling with glx and xcbJørgen Lind2011-06-101-2/+2
| |
* | QtPlatformSupport: A helper library for platform pluginsJørgen Lind2011-06-101-5/+5
| | | | | | | | | | | | | | | | QtPlatformSupport is a static library. Platform plugins are meant to link against this library to pull in dependencies such as fontengines and convenience functions for finding the right GL configs. The linker will only pull in the symbols used, so the size of the library doesn't really matter
* | QWindowContext / QWindowFormat refactor.Samuel Rødal2011-06-101-25/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | To enable having a single GL context used for multiple drawables we need to de-couple the context class a bit more from the window class in the plugin API. Now contexts are created stand-alone based on a GL format and a share context, and when calling makeCurrent() a desired surface is specified. This maps well to GLX, EGL, Cocoa, AGL, and WGL, which all support this use case. QWindowContext is renamed to QGuiGLContext, and QWindowFormat is renamed to QGuiGLFormat. We have the ability to introduce a pbuffer or similar other offscreen GL drawable abstraction in the future.
* | Cursor support in xcb plug-in.Laszlo Agocs2011-06-081-0/+6
| | | | | | | | | | | | | | Custom cursor pixmaps with depth greater than 1 are not yet supported and will be converted to monochrome always. Reviewed-by: Samuel Rødal
* | Fix behaviour after WM_TAKE_FOCUSLars Knoll2011-06-081-1/+0
| | | | | | | | | | | | | | We should not call requestActivateWindow() in reaction to WM_TAKE_FOCUS. Looks like it should only be done if the focus should in fact go to a modal child of the widget.
* | cleanups codeLars Knoll2011-06-071-2/+2
| | | | | | | | | | | | | | Make QXcbClipboard and QXcbDrag a QXcbObject to simplify the code. Use the predefined atoms in xproto.h instead of our own defines.
* | Fix some remaining issues with DnDLars Knoll2011-06-071-1/+0
| | | | | | | | | | | | | | | | | | Do not set the event mask of the window we drop onto to NO_EVENT. Always use the clipboards requestor window to convert selections. Reviewed-by: Samuel
* | add WM support classLars Knoll2011-06-071-4/+50
| | | | | | | | | | | | | | | | | | Add a QXcbWMSupport class to better integrate with NET_WM compliant window managers. Suppport NET_WM_USER_TIME on windows. Reviewed-by: Samuel
* | Implement XDnD in the xcb pluginLars Knoll2011-06-071-0/+10
| | | | | | | | | | | | | | | | | | Ported most of the code to support dragging from qdnd_x11.cpp to xcb. Some features are still not working 100% correct, but it's becoming usable. Reviewed-by: Samuel
* | X11 DnD implementationLars Knoll2011-06-071-1/+17
| | | | | | | | | | | | | | | | | | | | | | Initial code for DnD on X11. Only Xdnd based, Motif DnD is being ignored. The code is currently limited to dropping stuff onto the application. Starting drags is not yet implemented. Reviewed-by: Samuel
* | Made tst_QWidget::updateWhileMinimized() pass.Samuel Rødal2011-06-061-2/+12
| | | | | | | | | | | | | | | | | | | | This requires adding a couple of window system interface events, namely Map, Unmap, and Expose. When a widget is minimized on X11 it is unmapped, and thus update requests should not be delivered. Instead the event will delivered when the widget is mapped, which causes an Expose event to be sent. The Unmap and Expose event thus need to be handled in QWidgetWindow, and Map is also added for the purpose of API symmetry (and for future needs).
* | Avoid setting the active window to null when there is a FocusIn queued.Laszlo Agocs2011-06-061-1/+15
| |
* | Basic QDesktopWidget support.Samuel Rødal2011-06-031-0/+9
| | | | | | | | | | Makes it possible to use grabWindow on the desktop widget with the xcb plugin, which gives us a few more passing tests in tst_QWidget.
* | Add support for mouse and keyboard grab.Laszlo Agocs2011-06-031-0/+37
| | | | | | | | Reviewed-by: Samuel Rødal
* | Get rid of superfluous debug output in the xcb plugin.Samuel Rødal2011-06-031-4/+0
| |
* | Have tooltips shown properly with xcb.Laszlo Agocs2011-06-011-1/+1
| |
* | Prevent XSetInputFocus BadMatch errors.Samuel Rødal2011-06-011-2/+14
| | | | | | | | | | | | The BadMatch errors are generated if XSetInputFocus is called before the window has been mapped, so we need to set a flag when we get the map notify event.
* | Do not choke on zero-sized windows.Laszlo Agocs2011-06-011-1/+4
| | | | | | | | | | | | Configure requests with zero width or height will always fail with BadValue and have to be avoided. Same goes for shm segments of size 0.