3 years agoAdd safety check in QWaylandInputDevice::Keyboard::modifiers() 5.5
Martin Gräßlin [Fri, 15 May 2015 07:49:58 +0000 (09:49 +0200)]
Add safety check in QWaylandInputDevice::Keyboard::modifiers()

::modifiers() might be invoked before being initialised. E.g. when
a pointer button event is emitted before the keymap is sent.

Change-Id: Ib95f9866d808b2a32ddfaa0862cdb3226fab1938
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoFix threaded OpenGL rendering on Mesa and possibly other EGLs
Giulio Camuffo [Wed, 13 May 2015 20:04:18 +0000 (23:04 +0300)]
Fix threaded OpenGL rendering on Mesa and possibly other EGLs

eglBindAPI's docs says "defines the current rendering API for EGL in the
thread it is called from". We were instead just calling it in the thread
the context was created in, not in the thread used for rendering.

Change-Id: Iba8ffe75a6f4f8b9d1bba59c0e7cce34499e9c48
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
3 years agoReset wayland object pointer after destroy
Arnaud Vrac [Tue, 16 Sep 2014 15:36:18 +0000 (17:36 +0200)]
Reset wayland object pointer after destroy

This allows calling init() on the wayland object again after destroy()

Change-Id: I7856cc8ec676eee7575e15a5d1f81cf1b89537c8
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoTrack last input window with a QPointer in case it is destroyed
Arnaud Vrac [Fri, 13 Mar 2015 14:46:44 +0000 (15:46 +0100)]
Track last input window with a QPointer in case it is destroyed

Change-Id: I61d7aa4b6a37922eb3beefd983154ee267cae0ef
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoMap more XKB key codes
Arnaud Vrac [Wed, 27 Nov 2013 22:19:06 +0000 (23:19 +0100)]
Map more XKB key codes

Change-Id: I0a2b56043235666bc57b46ae4ac78ca5e24e736d
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoFix crash on keyboard remove
Giulio Camuffo [Fri, 1 May 2015 14:41:17 +0000 (17:41 +0300)]
Fix crash on keyboard remove

If the compositor sent a wl_keyboard.leave and a new wl_seat.capabilities
without the keyboard bit we would end up deleting the Keyboard object
with a roundtrip in flight, ending up using freed memory later.
Destroy the callback when destroying the keyboard, and notify the
window system the active window is active no more.

Change-Id: Ie415ca62b46e0b8ef0fe4d09c8e7a8130928df90
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
3 years agoLet the underlying system decide the default keymap parameters v5.5.0-beta1
Giulio Camuffo [Wed, 22 Apr 2015 07:41:14 +0000 (10:41 +0300)]
Let the underlying system decide the default keymap parameters

By passing "" instead of hardcoded defaults  we let xkbcommon decide what
the default parameters for the keymap should be. The user can change that
with environment variables, as described here:

Change-Id: I8fb037201aeababaa0aa4755cae339ae3d9800b9
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
3 years agoUse a FontSmoothingGamma value of 1.0
Giulio Camuffo [Tue, 21 Apr 2015 18:09:50 +0000 (21:09 +0300)]
Use a FontSmoothingGamma value of 1.0

This is what the xcb plugin does, be consistent with it.

Change-Id: I5befa2de3ff514ca0c9196eb7137682586cec126
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
3 years agoUse defines instead of hardcoded strings
Giulio Camuffo [Tue, 21 Apr 2015 13:56:49 +0000 (16:56 +0300)]
Use defines instead of hardcoded strings

Change-Id: Id382a1e39f2c052fbfeb96caa9b01becb31e81c9
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
3 years agoDo not manually update the xkb state
Giulio Camuffo [Tue, 21 Apr 2015 10:16:53 +0000 (13:16 +0300)]
Do not manually update the xkb state

xkb_state_update_key() is not supposed to be used in apps with a master
process, such as wayland clients, which use xkb_state_update_mask()
with the state serialized by the master.

Change-Id: Ie51a39ca0c567c54072b221d1ab8cf7b8ea15c55
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
3 years agoMove surfaces to outputs
Pier Luigi Fiorini [Wed, 31 Dec 2014 10:35:53 +0000 (11:35 +0100)]
Move surfaces to outputs

Moving surfaces to belong to a specific output.
Surfaces can be viewed on a different output anyway.

Change-Id: I9ef76300f85190d84b83431374e76e581786e4e7
Done-with: Jørgen Lind <jorgen.lind@theqtcompany.com>
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoAdd client side support for media keys
Giulio Camuffo [Thu, 16 Apr 2015 14:56:41 +0000 (17:56 +0300)]
Add client side support for media keys

Unfortunately we don't have a keysym in libxkbcommon for PlayPause,
we only have Play. We're going to pretend XKB_KEY_XF86AudioPlay is
really PlayPause since that is what is most common.

Change-Id: I1a75d8b5b0ea360e0f62eb7a93004ba3fababfa8
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
3 years agoMerge remote-tracking branch 'origin/5.4' into 5.5
Liang Qi [Wed, 15 Apr 2015 07:19:39 +0000 (09:19 +0200)]
Merge remote-tracking branch 'origin/5.4' into 5.5


Change-Id: I795fd08f0fc5d3cb5ed55bf16e724f66b7567723

