summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylandwindow.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Merge remote-tracking branch 'qt/5.10' into devPaul Olav Tvete2017-10-271-11/+18
|\| | | | | | | | | | | Change-Id: I4f885a551093ada07da97fd3d99902e36f98595e
| * | Merge remote-tracking branch 'qt/5.9' into 5.10v5.10.0-beta3Paul Olav Tvete2017-10-251-11/+18
| |\| | | | | | | | | | Change-Id: I6c283081669594b3e8c6b30194bb96e389319cb2
| | * Ensure QWaylandWindow::transientParent has a shell surfaceJohan Klokkhammer Helsing2017-10-251-11/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This may not be a perfect solution, but it's better than the current one, where the transient parent may not have a shell surface (because the window may be hidden or not yet initialized). Task-number: QTBUG-63840 Change-Id: Ia5f04376d4b6d12b41ceeab5ba13cdc1b63b4e3c Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| | * QWaylandWindow: reset window should reset maskChristophe Chapuis2017-10-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When QWaylandWindow::reset() is called, the window's mask is not changed. It means that when the window will be initialized again, it will not re-send the mask description to the server side through Wayland. Task-number: QTBUG-62638 Change-Id: I07d561f466836bbd90ae58521c0768ed85554256 Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Christophe Chapuis <chris.chapuis@gmail.com>
* | | Tests: Add missing Q_UNUSEDsJohan Klokkhammer Helsing2017-10-161-0/+1
| | | | | | | | | | | | | | | Change-Id: Ifc7e5d000b7f5d75fb899d2294008f8dcabca777 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
* | | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-09-271-10/+87
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/client/qwaylandwindow.cpp src/client/qwaylandwindow_p.h src/compositor/compositor_api/qwaylandpointer.cpp Change-Id: Icbc22a1ae3cdd9cde438742817d07fccf97f647b
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-09-201-10/+87
| |\| | | | | | | | | | Change-Id: I76bfc271efcf75c75bf38f4bf58503e1d2a00839
| | * Set window screen from wl_surface.enter and leave eventsJohan Klokkhammer Helsing2017-09-111-3/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removes the pointer mScreen, which would previously cause a crash if the screen was removed. Ensures that QWindow::screen() is correct, except in the cases where: - The compositor has not yet sent enter and leave events (in which case the primary output is returned). - The compositor is not sending enter and leave events (although this is mandatory, some compositors don't do this). - The application developer has tried to move the window with QWindow::setScreen(QScreen *). Since there is no way for a client to ask to be moved to a specific monitor in windowed mode, we return the requested screen until a new enter or leave event is received. This will also be useful when implementing/fixing features where the current screen matters. Examples are QT_AUTO_SCREEN_SCALE_FACTOR and the optional output parameter to wl_shell_surface.set_fullscreen. Task-number: QTBUG-62044 Change-Id: Iafde2e278fbc8876e8dafe5b2a4d2482fdc7961a Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| | * Close popups in the correct orderPaul Olav Tvete2017-09-071-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | According to the protocol, child popups have to be closed before parents, but QMenuBar/QMenu will sometimes close the parent first. Change-Id: Id027ac483b727a19388df619fe1503d794e12c12 Task-number: QTBUG-62048 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
| | * Fix crash when window attach is called without waiting for frame callbacksJohan Klokkhammer Helsing2017-08-311-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If QWaylandWindow::attach was called before getting the frame callback, it would overwrite mFrameCallback. Hence, all but the last frame callback would still be alive after the QWaylandWindow destructor. When the dangling callbacks got invoked the data pointer was statically casted to the deleted QWaylandWindow, resulting in undefined behavior. In this change we only delete frame callbacks from the render thread, avoiding a race condition we fixed earlier. And we always destroy the frame callback when adding a new one, ensuring that the destructor will clean up the only remaining callback. There's a test confirming that the crash has been fixed. This fixes the flakiness of many of the qtbase auto tests. Change-Id: Iecb08ab48216eac61b1ebc5c0e0664d4aac900c0 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | Replace Q_NULLPTR with nullptrKevin Funk2017-09-261-2/+2
| | | | | | | | | | | | | | | | | | | | | Change-Id: I9699a957430b8d3574ce29acb91b7ada9ea6209b Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com> Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Temporarily rename QWaylandWindow::screen to waylandScreenJohan Klokkhammer Helsing2017-09-131-1/+1
|/ / | | | | | | | | | | | | | | | | | | The function is being made virtual in qtbase. Rename it to avoid issues with CI (missing override). It can be renamed back and made to override later. Task-number: QTBUG-63177 Change-Id: I4e3029445b34c53bfdd3e99254a690a1fac6f06e Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io> Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-08-171-1/+5
|\| | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Ia0f9d099e92a40cae7ec506781f70c56415bcf89
| * Fallback to focusWindow as transient parentMarco Martin2017-08-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The wayland protocol requires Popup windows to have a transient parent set, in order to correctly position the window on the screen. In Qt, some popup menus don't have it, so they will appear misplaced in the screen. This adds an heuristic which makes transientParent() return the current application focus window, which is an approximation which won't be always correct, but seems to fix most applications Task-number: QTBUG-60932 Change-Id: Icec1e306d3f64f4f00ad735a8c2eedb99e85eabb Reviewed-by: Johan Helsing <johan.helsing@qt.io>
| * Reset mFrameCallback in destructionDavid Edmundson2017-07-191-1/+3
| | | | | | | | | | | | | | | | Otherwise we crash if we call reset twice. For example if we call setParent and setVisible together. Change-Id: I7f07825167bf8c3236a80e649a6d6805fd6c868b Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Send SurfaceCreated and SurfaceAboutToBeDestroyed events for wl_surfaceJohan Klokkhammer Helsing2017-06-091-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the events were matching the life cycle of QWaylandWindow. This commit changes it so the events are matching the life cycle of wl_surfaces instead (a QWaylandWindow can outlive several wl_surfaces). Some of these events were already sent in QWindowPrivate (the first and last). Now we handle the cases where the wl_surface is destroyed and recreated due to hiding/showing the window or when changing the role of the wl_surface. Task-number: QTBUG-58423 Change-Id: Ie4a4e7dd529e1a41a2cf42e02cebb3c8aca4a4cc Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com> Reviewed-by: Marco Martin <notmart@gmail.com>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-06-071-43/+52
|\| | | | | | | | | | | | | | | Conflicts: .qmake.conf src/client/qwaylandwindow.cpp Change-Id: I3ae070ff20df4b858a4eef769438092c061e47ef
| * Fix setting the window stateGiulio Camuffo2017-05-261-0/+4
| | | | | | | | | | | | Change-Id: I236095aa9103a2a35ecd79e747b8d1ee843a98f1 Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
| * Match WaylandWindow scale to what we set on the buffer, not the screenDavid Edmundson2017-05-181-2/+6
| | | | | | | | | | | | | | | | | | Currently if the screen scale changes we report a new devicePixelRatio to rendering but we don't send a new set_buffer_scale nor do we update the buffer sizes. This leaves us in a corrupt state. Change-Id: I5bb2bd5eec440cd1ce9080cd3a3dc65448f68298 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
| * Pass modifiers with wheel eventsDavid Edmundson2017-05-121-2/+2
| | | | | | | | | | Change-Id: I345cdeea1357a8f9201a74b2d5e80350b6c42f24 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
| * Don't depend on shell extensionPaul Olav Tvete2017-04-271-39/+40
| | | | | | | | | | | | | | The mininimal-cpp compositor example does not have any shell extensions. Change-Id: I925450a75ab6f93245ca9897bbc6f092d93364b6 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-04-211-6/+22
|\| | | | | | | Change-Id: I7285dfeaac0d7963607930904aa017bedb1e48ab
| * Clean up draganddrop and clipboard featuresPaul Olav Tvete2017-03-231-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | Don't assume that no-draganddrop implies no-clipboard. Introduce a new private feature wayland-datadevice which contains the common functionality. This feature cannot be controlled independently, but is automatically disabled when both clipboard and draganddrop are disabled. Change-Id: I6aac09c7ee524e3b11f0a1caa4a6c62fc3f1d10f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Johan Helsing <johan.helsing@qt.io>
| * Remove QRegularExpression dependencyPaul Olav Tvete2017-03-021-1/+3
| | | | | | | | | | | | | | | | | | Fix build error with -no-feature-regularexpression. Change-Id: I6d3d0228548d832abea74b8e1145dc5b09f77b1b Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
| * Merge remote-tracking branch 'qt/5.8' into 5.9Paul Olav Tvete2017-03-011-3/+13
| |\ | | | | | | | | | Change-Id: I43cd0147a63b5523e3112f09bbfe60e1d6636e6c
| | * Initialize the first wl_surface in the constructor of QWaylandWindowJohan Klokkhammer Helsing2017-02-221-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes it possible to get a pointer to a wl_surface immediately after platform window creation. Task-number: QTBUG-58423 Change-Id: I2e62380af8b34d05ae31baacc071766493633022 Reviewed-by: Marco Martin <notmart@gmail.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
| | * Merge remote-tracking branch 'origin/5.8.0' into 5.8Liang Qi2017-01-261-2/+6
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.h Change-Id: Ie45a13d3c866d0503e6e31b2a53b70f3420c5066
| | | * Don't call wl_surface::destroy if the surface was never initializedJohan Klokkhammer Helsing2017-01-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-57757 Change-Id: I85b74a3445c8d9df1a89b16760ce57e45204d2c6 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
| | | * Fix crash when starting clientsJohan Klokkhammer Helsing2017-01-031-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't send wl_surface::set_input_region requests before the wl_surface has been initialized. The shapedclock example used to crash in wl_proxy_marshal prior to this fix. Task-number: QTBUG-57757 Change-Id: I0a459d374bfb88fb22d048eda3722a41112d67a4 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | | Adapt to the API change in QPlatformWindow::setWindowStateOlivier Goffart2017-03-281-24/+19
|/ / / | | | | | | | | | | | | Change-Id: Ic6655f239ea449baf862934608feda182799c42d Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-251-0/+11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf examples/wayland/custom-extension/client-common/main.cpp src/client/qwaylandwlshellintegration_p.h src/client/qwaylandxdgshellintegration_p.h src/compositor/compositor_api/qwaylandquickoutput.h src/plugins/shellintegration/ivi-shell/qwaylandivisurface_p.h Change-Id: Ic78c610ddf102b0a185294f625bbfcb9238b0f3c
| * | Fix build without feature.cursorTasuku Suzuki2017-01-131-0/+8
| | | | | | | | | | | | | | | Change-Id: If244e7ac58133ae6fbefacfa243d47fa210140be Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | Fix initial window property values being propagatedRobert Griebl2016-12-161-0/+3
| |/ | | | | | | | | | | | | | | This was broken since the the shell-surface refactoring. Change-Id: I130b7396e85c570a9d11d609af6b3016e3f706f0 Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* / Add xdg_shell_v6 support for Qt clientsGiulio Camuffo2016-12-021-6/+13
|/ | | | | | | Task-number: QTBUG-56174 Change-Id: I6610905d0c9f29be29e812bcac193ea2a7e4f107 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* Use new feature system, part 2Lars Knoll2016-11-231-1/+1
| | | | | | | | | Convert all uses of QT_NO_FOO to proper QT_CONFIG(foo) checks. Change-Id: Id0f0b3325c246567a43d6b2d71b0d69e5535e648 Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Don't reset the cursor at every mouse moveGiulio Camuffo2016-11-221-5/+1
| | | | | Change-Id: I67f9a0d171da403ebb124ab584c2510891da80fc Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Create and destroy the shell surface when showing and hidingGiulio Camuffo2016-11-171-47/+43
| | | | | | | | | | | | | | | | | | This changes the shell surface handling for windows, and instead of creating the shell surface at initialization time, and then attaching a null buffer to hide it, it creates the shell surface on setVisible(true), and destroys it on setVisible(false). This fixes hiding when using xdg_shell, as that interface defines that attaching a null buffer to an xdg_surface is an error. Also this should help with bugged EGL drivers which attach a buffer after eglSwapBuffers() returns, which used to cause a newly hidden window to get a new valid buffer after we attached a null one, showing it again. Task-number: QTBUG-47902 Change-Id: I8e0a0442319a98cc1361803ea7be1d079b36fc8c Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Remove useless method QWaylandShmBackingStore::hiddenJohan Klokkhammer Helsing2016-11-111-3/+0
| | | | | | Change-Id: I8e28d3c1dc2c2bbff4517ffe3b2f63c2ac86b95f Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Remove QWaylandWindow::shellManagesActiveStateJohan Klokkhammer Helsing2016-11-101-5/+0
| | | | | | | | | | | | If m_shellSurface was deleted, there was no way for QWaylandDisplay to know whether the shell handled window deactivation or not. The shell integration now always handles the window active state. The default implementation of QWaylandShellIntegration will make a window active on keyboard focus. Change-Id: I80cfce9976b1d3c57094fdd8980c9110b873f239 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Merge remote-tracking branch 'qt/5.7' into 5.8Paul Olav Tvete2016-11-101-2/+6
|\ | | | | | | Change-Id: Ibfe6fe6ed983b537d55544883b7dc75e5cc3fc37
| * Merge remote-tracking branch 'qt/5.6' into 5.7Paul Olav Tvete2016-11-101-0/+7
| |\ | | | | | | | | | Change-Id: I1efd16d6c5f939d61001376c3b010eae1927595b
| | * Fix build when some features are disabledPaul Olav Tvete2016-11-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make QtWaylandClient compile when Qt is configured with: -no-opengl -no-accessibility -D QT_NO_CLIPBOARD -D QT_NO_DRAGANDDROP -D QT_NO_SESSIONMANAGER Task-number: QTBUG-56192 Change-Id: Idc6aae6b36a35515109a27bed31a22e3e909ef27 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
| | * Client: Call parent requestUpdate after changing subsurface positionJohan Klokkhammer Helsing2016-10-261-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling setPosition on a child window would not send the appropriate commit request after the wl_subsurface.set_position request. Task-number: QTBUG-52118 Change-Id: I792016ce7e0a5a2efd3a32a98727b43ee0275b0e Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
| | * Client: Remove windows from keyboard focus list when destroyedJohan Klokkhammer Helsing2016-10-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the undefined behavior in tst_WaylandClient::touchDrag and mouseDrag Note: The test still fails if run twice in a row, but it appears to be deterministic. Task-number: QTBUG-56187 Change-Id: Ib45d82224f004d1324f2ce4d6b7df05ee36c04f5 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> (cherry picked from commit 0049240a2b7d8691f09224e1542919ddbbb0d864) Reviewed-by: Johan Helsing <johan.helsing@qt.io>
| * | Call formatWindowTitle on the window titleMartin Gräßlin2016-10-111-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to QWidget::setWindowTitle documentation the QPA plugin is responsible for adding the application name to the window title. As it's supposed to be done for Unix platform the Wayland QPA also needs to perform this task. Task-number: QTBUG-56475 Change-Id: Ib261c68d08ca06d1ec4734c8c215a4ceb059fae3 Reviewed-by: Johan Helsing <johan.helsing@qt.io> Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org>
* | | Client: Remove windows from keyboard focus list when destroyedJohan Klokkhammer Helsing2016-10-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the undefined behavior in tst_WaylandClient::touchDrag and mouseDrag Note: The test still fails if run twice in a row, but it appears to be deterministic. Task-number: QTBUG-56187 Change-Id: Ib45d82224f004d1324f2ce4d6b7df05ee36c04f5 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | Fix race condition on mFrameCallbackPaul Olav Tvete2016-10-061-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | Don't try to destroy the callback from two different threads. This caused a crash with brcm-egl. Change-Id: Idcb18fca9ed7f84902b88212c0cebd67932a59d3 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* | | Make sure we send frameSwapped signalsJohan Klokkhammer Helsing2016-10-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QWaylandWindow::deliverUpdateRequest() may trigger a new requestUpdate, so we must clear the mUpdateRequested flag first, so we don't accidentally clear the flag that belongs to the next update. Fixes missing updates on brcm-egl. Change-Id: Ib0decd5e8eb58505ccb94e93de494163ce0fd2ec Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into 5.8Liang Qi2016-09-201-0/+1
|\| | | | | | | | | | | | | | | | | | | | Conflicts: src/compositor/extensions/qwaylandxdgshell.cpp Change-Id: Ic45b930e01fec803287d63b6f2347f45b7638ffc
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-09-171-0/+1
| |\| | | | | | | | | | Change-Id: If43a69c30682eab4a40149a03c619047e84c9f6d