summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2015-08-28Merge remote-tracking branch 'origin/5.5' into 5.6v5.5.90+alpha1upstreamLiang Qi11-70/+89
Conflicts: src/client/qwaylandwindow.cpp Change-Id: I80ead87f3e1f36299b1bf9cc9c7db6cd48c0e86f
2015-08-27Don't crash if loading the keymap failsGiulio Camuffo2-20/+37
Instead throw a warning and keep using the old one. Change-Id: I1533b3930d4d8c884db922b0d6dd567ef7e4f67c Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
2015-08-26Reset surface transientParent when the parent is destroyed.Mikko Harju1-0/+8
If a transient parent of a surface is destroyed before the surface itself, reset all references to that parent surface. Change-Id: I5b748099d8a5502632d8846c5de5381b5f28b665 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
2015-08-26Fix QDesktopServices::openUrl when there is no windowmanager integrationGiulio Camuffo2-15/+20
Change-Id: I51da06261acfb193a59db34bc2dd25e3452fce8d Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-08-25Enable input context selectionBernd Weimer1-1/+3
It was not possible to use a different input context than the platform context. This has been unified across major platforms, depending on the environment variable "QT_IM_MODULE", the following context is selected: - null: default platform context (Wayland in this case) - empty: no context - set: set one, if it exists and is valid (otherwise no context) Change-Id: I07c6fb339c434f99fc6e092a2e18f00600daa3bc Reviewed-by: Nedim Hadzic <nedim.hadzic@pelagicore.com> Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
2015-08-06Compile after QPA API changes.Morten Johan Sørvig2-6/+6
QMouseEvent -> QPoint in QSimpleDrag::move and drop Task-number: QTBUG-46615 Change-Id: I9cda0f039ee8f5a70219b320abbb65f8649747e1 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
2015-07-23Use xkbcommon for internal key events tooGiulio Camuffo9-165/+341
To manage the keyboard state and send key events to clients we use the xkbcommon library (unless disabled). That means that we currently have a separation between key events outgoing to clients and key events being used internally in the compositor, resulting in different keysyms being produced in the two cases for the same hardware key. Filter the key events coming from the underlying platform and modify them according to the xkb state instead. Change-Id: I4c6678be68e5b214b2b9cd0222dc9f425c580085 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2015-07-22Remove scoped enums to fix builds without C++11 support.Julien Brianceau2-4/+4
Change-Id: Ibe1811ee0b7057d082a55c4ae62e5932f7e10b84 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
2015-07-22Use standard wl_subsurface interface to set a window as a child of another oneGiulio Camuffo6-92/+113
Change-Id: I52628f87dbea5383db06468f9748a9bacdec3179 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2015-07-15Add a mechanism to delay unmapping of surfacesGiulio Camuffo7-21/+81
When a client attachs a NULL buffer on a surface we may want to hang on to the old buffer for a bit, e.g. to do a hide animation. Add the QWaylandUnmapLock class to keep a surface mapped after an attach(0) request. Change-Id: I5d5be0b36410a76a58d2b68c1b2ac5e3b875a801 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2015-07-06Fix possible race condition leading to a dead lockGiulio Camuffo4-20/+6
It is a bit dangerous to call wl_display_dispatch() in the event thread, since it may race with the dispatch called e.g. in QWaylandDisplay's blockingReadEvents() and lead to a dead lock. Instead, use wl_display_prepare_read() and wl_display_read_events() in the event thread, which doesn't block, and only dispatch in QWaylandDisplay. As a result we don't need the additional wayland queue anymore, so remove it. Change-Id: I9fbbe5d2f38d06773beb7847df1a0212cca92c37 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2015-07-04Use by-ref in foreach where T is non-trivialSergio Martins1-1/+1
Change-Id: Iac40929aebc1e0f507b729b0c01a2ccb18516c37 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
2015-07-04Fix tooltips without a transient parentGiulio Camuffo2-15/+17
QToolTip has the same problems as QMenu, that is you can create one without a parent and with a global position. Use the same trick and use the window that last received an input event as the parent. Change-Id: I093c8da0d54110903f35670b01dea6fa96abecf4 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2015-06-29Merge remote-tracking branch 'origin/5.5' into devLiang Qi22-24/+127
Conflicts: .qmake.conf Change-Id: Ic75157b11eee188608c3ac7ed6fb1a033bb72750
2015-06-29Prevent QWaylandQuickSurface from holding onto multiple buffers indefinitely.Andrew den Exter3-3/+20
With a queue of just two buffers BufferAttacher can end up holding references to both after the renderer is stopped starving the client application and causing it to block in the glSwapBuffers until the renderer restarts or the surface is destroyed. Release the current buffer to the client when the renderer is stopped so it can continue. Change-Id: Ica0e13ef78f7e6058e273c26b517a88d07f958c7 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
2015-06-16update keymap right away when no key is currently pressedCedric Chedaleux1-6/+13
Keymap update was only performed when a key was pressed. A key press right after a keymap update was pretty long. Keymap may therefore be updated if no key is currently pressed. It avoids waiting for the next key press. It must also be set when last key was released and do no need to wait for the next key press. Change-Id: I9646a02f3112c8beb0f1cf90139e2b69af55a9b0 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
2015-06-12Fix crash when resizing a window in brcm-eglOlivier Blin1-0/+3
This occurs for example when a Qt Quick2 application calls showFullScreen() while a rendering is already in progress. The GUI thread was calling destroyEglSurfaces() from setGeometry() and thus destroying the buffers, while the render thread was trying to use the buffers from swapBuffers(). There was a division by zero in swapBuffers() with the modulo m_count operation, because EGL surfaces were destroyed and m_count was 0. This fix is quite fragile, proper locking on buffers would be better. Change-Id: I41fcb2fcebec84c0dfc82ce56c6e323d3722b30a Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-06-12Remove unused m_mutex variable in brcm-eglOlivier Blin1-2/+0
Change-Id: I0c6b59eb9d59d6db4a71811562cdf740bfb0a06e Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-06-12Fix wl_buffer leak in the brcm-egl client integrationOlivier Blin1-0/+1
They were not destroyed until the client quit, so this could be significant after many resize operations. This was also leaked server-side as a result. Change-Id: If9b84a06e3f9c79af92a949bc67e81ef9e00a230 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-06-12Fix typo in xcomposite-egl integration fatal messagesOlivier Blin2-2/+2
Change-Id: I8944c176f12932eb51e867bc39820b2553a5d3ba Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-06-12Fix input devices leak in clientOlivier Blin1-0/+3
Change-Id: I28200698706168308e450b2cd3cfa99df517f9b7 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-06-12Fix xkb keymap string leak in the compositorOlivier Blin1-0/+1
Change-Id: Ie02e6667e5867b729cf5a519705ded4f79b9f4b1 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-06-12Fix private object leak in surface op/interface classesOlivier Blin2-0/+8
Change-Id: I7ad508cb07a73d6699e9d2742ea029409f498a87 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
2015-06-12Fix QWaylandDrag leak in the compositorOlivier Blin2-2/+2
Make it a scoped pointer. Change-Id: Iaeef87cad2022496ebe3a7c746b02584fac9a485 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-06-12Fix build without OpenGLOlivier Blin2-1/+19
Also fix a comment alongside. Change-Id: I0091a89ff8e7ed46e769ea47a0225bc87db2c1f5 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
2015-06-09Fix typo that leads to mis-evaluation of an expression.Christian Kandeler1-1/+1
Change-Id: I5d6eedeb3dfb80ca9df7ca27e29ad6604dbfe683 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-06-09Fix wheel events when the decorations are enabledGiulio Camuffo3-5/+29
We must offset the wheel events' position, as we do with the other types of mouse events. Change-Id: If85e93ffe95304c7dee4c2a3ff195a73243a8182 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-06-09bradient: Activate the decoration's buttons on mouse release, not pressGiulio Camuffo1-6/+36
Change-Id: I5a161119b20301a405bdde9bbea6bfbdcc4b9fa0 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-06-09Fix a corner case freed memory use/crashGiulio Camuffo1-1/+1
QWaylandDisplay::flushRequests() does not only flush them, but also dispatches the pending events. If we have two wl_data_device.selection events in the queue we must not dispatch the second one while we are dealing with the first one because that will replace the data offer and delete us while we're in QWaylandMimeData::retrieveData_sys(). Change-Id: Ib58ca571867faa2633daa9ec94fe7094df02e9fd Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-06-09Don't generate spurious selection eventsGiulio Camuffo1-1/+1
By calling destroy() on the active wl_data_source before replacing it with a new one and calling set_selection() we trigger a spurious selection(null) event before the one with the offer for the source we are going to set. Change-Id: I6c2f2fd029fa523312b9892c6a5050805dfa83b0 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-06-08Add 3 QList::reserve() callsSergio Martins3-2/+7
Change-Id: Ic89d25a4497ffaffb3f6b688f4c5ecc5128e9642 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
2015-06-03Merge remote-tracking branch 'origin/5.5' into devLiang Qi28-69/+349
Conflicts: src/compositor/wayland_wrapper/qwloutput.cpp Change-Id: I05f7431aca46760f90632dfa7ef9c4d0abf392ec
2015-05-29Fix that we pick up the generated headers in source packagesJørgen Lind1-0/+2
Change-Id: If5ae8749ccbddfc878ae4e0adaa40f072527d425 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-05-28Fix crash when the wl_shm global comes after a wl_output oneGiulio Camuffo3-1/+8
Task-number: QTBUG-44503 Change-Id: I6932df57bb4560b6dceb72a5cb7c536cd090e92a Reviewed-by: Martin Gräßlin <mgraesslin@kde.org> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-05-17Fix the build error in public headersBhushan Shah2-3/+3
One should always use Q_SLOTS/Q_SIGNALS in then public headers Change-Id: Ibbba0d3ff402bd320049bcd58ced07ad1342ef3b Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
2015-05-15Add safety check in QWaylandInputDevice::Keyboard::modifiers()Martin Gräßlin1-0/+3
::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>
2015-05-14Fix threaded OpenGL rendering on Mesa and possibly other EGLsGiulio Camuffo3-4/+14
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>
2015-05-07Reset wayland object pointer after destroyArnaud Vrac1-0/+4
This allows calling init() on the wayland object again after destroy() Change-Id: I7856cc8ec676eee7575e15a5d1f81cf1b89537c8 Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
2015-05-07Track last input window with a QPointer in case it is destroyedArnaud Vrac2-2/+8
Change-Id: I61d7aa4b6a37922eb3beefd983154ee267cae0ef Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
2015-05-07Map more XKB key codesArnaud Vrac1-0/+17
Change-Id: I0a2b56043235666bc57b46ae4ac78ca5e24e736d Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
2015-05-06Remove output extensionPier Luigi Fiorini16-375/+10
This protocol is empty now and is no longer used. Change-Id: I45e79fb86a67b4cebdc307170218fa039b2aa27f Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
2015-05-04Fix crash on keyboard removeGiulio Camuffo1-0/+4
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>
2015-04-24Let the underlying system decide the default keymap parametersGiulio Camuffo1-2/+2
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: http://xkbcommon.org/doc/current/structxkb__rule__names.html Change-Id: I8fb037201aeababaa0aa4755cae339ae3d9800b9 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-04-24Use a FontSmoothingGamma value of 1.0Giulio Camuffo1-0/+7
This is what the xcb plugin does, be consistent with it. Change-Id: I5befa2de3ff514ca0c9196eb7137682586cec126 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-04-24Use defines instead of hardcoded stringsGiulio Camuffo1-6/+4
Change-Id: Id382a1e39f2c052fbfeb96caa9b01becb31e81c9 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-04-24Do not manually update the xkb stateGiulio Camuffo1-1/+0
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>
2015-04-23Introduce the surface role conceptGiulio Camuffo2-0/+77
This is a concept originating initially from an implementation detail in Weston which was later formalized in Wayland 1.7. A wl_surface by itself will not be shown on screen, it must have a 'role' attched for that to happen. A role can be a shell surface, a pointer surface, ... Once a role is set on a wl_surface it cannot be changed, attempting to do so should send a protocol error. It is however allowed to destroy and recreate a new i.e. wl_shell_surface for the same wl_surface. This patch introduces the role and role handler concepts. A class such as a shell surface implementation should inherit from SurfaceRoleHandler, and have a 'static SurfaceRole *role()' function, which will be used to check against the role the surface has when the role handler is set to it. This changes introduces the new plumbing code but does not port existing code to it. Eventually this new API should become public. Change-Id: I43dc809b86051b7528ae6c39f796b9a96719ffd0 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-04-21Move surfaces to outputsPier Luigi Fiorini15-50/+274
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>
2015-04-19Merge remote-tracking branch 'origin/5.5' into devLiang Qi19-34/+57
Change-Id: I133110d1deaa09e400e6cbaa704dfd0f32aca974
2015-04-16Add client side support for media keysGiulio Camuffo1-0/+7
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>