3 years agobrcm-egl: Avoid conflicts with GLES3 5.4.2
Pier Luigi Fiorini [Wed, 4 Mar 2015 22:30:00 +0000 (22:30 +0000)]
brcm-egl: Avoid conflicts with GLES3

qopengl.h includes GLES3 which conflicts with GLES2 declarations.
Might happen because Qt is built with desktop GL.

This patch fixes the following build error.

In file included from ../../../../hardwareintegration/compositor/brcm-egl/brcmeglintegration.cpp:61:0:
/opt/vc/include/GLES2/gl2.h:600:125: error: conflicting declaration of C function 'void glShaderSource(GLuint, GLsizei, const GLchar**, const GLint*)'
 GL_APICALL void         GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar** string, const GLint* length);
In file included from /usr/include/qt/QtGui/qopengl.h:97:0,
                 from ../../../../../include/QtCompositor/5.5.0/QtCompositor/private/../../../../../src/compositor/hardware_integration/qwlclientbufferintegration_p.h:46,
                 from ../../../../../include/QtCompositor/5.5.0/QtCompositor/private/qwlclientbufferintegration_p.h:1,
                 from ../../../../hardwareintegration/compositor/brcm-egl/brcmeglintegration.h:44,
                 from ../../../../hardwareintegration/compositor/brcm-egl/brcmeglintegration.cpp:44:

/usr/include/GLES3/gl3.h:475:29: note: previous declaration 'void glShaderSource(GLuint, GLsizei, const GLchar* const*, const GLint*)'
 GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);

Change-Id: I49ae11457b70b05f740ce70b8c1cfa5d6aa554bb
Reviewed-by: Olivier Blin <qt@blino.org>
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoRemove .desktop suffix to appId
Pier Luigi Fiorini [Thu, 22 Jan 2015 07:13:08 +0000 (08:13 +0100)]
Remove .desktop suffix to appId

The appId is the desktop entry identifier.

According to the desktop entry specifications [1], for applications the
part of the name should follow the reverse DNS convention (see [2]).

To do this we use the application domain if available, otherwise for
lack of information we fall back to the executable base name like other
toolkits such as Gtk+ do.

[1] http://standards.freedesktop.org/desktop-entry-spec/latest/
[2] http://standards.freedesktop.org/desktop-entry-spec/latest/ar01s02.html

Change-Id: I181ad23a9736844e07e8060d78e756a943c27f67
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoDon't handle mouse events in decos if buttons were pressed in the content area
Giulio Camuffo [Sun, 29 Mar 2015 08:33:34 +0000 (11:33 +0300)]
Don't handle mouse events in decos if buttons were pressed in the content area

This fixes the decorations stealing the mouse events when going outside the
content area.

Change-Id: I8f3592fbda6b9c1da6498d74820a73be11c6999d
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
3 years agoFixed license files
Jani Heikkinen [Tue, 31 Mar 2015 09:29:12 +0000 (12:29 +0300)]
Fixed license files

Removed unnecessary license files (LICENSE.GPL & LICENSE.LGPL ) and
added missing ones (LICENSE.LGPLv21 & LICENSE.LGPLv3)

Change-Id: Id42db1372d19e934480e84a64e9064dff31ca708
Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoexamples: remove unused windowDestroyed signal
Olivier Blin [Tue, 25 Nov 2014 17:00:41 +0000 (18:00 +0100)]
examples: remove unused windowDestroyed signal

Unused since commit fc439e40e37f9c0b3108225f951fb19bb3abee80
    Rework the way buffers are used and rendered

Also remove associated slots that are now empty in server-buffer.

Change-Id: I33be0bc6a5e175553d28e9ead54fefd2f0c07ce0
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoTests: Blacklist tst_WaylandCompositor::keyboardGrab
Caroline Chao [Thu, 19 Mar 2015 08:49:54 +0000 (09:49 +0100)]
Tests: Blacklist tst_WaylandCompositor::keyboardGrab

This test is currently failing in CI on Ubuntu 14.04.

Task-number: QTBUG-45108
Change-Id: Ibb364171356f742e5a1f9818e0938bde5f2a8f76
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoFix build for brcm-egl integration
Pier Luigi Fiorini [Wed, 4 Mar 2015 20:13:34 +0000 (20:13 +0000)]
Fix build for brcm-egl integration

Change-Id: I5540dfb8e115ab6b3c90bb78618b277783a912f3
Reviewed-by: Olivier Blin <qt@blino.org>
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agobrcm-egl: Disambiguate wl_registry
Pier Luigi Fiorini [Wed, 4 Mar 2015 19:28:15 +0000 (19:28 +0000)]
brcm-egl: Disambiguate wl_registry

Include wayland-client.h to disambiguate between QtWaylandClient::wl_registry
and wl_registry.

Change-Id: Idf33fd56a6b2c2436f5cbabc953980d05826ebba
Reviewed-by: Olivier Blin <qt@blino.org>
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoqwindow-compositor: fix rendering shm NPOT textures with OpenGL ES2
Olivier Blin [Tue, 17 Feb 2015 19:21:56 +0000 (20:21 +0100)]
qwindow-compositor: fix rendering shm NPOT textures with OpenGL ES2

Always use GL_CLAMP_TO_EDGE instead of GL_REPEAT, since OpenGL ES2
doesn't support NPOT textures in combination with GL_REPEAT by
default, and repeat is not needed anyway.

