| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
We can't trust QWindow::isActive, because it relies on focusWindow, which may
be updated too late, and there might also be multiple active toplevel windows
at once on Wayland. Even though Qt doesn't support multiple seats, we should
still draw the decorations of active windows correctly.
This implements QPlatformWindow::isActive and uses it in the decorations.
Change-Id: I34d79b354e2d26694533e2319a26f24085212243
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
|
|\
| |
| |
| | |
Change-Id: Ia9584a185a3d7a68a4333890ade535585ba33fee
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In Qt we call flush() when we think the window might need to be
updated. It is also possible to trigger a flush while painting.
Two fixes:
1) If there are attempted flushes between beginPaint() and endPaint,
queue them up, and do them in endPaint().
2) Make sure we only commit the buffer once: after that the
compositor owns the buffer, and it can repaint on its own.
Change-Id: Ibf61068fa95760eb67dbc0b1d0534854114ea528
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The problem:
The code in QWaylandWindow::setWindowStateInternal made many assumptions about
how the shell surface responded to new window states, and when and if they were
applied. Particularly:
- The shell integrations support different subsets of Qt::WindowStates, so it
doesn't make sense to map from states to setFullscreen, setNormal, etc. in
QWaylandWindow because it really depends on the shell integration how it
should be handled.
- Some states are not supported/unknown on some shells and should immediately be
rejected.
- On some shells, particularly those where the current state is unknown, flags
need to be resent even though they didn't change.
- Should handleWindowStatesChanged be called immediately (client decides) or
should it wait for a configure event (compositor decides)? I.e. the mState
variable only makes sense for some shells.
Furthermore, when state changes come from the compositors, some shell
integrations require that a configure event is acked by the client and that the
next committed buffer's size and content matches that configure event.
Previously, we would just ack immediately and still send a buffer with the old
size before a correct frame was drawn. i.e. sending incorrect acks, which would
lead to protocol errors on some compositors.
Additionally, QWaylandWindow::createDecoration() also assumed that windows
should have decorations unless they are fullscreen. This is not always the
case, particularly on ivi-application and probably on future shell integrations
for embedded or tiling window managers etc.
The Solution:
The responsibility of mapping requested window states to Wayland requests have
been moved to the QWaylandShellSurface implementation. QWaylandWindow now calls
a new virtual, QWaylandShellSurface::requestWindowStates(Qt::WindowStates),
instead of trying to be smart about it. The virtual getters and setters for
window states have now been removed from the QWaylandShellSurface interface.
It's now also the shell surface implementation's responsibility to call
QWaylandWindow::handleWindowStatesChanged if and when it knows a new state is
effective.
QWaylandWindow::configure has been replaced with
QWaylandWindow::applyConfigureWhenPossible(), which causes another new virtual,
QWaylandShellSurface::applyConfigure(), to be called whenever we're free to
resize and change the states of the next buffer (this is when states should be
acked). This means that shells that use acked states need to store the pending
states themselves, call applyConfigureWhenPossible(), wait for applyConfigure()
to be called, call resizeFromApplyConfigure() and handleWindowStatesChanged(),
and finally ack the applied state.
Acked state for xdg-shell v5 and v6 has now been implemented, which also means
we've now:
[ChangeLog][QPA plugin] Implemented support for maximizing, minimizing, and
setting fullscreen with xdg-shell unstable v6.
[ChangeLog][QPA plugin] QWindow::isActive now follows configure events on
xdg-shell unstable v6 (like v5).
QWaylandWindow::createDecoration queries QWaylandShellSurface::wantsDecoration
before creating window decorations, instead of using the previously unreliable
QWaylandWindow::isFullscreen().
[ChangeLog][QPA plugin] Window decorations are now automatically disabled for
ivi-application.
The refactor also removes a couple of hacks:
- QWindowSystemInterface::flushWindowSystemEvents() was called in
QWaylandWindow::setWindowStates. Since this hack was introduced, the events
now have oldState and newState members, and their values seem to make sense
(ensured in the tests).
- The hack for unminimizing on xdg-shell v5 in QWaylandWindow::createDecoration
was not needed anymore.
Finally, tests have been added for xdg-shell v6 to ensure that the right Wayland
requests are sent, that we respond to configure events from the compositor, and
that the Qt events and signals emitted on the client side make sense.
Task-number: QTBUG-53702
Task-number: QTBUG-63417
Task-number: QTBUG-63748
Task-number: QTBUG-66928
Change-Id: Ib4c36b69105750f9dbdcc78adcf71e2e994cc70d
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
|
|
|
|
|
|
|
|
|
| |
Hooks into what we already use for the window decorations.
Task-number: QTBUG-58044
Change-Id: Idcd971f69d52a5bb760bb6bffb26e9f5bdd429df
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Applied automatic fixes using clang-tidy's modernize-use-override.
This adds the "override" keyword where it's possible and also removes the
"virtual" keyword when redundant.
Change-Id: I899950e5cf8782785d30a245a9c69c1720905d50
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
clang-tidy -p compile_commands.json $file \
-checks='-*,modernize-use-default-member-init,readability-redundant-member-init' \
-config='{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: "1"}]}' \
-header-filter='qtwayland' \
-fix
Afterwards I ran search and replace on the diff to clean up some whitespace errors:
- Replaced '(\n\+[^:\n]*)(:\s+\+\s+)' with '$1: '
- Replaced '(\n\+[^,\n]*)(,\s+\+\s+)' with '$1, '
- Replaced '\n\+\s*\n' with '\n'
I also had to do some manual edits, because for some reason, this particular
clang-tidy check doesn't trigger for some files.
Change-Id: I3b3909bac4bf20108bbe8ad1e01bcc54236dae1b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
| |
Change-Id: I741d3fb392c6121f2d8514ee2504fc88f99092ff
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
|
|
|
|
|
|
| |
Change-Id: I99198d47eac5b2091fe2bfd8fc24646be9c9890a
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
Reviewed-by: David Edmundson <davidedmundson@kde.org>
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/client/qwaylandwindow.cpp
src/client/qwaylandwindow_p.h
src/compositor/compositor_api/qwaylandpointer.cpp
Change-Id: Icbc22a1ae3cdd9cde438742817d07fccf97f647b
|
| |\
| | |
| | |
| | | |
Change-Id: I76bfc271efcf75c75bf38f4bf58503e1d2a00839
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
|\|
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
.qmake.conf
src/client/qwaylandwindow.cpp
Change-Id: I3ae070ff20df4b858a4eef769438092c061e47ef
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
|\|
| |
| |
| | |
Change-Id: I7285dfeaac0d7963607930904aa017bedb1e48ab
|
| |\
| | |
| | |
| | | |
Change-Id: I43cd0147a63b5523e3112f09bbfe60e1d6636e6c
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
| | |
| | |
| | |
| | |
| | | |
Change-Id: Ic6655f239ea449baf862934608feda182799c42d
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The signature of setWindowState is changing. Remove the 'override'
so qtwayland compiles without error against both the new and the
old version.
Task-number: QTBUG-59588
Change-Id: I2adc6a5a1addc9b8855a3a1b3c1f0e3952181846
Reviewed-by: Liang Qi <liang.qi@qt.io>
|
|\|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| | |
Change-Id: I16b7b23efe944b49d1fcc9e7588cdb0a991cebd1
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: If244e7ac58133ae6fbefacfa243d47fa210140be
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|/
|
|
|
|
|
| |
Task-number: QTBUG-56174
Change-Id: I6610905d0c9f29be29e812bcac193ea2a7e4f107
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
|
|
|
|
|
|
|
|
|
| |
Get rid of almost all DEFINES += ... in the pro files,
instead use the proper QT_CONFIG() macro to determine
whether a feature is available.
Change-Id: I867769be2085c6ba93b6815e223e2b89edcb245d
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
|
|
|
|
|
| |
Change-Id: I67f9a0d171da403ebb124ab584c2510891da80fc
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
setFlags() works just like setWindowState(): we have to use the supplied
parameter because the window's state hasn't been updated yet.
Change-Id: I223e01ef192f30911697e449669e745f0ad59d99
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org>
|
|\
| |
| |
| | |
Change-Id: I6784a53fcc2f0f68b8e916181cb8cdef263782b8
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
|\|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/client/qwaylandinputcontext_p.h
src/hardwareintegration/client/brcm-egl/qwaylandbrcmglcontext.h
src/hardwareintegration/client/wayland-egl/qwaylandglcontext.h
src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.h
Change-Id: Iac517e1985e4e67d7ca00ca4c10dcda9dd9079f9
|
| |
| |
| |
| |
| |
| | |
Change-Id: I10e550a25ce498bbeedc242ac73059cc6fdcef30
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org>
Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
|
| |
| |
| |
| |
| |
| |
| | |
...since it's being used by a public header.
Change-Id: I38049c27c8bd4dc793416bf836d79c4226172d38
Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Instead of placing the drag icons top-left corner at the cursors
hotspot the drag icon is moved so it will be placed correct relative
the cursor hotspot. This will makes the drag feeling more realistic.
Change-Id: I8d60ae1b7788accb9034575983417abae4c58c1a
Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
|
|\|
| |
| |
| | |
Change-Id: I31f4c29c985301d28d5c8d0501761c7d4fb7fda6
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The implementation will wait for the frame callback before firing
the update event.
Change-Id: Ieea748fda7c2aeb62cc40f35dbd122864c09f7cd
Reviewed-by: Johan Helsing <johan.helsing@theqtcompany.com>
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
|
|\|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/compositor/compositor_api/qwaylandcompositor.h
src/compositor/compositor_api/qwaylandquickcompositor.h
src/compositor/compositor_api/qwaylandsurfaceitem.h
src/compositor/windowmanagerprotocol/waylandwindowmanagerintegration_p.h
Change-Id: I094128be314d2c3d4fe350fa7a162e37da34ae10
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
|\|
| |
| |
| | |
Change-Id: Iada0e076ee33e8d39ecc4f40edfd9764ba610c03
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
|/
|
|
|
|
|
|
|
|
| |
From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/
Updated license headers to use new LGPL header instead of LGPL21 one
(in those files which will be under LGPL v3)
Change-Id: I76ae5d3e64f096eb3163d6163a38d68c7c1ca756
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
|
|
|
|
|
| |
Change-Id: I70c01453b3939d1d645d626ae84c21ab4c9d267a
Reviewed-by: Giulio Camuffo <giulio.camuffo@jollamobile.com>
|
|
|
|
|
| |
Change-Id: I52628f87dbea5383db06468f9748a9bacdec3179
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
|