summaryrefslogtreecommitdiffstats
path: root/src/client/qwaylandwindow_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Client: Fix keyboard focus logic and crashJohan Klokkhammer Helsing2016-08-261-0/+2
| | | | | | | | | | The previous solution did not check for nullptr before dereferencing, which caused a crash. Furthermore, it checked the new ShellSurface's shellManagesActiveState before deciding whether to unfocus the old one. Task-number: QTBUG-55526 Change-Id: I410b6200a5b7b86806f70970730045a4a25f21db Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Add missing Q_DECL_OVERRIDEs to client classes.Johan Klokkhammer Helsing2016-06-271-11/+11
| | | | | | Change-Id: I10e550a25ce498bbeedc242ac73059cc6fdcef30 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org> Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* Client: Don't create shell surfaces for QShapedPixmapWindowJohan Klokkhammer Helsing2016-03-311-0/+2
| | | | | | | | | | | | | | | QShapedPixmapWindow is used as a drag-and-drop icon. This caused two roles (wl_data_device-icon and wl_shell_surface) to be assigned to the same surface, resulting in a protocol error. This bug hasn't been encountered before because QShapedPixmapWindow sets X11BypassWindowManagerHint, which was previously used to determine whether to create a shell surface or not. Task-number: QTBUG-52052 Change-Id: I1d79f3ec8ad08e0be1551c39df6232876dc2ac2e Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com> Reviewed-by: Erik Larsson <erik@ortogonal.com>
* Remove attached() definition from header.Erik Larsson2016-03-291-1/+0
| | | | | | | | | The implementation of attached() method was removed in commit 'Fix SHM drawing logic' (19260d9846861212881e374229798b3863d1a78d) but the definition in the header file was not. Change-Id: Ib850bc7101a661882078be95011d75660f621622 Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
* Add support for bitmap cursorsMartin Gräßlin2016-03-171-2/+2
| | | | | | | | | | | | | | | | | So far QtWayland did not support custom bitmap/pixmap QCursors. This change adds support for them by creating a QWaylandShmBuffer and copying the pixmap data into that buffer. The internal API to set cursors images is changed to not only rely on wl_cursor_image, but also allow to just set the buffer with a specific size and a hot spot. The created WaylandShmBuffer is passed around as a shared pointer, so that it can be automatically cleaned up once the cursor image is no longer used on any seat. Task-number: QTBUG-51604 Change-Id: I1f1ee87f03186c3d564468d3e8ea2a3141d7e2fb Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com> Reviewed-by: Johan Helsing <johan.helsing@theqtcompany.com>
* Fix SHM drawing logicGiulio Camuffo2016-03-071-1/+0
| | | | | | | | | | | | | | | | | | | | The old logic didn't care to listen for wl_buffer.release events so it always drew in the same buffer, potentially resulting in tearing if the compositor was scanning out the buffer at the same time. Instead properly cycle between a few buffers and don't reuse the same one until the release event was received. The old code also used to throttle the redraws, unless the buffer was changing, that is unless the window was getting resized. This is now lost, and no throttling is ever done. Doing it properly, by waiting for the frame callback before committing the new buffer shows very noticeable lags with many applications when resizing, because they paint many times per resize event, so they fall behind the cursor. A proper fix will be to implement the support for requestUpdate(), and using it in the applications. Change-Id: I02732c34769a5c75a6ad68c095bae916e4b274d3 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* Add missing "We mean it" comments to private headers.Friedemann Kleint2015-10-051-0/+11
| | | | | Change-Id: I70c01453b3939d1d645d626ae84c21ab4c9d267a Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* Use standard wl_subsurface interface to set a window as a child of another oneGiulio Camuffo2015-07-221-0/+5
| | | | | Change-Id: I52628f87dbea5383db06468f9748a9bacdec3179 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* Update copyright headersJani Heikkinen2015-02-171-22/+14
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I5a74d32515c3f1fe7aa1916f4241c92832510f8c Reviewed-by: Antti Kokko <antti.kokko@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2015-02-161-2/+0
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: src/client/qwaylanddataoffer.cpp src/client/qwaylanddisplay.cpp src/client/qwaylandinputdevice.cpp src/client/qwaylandwindow.cpp src/compositor/compositor_api/qwaylandsurfaceitem.cpp Change-Id: I2eae0fd43a71fbfd7c907ca715707a26f3c134c5
| * Sanitize popup behavior.Laszlo Agocs2015-02-131-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Popups are pretty important for widget apps. Menus, combobox dropdows and such are all popups. Currently they are completely borked when activated via keyboard or touch. This is because of the bizarre set_popup request in the protocol, and Weston's current implementation, that ignore the fact that a popup can be opened as a result of a keyboard event too or may not originate from an input event at all. Pass the last input device and serial we have seen, regardless of the type, by tracking it globally in the QWaylandDisplay. With this patch menus and such will not freeze the application anymore when activated with keyboard or touch without sending a mouse event to the window first. The behavior is still broken in some ways, especially with keyboard due to immediately getting a popup_done, but at least applications remain usable. Task-number: QTBUG-41142 Task-number: QTBUG-41147 Change-Id: I18de501004ae8a62ff8667e72225d08c2d3ba491 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* | Namespace the platform pluginsGiulio Camuffo2015-01-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | There currently is a QWaylandInputDevice class both in the wayland QPA plugin and in the QtCompositor API. This causes the qwindow-compositor example to crash when running nested in a wayland session due to a mismatch between the two classes. By namespacing all the plugin code we make sure that name clashes will not happen anymore. Change-Id: I17497cff697599200bea68bf01dfde474526390f Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* | Send proper mouse enter eventsGiulio Camuffo2015-01-131-13/+3
| | | | | | | | | | | | | | | | The wl_pointer.event carries the surface local position of the pointer. Notify Qt of it, without pretending it to be a motion event. Change-Id: Ibbe1d125a93b478f9c350a50bfea25b01f628178 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* | Implement high-dpi supportMorten Johan Sorvig2014-12-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wayland 1.2 added support for display scaling, where wl_output has a "scale" event informing the the client that the compositor will scale the output surfaces by the given factor. The client then has the option of providing large surfaces to match the target pixel densety and bypass the compositor's scaling. This is done by calling wl_surface::set_buffer_scale. Re-use the current high-dpi support in Qt by implementing devicePixelRatio() for QWaylandScreen and QWaylandWindow. Provide high resolution buffers both for raster and OpenGL graphics. Introduce a new coordinate system: buffer coordinates, which is related to the window coordinate system via an "int scale" scale factor. This scale factor corresponds to Qts qreal devicePixelRatio, but we keep the name and the type in the QtWayland implementation. Change-Id: Ie10d7e5b4833480a9a25d96a26ad02150eb6e83f Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* | Merge branch '5.4' into devGiulio Camuffo2014-11-151-5/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge done by Giulio Camuffo Conflicts: src/client/client.pro src/client/qwaylanddisplay.cpp src/client/qwaylandinputdevice.cpp src/client/qwaylandinputdevice_p.h src/client/qwaylandwindow.cpp src/compositor/compositor_api/qwaylandsurface.cpp src/compositor/compositor_api/qwaylandsurface_p.h src/compositor/wayland_wrapper/qwlsurface.cpp Change-Id: I1df878bb54f49d953c51215a2772869e261ebe81
| * decorations: Remove strange set dance between QWaylandWindow & ↵Robin Burchell2014-09-231-2/+0
| | | | | | | | | | | | | | | | | | QWaylandAbstractDecoration. This makes absolutely no sense. Just do things inline. Change-Id: Ic6d4e62bc9b3c0a4533f63740f2608a0be201047 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
| * Rename QWaylandDecoration => QWaylandAbstractDecorationRobin Burchell2014-09-231-4/+4
| | | | | | | | | | | | | | This is in preparation for decoration plugins. Change-Id: Idb322a7a5cbc2eb5bf2cce019073f9f4fb46297f Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-09-191-0/+13
|\| | | | | | | | | | | | | Conflicts: src/compositor/wayland_wrapper/qwlcompositor.cpp Change-Id: Ica26e33eb2b77ed5be0e84e8f4256d2e85abfaf5
| * Silence warnings about keyboard grab and size hint propagationLaszlo Agocs2014-09-081-0/+3
| | | | | | | | | | | | | | | | | | | | These two unimplemented functions often result in showing warnings from the default implementations. This is not quite ideal since the warning is useless for users and pollutes the standard output (which f.ex. Creator captures as-is) Change-Id: Ic05ff1590ed351738f0390a94ed5203a05664d4a Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
| * DataOffer not invalidated when client loses keyboard focusLi Qiu2014-09-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The data_offer object should be invalidated when client loses keyboard focus. Otherwise in following scenario, it will become zombie object: start app1 -> copy text -> start app2 -> paste text -> close app1 -> paste again in app2 -> seg fault in qtwayland. The root cause is that when app2 takes focus the first time, data_device.data_offer event was sent to it from DataDevice::setFocus. When app1 is closed, the data source reference in data offer becomes invalid. so when trying to paste again in app2, segmentation faults Change-Id: I16a584e80fddaadd269b00cdf39eb405dd95b622 Task-number: QTBUG-41005 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
| * Wayland: can drag a window by its titlebar using the touchscreenShawn Rutledge2014-09-011-0/+3
| | | | | | | | | | | | | | | | It was already possible to drag it via the mouse but not via touch. Task-number: QTBUG-41085 Change-Id: Ia52c7124fb2f1aa0331897bd072fcf09fb78aa1a Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
| * Support RasterGLSurface windowsLaszlo Agocs2014-08-251-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In an attempt to make QOpenGLWidget and QQuickWidget working on Wayland. Since Qt 5.3 all widget windows are of type RasterGLSurface (given that the plugin reports this capability which wayland will, with this patch). Such a window can behave either like a raster or an OpenGL window. This concept maps badly to platform plugins that have a rigid separation between raster and OpenGL platform window implementations. From now on, the OpenGL window implementation, that is used pretty much always, except for raw RasterSurface windows, must be prepared to behave like a raster window too, which involves having a backingstore. Change-Id: I0226704b8d5893843fcae68059c5fe9ad2f5e761 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* | Add support for setMask to set input regionJan Arne Petersen2014-08-131-0/+3
|/ | | | | | | | Also fix input region handling in compositor. Change-Id: If88ad6a03443526eddee045d7af54daf5057373a Done-with: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* Add a way to have out of source shell integrationsGiulio Camuffo2014-08-071-3/+11
| | | | | | | | | | | | | | | | | | Some platforms (especially non-desktop ones) may use a custom Wayland shell extension, more tailored to the form factor than the generic and desktoppy wl_shell or xdg_shell. Instead of stuffing N protocol implementations in the QPA plugin use a plugin architecture to allow them to live out of tree. When creating a shell surface the QT_WAYLAND_SHELL_INTEGRATION env variable will be checked, and if it points to a valid plugin that will be used to create the shell surface, falling back to wl_shell or xdg_shell if no plugin is specified. Change-Id: I05019174bb915199dd726f5fdcc0385ef846e8de Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> Reviewed-by: Philippe Coval <rzr@gna.org> Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Use wayland core interfaces to signal output rotationGiulio Camuffo2014-07-311-0/+2
| | | | | | | | The wl_output interface has an event for signaling the rotation of the display, so use that instead of our own thing. Change-Id: I8a017d575ee456a7a81649e19a015085fb784805 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Reduce headers inter-dependency in the QPA pluginGiulio Camuffo2014-06-161-2/+3
| | | | | Change-Id: I8b810e54531453b6a80250555c21bb0b1e6e76cc Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Avoid virtual calls in constructors.Gunnar Sletta2014-05-221-0/+1
| | | | | | | | | | | | | QWaylandWindow::setGeometry() is a virtual call and internally it would call windowType() which is pure virtual, so calling it from the constructor won't work. Instead, set geometry explicitly from the constructor and call setGeometry() on setVisible(true). This also merges it so we send one expose event (with correct x/y offset) on geometry change + show. Change-Id: I1d21664c982005c60c8d73740e43b3a463bac4a8 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
* Allow resizing the Qt window after the buffers swapGiulio Camuffo2014-01-221-0/+2
| | | | | | | | | | | Some EGL implementations resize the EGL buffers after eglSwapBuffers, so we need to send the geometry change event after the swap, or else the Qt window size and the physical buffer size will be different to each other. Do not force this behavior though, but use it only when the QT_WAYLAND_RESIZE_AFTER_SWAP environment variable is set. Change-Id: I79e39442b3010c563a81d7c94e747a982e158fc1 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Don't flushWindowSystemEvents in QWaylandWindow ctor.Tomasz Olszak2014-01-151-0/+2
| | | | | | | | | | tests/auto/gui/kernel/qbackingstore test crashed because the flush in QWaylandWindow::setWindowState invoked backing store expose event handling which in turn tried to use related (not yet created) QWaylandWindow. Change-Id: Ic9f29cc3433e6e671deb756aebe26530ebc72042 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Make classes in client privateJorgen Lind2013-12-271-0/+233
Change-Id: Ibf400b32f78a6a0fcf0991914d2d9ad684483979 Reviewed-by: Andy Nichols <andy.nichols@digia.com>