See also qtbase commits:

Change-Id: I01770fe3352da05baf6898d63c091bfae95e7a98
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
3 years agoDrop unused mScreensInitialized variable in QWaylandDisplay
Olivier Blin [Tue, 9 Dec 2014 12:24:49 +0000 (13:24 +0100)]
Drop unused mScreensInitialized variable in QWaylandDisplay

Unused since commit 78a701272e68d4f0ab95df4062374b8d34ef2919:
    Made wayland plugin single-threaded, yay :)

Change-Id: I1fae78d77179feaac79f5dba6dcad8084e3e97fa
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoFix shm buffers init and destruction on failure
Olivier Blin [Fri, 5 Dec 2014 13:27:06 +0000 (14:27 +0100)]
Fix shm buffers init and destruction on failure

Some pointers need to be initialized in QWaylandBuffer and
QWaylandShmBuffer, and checked at destruction.

This avoids crashes when shm surface creation fails.

Change-Id: I6f6afa3cc6c67533b5130700cbc27b271764109e
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoFix connecting to surfaceDestroyed
Olivier Blin [Wed, 10 Dec 2014 18:28:13 +0000 (19:28 +0100)]
Fix connecting to surfaceDestroyed

It was being called with a garbage pointer, since the signal does not
have an object argument anymore.
This has been changed in commit fc439e40e37f9c0b3108225f951fb19bb3abee80
    Rework the way buffers are used and rendered

Change-Id: I220c52285909dc93aebd128fc418df3c8a6bd37c
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoFix BrcmBuffer build
Olivier Blin [Wed, 10 Dec 2014 13:37:26 +0000 (14:37 +0100)]
Fix BrcmBuffer build

It got broken after commit b332630c86014eada07990acf66c13e000b3482b:
  Fix generated code for interface names not starting with qt_ or wl_

Like done in xcompositebuffer.h

Change-Id: Ib9b44536d4214737d8d68d62c8512e18a80d5b5d
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoRemove useless EGL linking in plugins
Olivier Blin [Wed, 10 Dec 2014 13:22:48 +0000 (14:22 +0100)]
Remove useless EGL linking in plugins

EGL libs are already linked from the hardwareintegration pri file, and
the plugins do not make direct use of any EGL symbol.

Change-Id: If6ecfee16e8c9d8fee67f03419941ced92d1eff8
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoMake QWaylandShellSurface a QObject to allow build without RTTI
Olivier Blin [Tue, 25 Nov 2014 14:20:33 +0000 (15:20 +0100)]
Make QWaylandShellSurface a QObject to allow build without RTTI

dynamic_cast can not be used when RTTI is disabled, so make
QWaylandShellSurface a QObject.

QWaylandWlShellSurface and QWaylandXdgSurface must also inherit from
QWaylandShellSurface first, to properly inherit from QObject.

Change-Id: I2addb8105a0fe61615d4bc905414f7ee7277029f
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoShellSurface: fix leak of QWaylandSurfaceItem on destruction
Olivier Blin [Fri, 20 Mar 2015 17:38:14 +0000 (18:38 +0100)]
ShellSurface: fix leak of QWaylandSurfaceItem on destruction

The QWaylandSurfaceView/QWaylandSurfaceItem object is never destroyed
from ShellSurface.

This was also leaking the underlying GL texture.

Task-number: QTBUG-41180
Change-Id: If74c956075744115b8b5a7e8cb89b584714ec7e6
Done-with: Nicolas Marc <nicolas.marc@softathome.com>
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoUse Qt foreach instead of C++11 specific range-base for loop
Olivier Blin [Tue, 25 Nov 2014 14:42:12 +0000 (15:42 +0100)]
Use Qt foreach instead of C++11 specific range-base for loop

To fix build with compilers without C++11 support.

Change-Id: If5a5d5d874b196f60bcc5b7bd5a543b58f9c89a3
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
3 years agoRemove local documentation template
Topi Reinio [Mon, 23 Mar 2015 14:21:54 +0000 (15:21 +0100)]
Remove local documentation template

Any documentation config can simply include the global template with

Change-Id: I58298deeed5267776589d019a3df293b43c3a755
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
3 years agoFix build with gcc <= 4.5
Olivier Blin [Fri, 13 Feb 2015 10:47:52 +0000 (11:47 +0100)]
Fix build with gcc <= 4.5

nullptr is not defined with gcc <= 4.5, use 0 instead.

Change-Id: I90d9170e57258f26b8ba7770a957a135539364de
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoAdd required CONFIG conditions to pro file
Caroline Chao [Thu, 19 Mar 2015 10:34:27 +0000 (11:34 +0100)]
Add required CONFIG conditions to pro file

The module will be skipped if the conditions are not met.

Change-Id: I99593777348bd8c74e8c32f0a4ff482bbaa8812d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
3 years agoFix the compositor test
Giulio Camuffo [Fri, 13 Feb 2015 12:37:58 +0000 (14:37 +0200)]
Fix the compositor test

Output handling in the compositor changed, so update the test
accordingly. As a side effect we now send an additional
wl_output.scale event, so have the client handle it.
Also the mapping between wayland's and QImage's format changed
so make it succeed again.

Change-Id: I66d32725c54d93ca1512a6a0ddaf466f58984afc
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
3 years agoTest: Fix compilation error in compositor test
Caroline Chao [Wed, 18 Mar 2015 13:09:44 +0000 (14:09 +0100)]
Test: Fix compilation error in compositor test

The constructor takes 2 arguments.

Change-Id: I4a6d231a163e896261d3c39e3625de07ce832ba2
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoDisable -Wcast-qual in qtwayland v5.5.0-alpha1
Thiago Macieira [Sun, 8 Mar 2015 01:59:48 +0000 (17:59 -0800)]
Disable -Wcast-qual in qtwayland

We have a lot of generated C source code that needs to do casting and C
doesn't have const_cast, so the -Wcast-qual option produces a lot of
noise. Let's make sure it isn't enabled in qmake.conf or qt_common.prf.

Change-Id: Iee8cbc07c4434ce9b560ffff13c9635861a8eca9
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoSend done and scale events only when clients support wl_output >= 2
Pier Luigi Fiorini [Fri, 6 Mar 2015 22:17:26 +0000 (23:17 +0100)]
Send done and scale events only when clients support wl_output >= 2

Those events were added with wl_output version 2 and we can't send
them to clients supporting wl_output version 1.

Change-Id: I4a673b8cc0476675532d31b4391a537d8473987b
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoCheck the surface input mask for hover events
Giulio Camuffo [Tue, 17 Feb 2015 09:14:46 +0000 (11:14 +0200)]
Check the surface input mask for hover events

We also remove the hoverLeaveEvent() reimplementation, as it serves
no real purpose.

Change-Id: Ic218be864564032c38f91d3946ccfdf2ccfc0d25
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
3 years agoMerge remote-tracking branch 'origin/5.4' into 5.5
Frederik Gladhorn [Fri, 20 Feb 2015 14:38:53 +0000 (15:38 +0100)]
Merge remote-tracking branch 'origin/5.4' into 5.5

Change-Id: I03fd08fc0576ffac813f64905c23de4d65e67433

3 years agoUpdate copyright headers
Jani Heikkinen [Thu, 12 Feb 2015 06:41:42 +0000 (08:41 +0200)]
Update copyright headers

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>
3 years agoFix build
Giulio Camuffo [Tue, 17 Feb 2015 09:14:20 +0000 (11:14 +0200)]
Fix build

Change-Id: I790e9bfbcffc7458e2a46f2da32dcbde0c6bffe8
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
3 years agoAdd a way to get the native hardware integration buffer for a suface
Giulio Camuffo [Tue, 17 Feb 2015 09:02:01 +0000 (11:02 +0200)]
Add a way to get the native hardware integration buffer for a suface

When running on wayland-egl it will be a EGLImageKHR. The compositor
can then use it to pass it to something like a hardware compositor,
or a parent compositor using the egl extension

Change-Id: I61a165c9af444509f28ab92d00be146e2e78eb52
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
3 years agoRun eventDispatcher in QWaylandDisplay::forceRoundTrip
Martin Gräßlin [Mon, 16 Feb 2015 14:50:11 +0000 (15:50 +0100)]
Run eventDispatcher in QWaylandDisplay::forceRoundTrip

If the application uses QCoreApplication::setEventDispatcher before
the QGuiApplication is created the blocking roundtrip might block the
application indefinitely. This can happen if the application starts a
Wayland server in the same process before the QGuiApplication is
created. And the QtWayland plugin connects to this server. In this case
a roundtrip blocks as the Wayland server cannot process the events
the QWaylandDisplay is waiting for.

By running the event dispatcher manually and using the pending
variant for dispatching the Wayland event queue, the application can
be kept alive.

Change-Id: I9c36fccbae8921e1ae9a0a8b7f460520b1b65d5c
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoAdd a integration hook to get the wayland queue used by the QPA plugin
Giulio Camuffo [Mon, 16 Feb 2015 14:54:37 +0000 (16:54 +0200)]
Add a integration hook to get the wayland queue used by the QPA plugin

This comes handy for clients directly using raw wayland objects.

Change-Id: Ie526ac7b25a6c6a34ce61699103e612616bffbb8
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
3 years agoMerge remote-tracking branch 'origin/5.4' into dev
Frederik Gladhorn [Mon, 16 Feb 2015 10:05:38 +0000 (11:05 +0100)]
Merge remote-tracking branch 'origin/5.4' into dev


Change-Id: I2eae0fd43a71fbfd7c907ca715707a26f3c134c5

3 years agoSanitize popup behavior.
Laszlo Agocs [Sat, 6 Sep 2014 20:55:07 +0000 (22:55 +0200)]
Sanitize popup behavior.

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>
3 years agoFix popup menus with no parent windows
Giulio Camuffo [Sun, 18 Jan 2015 13:53:46 +0000 (15:53 +0200)]
Fix popup menus with no parent windows

The QMenu API doesn't play well with Wayland. You can do:

QMenu menu;

which is completely broken on wayland. If some popup window doesn't
have a transient parent use the current focus window for that.
Fixes right-click popups in qdbusviewer and other apps.

Change-Id: I3227f4ec27431ca8ec156971cbfdbf1e848a0527
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
3 years agoFix QtCompositor compilation
Giulio Camuffo [Sun, 8 Feb 2015 14:23:18 +0000 (16:23 +0200)]
Fix QtCompositor compilation

This is a quick fix, a proper fix needs the ongoing effort to make
surfaces and outputs aware of each other.

Change-Id: I61faca9929a448208e82574c5c4d963c271f7e68
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
3 years agoAdd QWaylandOutput to support multiple outputs
Pier Luigi Fiorini [Mon, 26 Aug 2013 06:18:56 +0000 (08:18 +0200)]
Add QWaylandOutput to support multiple outputs

Add a new QWaylandOutput class to support multiple outputs.
Each QWaylandOutput need a window for rendering.

Rename OutputGlobal to Output and Output to OutputResource.

Add support for physical size, mode and available geometry.

Use better defaults for geometry and refreshRate from the QWindow
if available.

A window is no longer passed to QWaylandCompositor constructor
and all output related methods are removed, however one or more
outputs are required for hardware integration.

QWaylandCompositor returns a list of outputs and offers an API to add
or remove outputs.

Hardware integrations can run headless.

Change-Id: I742996571ddb78328f7bfa4f79b25a81995279e1
Done-with: Jan Arne Petersen <jan.petersen@kdab.com>
Done-with: Jørgen Lind <jorgen.lind@theqtcompany.com>
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoFix copying text to non-qt clients
Giulio Camuffo [Sat, 7 Feb 2015 17:29:19 +0000 (19:29 +0200)]
Fix copying text to non-qt clients

Like we do for pasting, set the mime type of text to "text/plain;charset=utf-8"
too besides "text/plain". This allows copying text to clients such as weston
example clients or Xwayland.

Change-Id: I8a24f32d93e438f16db662e7c09b09ddd7578768
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
3 years agoDo not send invisible key characters
Giulio Camuffo [Wed, 4 Feb 2015 20:00:35 +0000 (22:00 +0200)]
Do not send invisible key characters

xkb_keysym_to_utf32() will return 0 if the keysym does not have a
unicode representation.

Task-number: QTBUG-44012
Change-Id: I85a13b58c7f0b9765c7d67db6568a90629bcfbfa
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
3 years agoFix deadlock when starting a drag
Giulio Camuffo [Wed, 4 Feb 2015 18:02:59 +0000 (20:02 +0200)]
Fix deadlock when starting a drag

Change-Id: Ie2fdc56bffb97ce04ffad11ea7a7686dc09a06cc
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
3 years agoAdd a SHM format converter class
Jorgen Lind [Thu, 25 Dec 2014 19:42:56 +0000 (20:42 +0100)]
Add a SHM format converter class

This class helps keeing one lookuptable for server and client
It relies on that wayland-(client|server)-protocol.h being included
before the qwaylandshmformathelper.h

Change-Id: I12158126a80c8fef5c52427d35792f33716020f1
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoUpdate the protocol to 1.4 and raise the required libwayland version
Giulio Camuffo [Tue, 3 Feb 2015 12:37:25 +0000 (14:37 +0200)]
Update the protocol to 1.4 and raise the required libwayland version

Wayland 1.4 introduces wl_subsurface which is quite an important

Change-Id: I48375f60adce556c9989872319f4d073e4a7b13b
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
3 years agoMake all the screens virtual siblings
Giulio Camuffo [Fri, 30 Jan 2015 17:31:00 +0000 (19:31 +0200)]
Make all the screens virtual siblings

Wayland outputs fit the definition of virtual sibling screens so make
the platform screen subclass so.

Change-Id: Id3f2592653f6309406185589f70127f2b74065ac
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
3 years agoRemove unused header
Pier Luigi Fiorini [Fri, 30 Jan 2015 06:30:17 +0000 (07:30 +0100)]
Remove unused header

Remove qwaylandcompositor_p.h leftover.

Change-Id: I2ede92db92894f14301c89cc28c896cfdc6d3563
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoSend mouse events with the correct modifiers
Giulio Camuffo [Thu, 29 Jan 2015 19:10:25 +0000 (21:10 +0200)]
Send mouse events with the correct modifiers

Change-Id: I33da2681bc2315b3dc7de16fa80c45e26a478caa
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
3 years agoFix pasting from sources advertising the utf8 charset
Giulio Camuffo [Tue, 27 Jan 2015 17:44:52 +0000 (19:44 +0200)]
Fix pasting from sources advertising the utf8 charset

Some clients use "text/plain;charset=utf8" as the mimetype for the
clipboard instead of just "text/plain".
Since we support Utf8 accept it as a valid type.

Change-Id: Icd540f0ff507ed9917b374f3b40fbdc259ce9ee2
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
3 years agoNamespace the platform plugins
Giulio Camuffo [Thu, 29 Jan 2015 12:35:44 +0000 (14:35 +0200)]
Namespace the platform plugins

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>
3 years agoMake sure we send a valid initial resize
Giulio Camuffo [Sun, 18 Jan 2015 13:04:29 +0000 (15:04 +0200)]
Make sure we send a valid initial resize

Change-Id: Ib9a0152f83af433354d32ef4a8a233e5551ded8c
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
3 years agoSend a touch cancel event when we stop getting input
Giulio Camuffo [Fri, 16 Jan 2015 10:18:43 +0000 (12:18 +0200)]
Send a touch cancel event when we stop getting input

Take a grab when a touch gesture begins and send a touch cancel event
when we lose the grab. That makes sure that we don't leave the client
with a broken input state if some item like Flickable steals the
events from the QWaylandSurfaceItem.

Change-Id: I1e07836041a25cdbabff0d8559c4e06cbac27e7e
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
3 years agoUnset the pointer focus if we're deleting the view holding it
Giulio Camuffo [Mon, 19 Jan 2015 12:53:00 +0000 (14:53 +0200)]
Unset the pointer focus if we're deleting the view holding it

Change-Id: I546c6ab2a060d76de18330766a0b2fba419589bd
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
3 years agoMerge remote-tracking branch 'origin/5.4' into dev
Frederik Gladhorn [Mon, 19 Jan 2015 13:07:39 +0000 (14:07 +0100)]
Merge remote-tracking branch 'origin/5.4' into dev


Change-Id: I65c8503cf632699129ebb6b4f01721b74be78def

3 years agoBump version
Oswald Buddenhagen [Fri, 16 Jan 2015 20:07:11 +0000 (21:07 +0100)]
Bump version

Change-Id: Iec9d43735e4388d3617d5c56a11013446e7ebd8e

3 years agoRecreate the surface textures after the scenegraph invalidation v5.4.1
Giulio Camuffo [Thu, 15 Jan 2015 15:50:37 +0000 (17:50 +0200)]
Recreate the surface textures after the scenegraph invalidation

When the scenegraph is invalidated we delete the surfaces texture.
Set the update flag to true so that when the scene graph is again
initialized and starts to draw a frame the textures will be recreated.

Change-Id: I2fb171e4bed517e48fa2311c22651150f3e605f7
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
3 years agoCorrectly handle '--invert' parameter in server-buffer compositor
Siteshwar Vashisht [Tue, 13 Jan 2015 11:12:24 +0000 (16:42 +0530)]
Correctly handle '--invert' parameter in server-buffer compositor

Change-Id: I9a3285dc5bddd848ec557287c4641d9edce752a9
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
3 years agoSet the composing string of the wayland input method
Giulio Camuffo [Wed, 7 Jan 2015 20:31:43 +0000 (22:31 +0200)]
Set the composing string of the wayland input method

Task-number: QTBUG-43346
Change-Id: I9bc6d804ddca59a7a0173b8f0d3ec2f268fe9a59
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
3 years agoSend proper mouse enter events
Giulio Camuffo [Sun, 4 Jan 2015 16:27:51 +0000 (18:27 +0200)]
Send proper mouse enter events

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>
3 years agoAllow retrieving the egl display for a QWindow on wayland
Giulio Camuffo [Mon, 5 Jan 2015 11:38:53 +0000 (13:38 +0200)]
Allow retrieving the egl display for a QWindow on wayland

This allows a compositor running with the wayland qpa inside another
compositor to provide EGL to its clients.

Change-Id: I308fb909c8168955148be152bf314a53c0e5ca43
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
3 years agoRemove unused members
Thiago Macieira [Sun, 23 Nov 2014 15:15:35 +0000 (07:15 -0800)]
Remove unused members

Clang found two problems with this from QWaylandDataDeviceManager. First,
it's a class, not a struct.  Second, nothing is using this private

qwaylanddatadevicemanager_p.h:66:5: warning: struct 'wl_data_device_manager' was previously declared as a class [-Wmismatched-tags]
qwaylanddatadevicemanager_p.h:66:36: warning: private field 'm_data_device_manager' is not used [-Wunused-private-field]

And also this one:

qwaylandextendedoutput_p.h:61:21: warning: private field 'm_screen' is not used [-Wunused-private-field]

Change-Id: Ifc8f28f92190547dcb0a5319aa6fc14277894f15
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoMake use of the new QPlatformIntegration::destroyScreen
Giulio Camuffo [Mon, 6 Oct 2014 11:26:46 +0000 (14:26 +0300)]
Make use of the new QPlatformIntegration::destroyScreen

Task-number: QTBUG-41141
Change-Id: I0bd789cc1090f7e0e7615b47c33a4e4179677398
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
3 years agoMerge remote-tracking branch 'origin/5.4' into dev
Frederik Gladhorn [Mon, 29 Dec 2014 15:20:02 +0000 (16:20 +0100)]
Merge remote-tracking branch 'origin/5.4' into dev


Change-Id: I3ee40153c959dbe31ea685571c5a8bb1ae36606e

3 years agoxdg-shell: upgrade to support current version (weston-1.6.0)
Philippe Coval [Wed, 5 Nov 2014 15:13:17 +0000 (16:13 +0100)]
xdg-shell: upgrade to support current version (weston-1.6.0)

Many inprovements on windows's decorations,

Also handle compositor events
(test: Super+Shift+F , Super+Shift+M)

The protocol file is a raw copy of

Source: http://cgit.freedesktop.org/wayland/weston/plain/protocol/xdg-shell.xml?id=1.6.0

Task-number: QTBUG-38633/related
Change-Id: I667ec52c8a7e34d74b60174a671c89671f841d6b
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoImplement high-dpi support
Morten Johan Sorvig [Fri, 23 Aug 2013 07:21:26 +0000 (09:21 +0200)]
Implement high-dpi support

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

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>
3 years agoBump version
Oswald Buddenhagen [Fri, 12 Dec 2014 12:48:59 +0000 (13:48 +0100)]
Bump version

Change-Id: If637c41ed60c0191ea118ae4e83c5aa6781b6e2e

3 years agoFix wrong check condition.
Giulio Camuffo [Fri, 12 Dec 2014 11:29:22 +0000 (13:29 +0200)]
Fix wrong check condition.

Change-Id: Iecd5050097abcafa06073d41a31d1ae31fac5b42
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
3 years agoFix dangling pointer access when getting dnd data in some cases
Giulio Camuffo [Thu, 11 Dec 2014 09:46:14 +0000 (11:46 +0200)]
Fix dangling pointer access when getting dnd data in some cases

Calling wl_data_source.destroy(); wl_data_offer.receive(), where the
wl_data_offer is referring to the destroyed wl_data_source, was crashing
the compositor.

Change-Id: Iab352d63f8a93aebd0bfbcf1dc26c0e8a48a523a
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
3 years agoFix possible double free when hiding a window
Giulio Camuffo [Sat, 6 Dec 2014 17:57:39 +0000 (19:57 +0200)]
Fix possible double free when hiding a window

There was a race condition between the gui and the wayland event thread
which could lead to double freeing the QWaylandShmBackingStore's frame
callback. Protect the wl_callback_destroy calls using a mutex.

Change-Id: Ia70ebac208a6d4450328ba5254a850be26d84d6d
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
3 years agoEnable Qt WebEngine on Wayland
Laszlo Agocs [Wed, 3 Dec 2014 15:56:17 +0000 (16:56 +0100)]
Enable Qt WebEngine on Wayland

The native resource getters that are supported by eglfs will have to be
supported by the wayland platform plugin too. (on wayland-egl at least)

Change-Id: Ibbab649c04785dbde177342c45b9bc6f1edd954d
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
3 years agoSilence uninited variable compiler warnings
Laszlo Agocs [Wed, 3 Dec 2014 15:36:13 +0000 (16:36 +0100)]
Silence uninited variable compiler warnings

The code is correct but some compilers may still warn about dragData not
getting initialized. Silence them.

Change-Id: Ib52321667fc5094e22ebbef538b72b5477e6f10b
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoDon't access a dangling pointer
Giulio Camuffo [Thu, 20 Nov 2014 13:30:29 +0000 (15:30 +0200)]
Don't access a dangling pointer

The surface's resource may have been destroyed, return a null client
in that case.

Change-Id: I3d7e0f0e94008e003e43f1987e6560dd73f5c5db
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
3 years agoMerge "Merge branch '5.4' into dev" into refs/staging/dev
Frederik Gladhorn [Sat, 15 Nov 2014 17:52:23 +0000 (18:52 +0100)]
Merge "Merge branch '5.4' into dev" into refs/staging/dev

3 years agoMerge branch '5.4' into dev
Giulio Camuffo [Fri, 7 Nov 2014 12:43:24 +0000 (14:43 +0200)]
Merge branch '5.4' into dev

Merge done by Giulio Camuffo


Change-Id: I1df878bb54f49d953c51215a2772869e261ebe81

3 years agoRemove deleted views from the list
Giulio Camuffo [Fri, 14 Nov 2014 13:14:46 +0000 (15:14 +0200)]
Remove deleted views from the list

Change-Id: Ic4c998347e14c17693bea461452d6ee8fc41064b
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
3 years agoMake sure to have valid textures
Giulio Camuffo [Fri, 31 Oct 2014 09:14:15 +0000 (11:14 +0200)]
Make sure to have valid textures

The texture of QWaylandSurfaceItem's texture provider was updated in
QWaylandSurfaceItem::updatePaintNode(). That is fine as long as the
texture is accessed after the updatePaintNode() call, but if not we
would access an invalid texture.
That could happen when another QQuickItem subclass was accessing the
textire in its updatePaintNode(). We don't have any guarantee on the
order of the updatePaintNode() calls, so the other item could be
updated before the QWaylandSurfaceItem.

Change-Id: I7320d445c72796ce26f8d8483175a35e9c6840e7
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
3 years agoQWaylandInputDevice: Fix missing virtual destructor declaration
Louai Al-Khanji [Tue, 28 Oct 2014 05:30:15 +0000 (07:30 +0200)]
QWaylandInputDevice: Fix missing virtual destructor declaration

QWaylandInputDevice recently gained a virtual function, making it a
polymorphic class. It should thus have a virtual destructor as well.

Discovered through a GCC diagnostic:

warning: deleting object of polymorphic class type 'QWaylandInputDevice' which has non-virtual destructor might cause undefined behaviour [-Wdelete-non-virtual-dtor]

Change-Id: Ie816caabea56cde320768dcc8aba6b5ad50bf4c1
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoFix compiler warning about unused d variable
Louai Al-Khanji [Tue, 28 Oct 2014 05:32:27 +0000 (07:32 +0200)]
Fix compiler warning about unused d variable

Change-Id: Ia3ee8b13f1eacc435152149a1ee65fb62658506e
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoBe more careful when destroying wl_resources v5.4.0 v5.4.0-rc1
Giulio Camuffo [Thu, 23 Oct 2014 15:37:16 +0000 (18:37 +0300)]
Be more careful when destroying wl_resources

The compositor must not destroy wl_resources when it wants to, else it
breaks the contract with the client.

Change-Id: Ic0d298072cdf0954d2504c04bff2bcc99733e621
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
3 years agoUpdate .gitignore after wayland examples move
Olivier Blin [Wed, 22 Oct 2014 09:48:52 +0000 (11:48 +0200)]
Update .gitignore after wayland examples move

Change-Id: I44e0dc6ac4e92a8bdc6a9f8398e60e4d323247f9
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoGracefully fallback when xkb context creation fails
Olivier Blin [Fri, 23 Nov 2012 15:16:52 +0000 (16:16 +0100)]
Gracefully fallback when xkb context creation fails

xkb context creation can fail when xkeyboard-config files are not

This changes qwlkeyboard to gracefully fallback on the
QT_NO_WAYLAND_XKB path, as suggested by Giulio Camuffo.

Change-Id: Ic57d80b6aa3e9fbd8a393a3ca54dff768a4c3e83
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
3 years agoFix fd leak in case of ftruncate() failure in qwlkeyboard
Olivier Blin [Tue, 9 Sep 2014 15:03:57 +0000 (17:03 +0200)]
Fix fd leak in case of ftruncate() failure in qwlkeyboard

Change-Id: Id7d6582d4e139763634c7022548b558d4a2f8ec2
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
3 years agoFix crash when cursor theme can not be loaded
Olivier Blin [Tue, 9 Sep 2014 17:42:10 +0000 (19:42 +0200)]
Fix crash when cursor theme can not be loaded

Also add a debug message about theme loading failure.
This is not necessarily fatal, some embedded applications could still
function properly without a cursor.

Change-Id: Ib3e2ee43b00630ee77997c7472a95ac5a22c2cc2
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
3 years agoSupport for multiple input devices
Mikko Levonmaa [Mon, 31 Mar 2014 18:31:18 +0000 (11:31 -0700)]
Support for multiple input devices

Allows the registration of multiple input devices for the compositor via
private APIs. Since the Qt stack does not support separate input devices
via the QPA, the identification of each device (wl_seat) is left up to
the implementor.

The compositor will identify input event via the QWaylandInputDevice::isOwner
method. Usually this will happen when an item on the UI has received an
event and would like to send it to the client surface. See
QWaylandSurfaceItem for more details.

Includes basic unit tests

Change-Id: I7ee1db49388713bf3076c23cf8f8a165aefc2fe0
Reviewed-by: Mikko Levonmaa <mikko.levonmaa@lge.com>
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
4 years agoFix -no-opengl builds
Laszlo Agocs [Tue, 14 Oct 2014 08:48:10 +0000 (10:48 +0200)]
Fix -no-opengl builds

Task-number: QTBUG-41677
Change-Id: I039ec581e960eb70eb04aed6e65add70c563ba77
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
4 years agoBe compatible with older compositors
Giulio Camuffo [Fri, 10 Oct 2014 19:17:41 +0000 (22:17 +0300)]
Be compatible with older compositors

When binding globals take care of the version the compositor provides
and don't call requests that the compositor doesn't implement.

Change-Id: Iea0c534fb9e005720857e2778e380b6a9c22a6f3
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
4 years agoMove examples into wayland subdirectory. v5.4.0-beta1
Friedemann Kleint [Thu, 9 Oct 2014 10:39:08 +0000 (12:39 +0200)]
Move examples into wayland subdirectory.

Conforming to the Qt project directory structure.
Change-Id: I452867fabc88e9594fa26f944b5d3e1ca4ffc720
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
4 years agoPass the relevant serial when setting the selection
Giulio Camuffo [Sun, 5 Oct 2014 17:45:34 +0000 (20:45 +0300)]
Pass the relevant serial when setting the selection

This fixes copying in Weston.

Change-Id: Icbdb81078e8df4575bbe440321773131ba27ebbf
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
4 years agoFix the compositor's wayland versioning
Giulio Camuffo [Tue, 30 Sep 2014 14:09:49 +0000 (17:09 +0300)]
Fix the compositor's wayland versioning

We cannot just assume all clients implement the same version of the
various interfaces as the compositor does. Keep track of them, and
react accordingly when creating a resource or sending an event.

Change-Id: I9792433a14d49c5c4df0c892fc1349ce0dfb0d43
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
4 years agoRemove duplicate size property declaration
Mikko Levonmaa [Mon, 6 Oct 2014 11:49:13 +0000 (14:49 +0300)]
Remove duplicate size property declaration

Change-Id: I9700c15066c030436dbe2f9a09b0851b7f4350ae
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
4 years agoFix shm windows sometimes not showing after being hidden
Giulio Camuffo [Mon, 6 Oct 2014 08:05:23 +0000 (11:05 +0300)]
Fix shm windows sometimes not showing after being hidden

QWaylandShmBackingStore installs a frame callback on flush, and subsequent
flushes will not attach a new buffer until the callback is fired.
If the window is hidden while we're waiting for the callback, we attach
a NULL buffer, so the compositor will not redraw the surface and will not
fire the frame callback. When showing the window again the backing store's
flush() will wait indefinitely for the frame callback to attach its buffer.
To fix it destroy the frame callback when the window is hidden.

This was easily noticeable when fast switching between popup menus.

Change-Id: Ic0c71ed79e2fab9faf452f63b05bc4576ea9a3ba
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>