214 Commits

Author SHA1 Message Date
Johan Klokkhammer Helsing
04be9cf380 Client: Don't leak wl_data_offers
[ChangeLog][QPA plugin] Fixed a leak of wl_data_offers.

Data offers would previously leak when a surface with keyboard focus was
destroyed... or if it was hidden... or if it changed type, and so on.

Make keyboard focus follow a wl_surface instead of a QWaylandWindow.

This also fixes a couple of other minor issues, such as the mRepeatTimer not
stopping when a wl_surface was destroyed.

Ideally, we would have a QWaylandSurface class separate from the
QWaylandWindow, but that's out of scope for this fix.

Fixes: QTBUG-73825
Change-Id: I56e502512c3959e3fcdb63744adc4a7698e3d53d
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-02-20 14:13:05 +00:00
Qt Forward Merge Bot
48696dd85e Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Ifb1c6c64abbb5c453092eeb1aff91572b57de410
2019-02-16 03:01:33 +01:00
Johan Klokkhammer Helsing
a5bcdd0f86 Client: Refactor cursors and fix various bugs
This patch is mostly a cleanup to prepare for implementations of
xcursor-configuration, but also fixes a couple of issues.

Most of the logic has now been moved out of QWaylandDisplay and QWaylandCursor
and into QWaylandInputDevice and QWaylandInputDevice::Pointer. QWaylandDisplay
now only contains mechanisms for avoiding loading the same theme multiple
times.

There is now only one setCursor method on QWaylandInputDevice, accepting a
QCursor and storing its values so changing scale factor doesn't require calling
setCursor again. QWaylandInputDevice::Pointer::updateCursor() is called
instead.

Cursor buffer scale is now set according to enter/leave events of the cursor
surface itself instead of the current window, this fixes incorrect buffer
scales for cursors on windows that span multiple outputs. The window buffer
scale can still be passed into the seat as a fallback until the first enter
event is received.

This also fixes a bug where the QWaylandBuffer of a bitmap cursor could be
deleted while it was being used as a cursor.

[ChangeLog][QPA plugin] Fixed a bug where the DPI of bitmap cursors were not
sent to the compositor, leading to the compositor incorrectly scaling the
cursor up or down.

[ChangeLog][QPA plugin] Fixed a bug where bitmap cursor hotspots were off when
the screen scale factor was different from the bitmap cursor device pixel
ratio.

Task-number: QTBUG-68571
Change-Id: I747a47ffff01b7b5f6a0ede3552ab37884c4fa60
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-02-15 09:12:35 +00:00
Johan Klokkhammer Helsing
e1eec68742 Client xdg-shell: Fix crash when switching popups
The call to flushWindowSystemEvents() sometimes caused new popups to be shown
in the middle of hiding another. I.e. if multiple events show and hide
surfaces, they would be shown/hidden in opposite order of their corresponding
events. QMenus sometimes suffered from this (can be seen with the qopenglwidget
example from qtbase).

When the flush was added 5 years ago in 70c578cb5, it was to "reduce the
chances of seeing a bad frame". I don't see any rendering artifacts, though,
and I can't find any bug report on it. So let's hope it's safe to remove the
hack.

[ChangeLog][QPA plugin] Fixed a crash that sometimes happened when switching
popups.

Also adds more info to the workaround warning message that appears when a popup
grab is attempted and there already is another grabbing popup that is not the
parent.

Fixes: QTBUG-73524
Change-Id: Ibfcbb48c4bbe295c2be1a30add2d7e05cad398c5
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-02-12 10:27:57 +00:00
Johan Klokkhammer Helsing
f91e358902 Client: Fix incorrect decoration size when QT_SCALE_FACTOR is set
[ChangeLog][QPA plugin] Fixed a bug where window decorations were to small for
for the content when QT_SCALE_FACTOR was set.

Fixes: QTBUG-72993
Change-Id: I1ed26e038c27f7c4454a6bcc04f0849e4af789e7
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-01-30 14:34:31 +00:00
Liang Qi
35463d211f Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	.qmake.conf
	src/3rdparty/protocol/qt_attribution.json
	src/client/qwaylandintegration.cpp

Change-Id: I475889f2817c7094b68a2948fdd34ddf8b0c486f
2019-01-22 13:01:10 +01:00
Pier Luigi Fiorini
a9c9f52620 Track changes to window geometry for xdg-shell and xdg-shell-v6
Send window geometry every time the window is resized.

[ChangeLog][QPA plugin] Send window geometry every time the
window is resized.

Change-Id: I8f3824c31455345be2b582e7d3a55077b47851b6
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
2019-01-15 10:04:02 +00:00
Pier Luigi Fiorini
3572bcb831 Set size hints for xdg-shell and xdg-shell-v6
Send minimum and maximum size hints to compositors.

[ChangeLog][QPA plugin] Implement minimum and maximum size in
the xdg-shell and xdg-shell-v6 shell integrations.

Change-Id: I631c3348c8333d7a246b21228a92c436f5adb5dc
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
2019-01-15 08:12:07 +00:00
Johan Klokkhammer Helsing
ff9e5830d3 Revert "Client: Full implementation for frame callbacks"
This caused regressions because QtQuick depends on swapBuffers for throttling
animations. We probably need to emulate a blocking swapBuffers and continue
after a timeout, but until we have a patch for this, revert this to avoid
releasing a regression.

This brings back the bug with a frozen event loop when a surface is waiting for
a frame callback, but this is preferable to a regression.

This reverts commit 24ef6801e42b15be0f31860476199106c69e15d6.

Fixes: QTBUG-72578
Change-Id: If6435a947aae5e9fd775404649a392bfafe9130a
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-01-08 11:57:53 +00:00
Liang Qi
0552060620 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	src/client/qwaylandinputdevice.cpp

Change-Id: I4f985d6e47b4199a940ff1cd40e65165c28e49b2
2019-01-03 13:20:55 +01:00
Johan Klokkhammer Helsing
ac1d9c43e6 Client xdg-shell: Fix protocol error for tooltips on popups
[ChangeLog][QPA plugin] Fixed a protocol error that used to happen when closing
a menu with an active tooltip.

Fixes: QTBUG-71734
Change-Id: I784fef08494fabaa4debea11f51116cf9de1f86e
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
2018-12-26 09:22:05 +00:00
Liang Qi
d2d02aa281 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	README
	src/hardwareintegration/client/xcomposite_share/xcomposite_share.pri

Change-Id: I7cbbf39916821f0f1749e3ccab3151f68f4aa1ac
2018-12-22 18:53:35 +01:00
Johan Klokkhammer Helsing
24ef6801e4 Client: Full implementation for frame callbacks
The Wayland plugin now takes full control over delivering update request and
implement frame callbacks for both egl and shm.

Fixes two bugs:

[ChangeLog][Client] The non-blocking version of eglSwapBuffers is now used.
This fixed a bug where minimized windows would block the event loop.

Also, when we relied on the QPA version of requestUpdate, we would sometimes
deliver one update request while we were waiting for a frame callback. When we
implement the fallback timer ourselves we can make sure we only deliver the
fallback if there are no pending frame callbacks.

Fixes: QTBUG-69077
Change-Id: I2d3a6896c32e63d8520b57448a3601a817816a91
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2018-12-13 15:56:11 +00:00
Johan Klokkhammer Helsing
98b7643fdd Client: Clarify warnings about unexpected enter/leave events
With the previous wording it was a bit unclear whether this was a client
problem or not.

Also adds logging category.

Change-Id: I61084c0b2c7f17408575d1d4b6cc7809c4c6d99d
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2018-12-11 15:47:01 +00:00
Qt Forward Merge Bot
572f479787 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I1d9281750b06f7584e55759994dc6fcbcc5b2455
2018-10-30 03:03:23 +01:00
Johan Klokkhammer Helsing
52c9c71d91 Client: Don't spam expose events
Only send expose event when the geometry actually changed.

Change-Id: Ic06986ce5d11e0ff7a842303f57093b8ff25b9f6
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: David Edmundson <davidedmundson@kde.org>
2018-10-26 11:05:07 +00:00
Johan Klokkhammer Helsing
46aece5133 Client: Don't attach buffers to unexposed windows
QBackingStore::flush is sometimes called with an unxeposed window, in that
case, don't attach the buffer to the wl_surface immediately, as that causes
protocol errors with xdg_shell.

Flushed buffers are instead stored until we get the first configure event.

[ChangeLog][QPA plugin][xdg-shell] Fixed a bug where buffers were sometimes
attached and committed before the first configure event, causing protocol
errors.

Fixes: QTBUG-71345
Change-Id: If9409d97bd25f6b13940c56141920a664c349c8e
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: David Edmundson <davidedmundson@kde.org>
2018-10-26 11:05:00 +00:00
Qt Forward Merge Bot
9d082d91f3 Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: Ib4c65db63c2f3119fc7c157d4353c4e0ecebefb0
2018-10-09 15:30:02 +02:00
Johan Klokkhammer Helsing
702fa089af Remove wayland-client.h include
Change-Id: I44df8aa9117e12280f6397f7d75dc10959905302
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2018-10-03 10:06:37 +00:00
David Edmundson
b25af2c768 Avoid spurious move events after configure call
Whilst wayland can't actually move the window in a QWindow::setGeometry
call the previous behavior was to keep it so that it appeared to the
client that it had moved.

The new behavior is non-consistent, QWindow::setPosition will update
QWindow::position until the first configure call is received at which
point it will move back to 0,0. This then generates a QMoveEvent for the
window that hasn't moved.

This patch keeps the QWindow::position consistent with the user request
and doesn't generate move events.

Change-Id: Ifb1433b3902d44c1b2e43036bc1805a6e00128fb
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
2018-10-03 08:37:49 +00:00
Johan Klokkhammer Helsing
082922b4c3 Don't include wayland-client-core.h
It requires libwayland 1.8 and we're supposed to support versions as old as 1.6

Task-number: QTBUG-70528
Change-Id: Iff4c2542d103d53aba8db99ecceddfccb79cfcb6
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2018-09-14 14:00:17 +00:00
Johan Klokkhammer Helsing
f746be7c7f Client: Fix regression; drawing decorations of active windows as inactive
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>
2018-08-28 07:00:44 +00:00
Qt Forward Merge Bot
326ab57d25 Merge remote-tracking branch 'origin/5.11' into 5.12
Change-Id: Ib6d23655a5c9ee059a9560e862d38746f508caee
2018-08-25 03:01:39 +02:00
Johan Klokkhammer Helsing
e581d7dda4 Client: Clear entered screens when resetting window
Previously, windows that were hidden and shown again would have the old list of
entered screens. Aside from occasionally getting the current screen wrong,
this also polluted the log with bogus warnings about unexpected enter events.

This problem could be seen quite easily by opening, closing and opening a menu.

[ChangeLog][QPA plugin] Fixed a bug where a window that was hidden and then
shown on different screen would still think it was on the first screen.

Change-Id: I1b27433ea6607a218384d814ae4c16b9c4395948
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2018-08-17 14:30:01 +00:00
Qt Forward Merge Bot
98c6cbdf79 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: Ia9584a185a3d7a68a4333890ade535585ba33fee
2018-08-14 03:00:30 +02:00
Johan Klokkhammer Helsing
0848300f0b Client decorations: Don't spam mouse leave events
Previously, we would send one leave event each time the mouse was moved on the
decorations.

Change-Id: I57bd6e57261447db8a8c5ab45dc8f3fdfed33a49
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2018-08-13 07:49:35 +00:00
Paul Olav Tvete
019427b9ae Don't commit same buffer multiple times
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>
2018-08-08 10:44:40 +00:00
Johan Klokkhammer Helsing
6dfa35b7a2 Client: Get rid of QWaylandShellSurface::setType
This shouldn't change any behavior, but lets the shell integrations choose
if they want to use the extremely hacky QWaylandWindow::transientParent().
Hint: Not all shells need the hacks, and not all shells need them in all cases,
and some shells may need even more hacks.

Change-Id: Id105e4feb83cc9c14dcf07dcca55fcd5e63d4a2b
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2018-06-19 06:19:13 +00:00
Johan Klokkhammer Helsing
7e5daff5dd Client: Don't restore content cursor when on the window decorations
Problem: When the cursor entered the window decorations,
QWaylandWindow::restoreMouseCursor would be called from the pointer
enter handler messing up the cursor from the decorations, making the
resize border seemingly hard to hit.

Don't restore the cursor unless inside the window contents.

[ChangeLog][QPA plugin] Fixed a bug where the arrow cursor would be
shown instead of the resize cursor when hovering over the window
decoration border.

Change-Id: I2fabd8d626deaa7006734a4d5c6d10d6c0114466
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2018-06-19 04:58:02 +00:00
Liang Qi
640367b8ee Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	.qmake.conf

Change-Id: I6596d1a127cc93e53ec30cd881da1810cb8076d5
2018-06-13 12:03:52 +02:00
Johan Klokkhammer Helsing
19403799d7 Don't ask libwayland to set absurdly long window titles
It will cause libwayland to terminate the application.

Task-number: QTBUG-68715
Change-Id: I1d1830453da224bec8bf4c5d6ab087c0e05328a8
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2018-06-06 12:19:09 +00:00
Johan Klokkhammer Helsing
d8e37e4b03 Move wl-shell to a plugin
[ChangeLog][QPA plugin] The wl-shell shell integration has been moved to a
plugin.

This also adds API so shell integrations can return native resources for
windows, as it was needed in order to continue to supporting wl_shell_surface.

Change-Id: Ibc68ffcc5b0c6993d8f4e078f663e4d67340e1a5
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2018-05-18 09:37:07 +00:00
Johan Klokkhammer Helsing
7ef6c33a69 Move xdg-shell-v5 to a plugin
This is the first step in deprecating xdg-shell unstable v5 and making the good
names available for the good names for xdg-shell stable.

Shell initialization has been refactored slightly, so the
QWaylandShellIntegrationFactory actually tries to initialize the shell
integration before returning it. Similarly for the factory method of non-plugin
shells.

Change-Id: I85e60594c4fc03c6f302c04316110aed428d28dc
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2018-05-09 11:04:35 +00:00
Johan Klokkhammer Helsing
d47119339b Client: Add acked configure support and implement it for xdg-shell v6
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>
2018-05-07 11:34:41 +00:00
Johan Klokkhammer Helsing
faf99279d4 Use deliverUpdateRequest on QPlatformWindow instead of QWindowPrivate
This is because bff59f87ba11cac1dfa710f021522372de7a776f in qtbase.

Task-number: QTBUG-67480
Change-Id: I2bb89f94ecc1d78e8919cd16e7bf9d8877baf121
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-04-06 05:28:58 +00:00
Johan Klokkhammer Helsing
1605c84bbf QWindow::requestActivate() is not supported on Wayland
Return false for the WindowActivation capability to ensure we don't run tests
that require it.

Change-Id: Ia24d6eef02d462a25f3d50597debda9e062b3955
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
2018-03-08 11:00:03 +00:00
Antonio Larrosa
5f32a06c28 Test for null pointer before using it
Task-number: QTBUG-66867
Change-Id: Ibbe407fa3ac32141b52fa0086e9f1ebfd27052ba
Done-with: Fabian Vogt <fvogt@suse.de>
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Reviewed-by: Jan Grulich <jgrulich@redhat.com>
2018-03-05 14:08:38 +00:00
Johan Klokkhammer Helsing
2d468ebfa5 Client: Implement QPlatformWindow::startSystemMove()
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>
2018-03-05 12:26:08 +00:00
Johan Klokkhammer Helsing
9147c0e688 Init variables where they are declared when possible (clang-tidy)
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>
2018-02-27 17:03:41 +00:00
Johan Klokkhammer Helsing
6eac43515d Use nullptr instead of 0 or NULL
Applied automatic fixes using clang-tidy's modernize-use-nullptr, and some
manual cleanup to prevent QFlag macros to be affected.

Change-Id: I88f94390185bc6e6f23693b68723cd5710815ae6
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2018-02-20 14:15:08 +00:00
Paul Olav Tvete
397d3f75ab Merge remote-tracking branch 'qt/5.10' into dev
Change-Id: I603cbb164e6015c1bb7796bd8bb055d84dbc3b04
2018-01-31 10:29:53 +01:00
Liang Qi
4a6dd89b63 Merge remote-tracking branch 'origin/5.9' into 5.10
Change-Id: I6c201769561f53d88c89f75cce7d9a7b2643d2f6
2018-01-18 18:04:03 +01:00
Paul Olav Tvete
d4dc5f3573 Fix requestUpdate()
After commit 027a7131543b0194a7d9e98a6b53928e30bc080f, mFrameCallback
is set to null when the next buffer is attached, not when the callback
arrives. This means that a requestUpdate() after the frame callback
would never be delivered. The solution is to test mWaitingForFrameSync
instead. There is still a small race condition, but the failure case is
that the update will arrive after 5 ms instead of exactly at frame sync.

Change-Id: I413ed2b76c8527f825e501077bab712146b6705f
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
2018-01-18 14:57:45 +00:00
Marc Mutz
a8a2dc0d8a Port away from QRegion::rects()
Use begin()/end() instead.

Change-Id: I1a73b4518ee7408271ec913a219c034e330b0d5a
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
2017-12-04 13:27:42 +00:00
Johan Klokkhammer Helsing
7f8e7b4195 Automatically change scale when entering a new output
Change-Id: I99198d47eac5b2091fe2bfd8fc24646be9c9890a
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
Reviewed-by: David Edmundson <davidedmundson@kde.org>
2017-11-15 06:44:37 +00:00
Paul Olav Tvete
448312b179 Merge remote-tracking branch 'qt/5.10' into dev
Change-Id: I4f885a551093ada07da97fd3d99902e36f98595e
2017-10-27 10:37:21 +02:00
Paul Olav Tvete
dd6248faff Merge remote-tracking branch 'qt/5.9' into 5.10
Change-Id: I6c283081669594b3e8c6b30194bb96e389319cb2
2017-10-25 14:06:54 +02:00
Johan Klokkhammer Helsing
7f8d9b7f54 Ensure QWaylandWindow::transientParent has a shell surface
This may not be a perfect solution, but it's better than the current one, where
the transient parent may not have a shell surface (because the window may be
hidden or not yet initialized).

Task-number: QTBUG-63840
Change-Id: Ia5f04376d4b6d12b41ceeab5ba13cdc1b63b4e3c
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-10-25 08:48:10 +00:00
Johan Klokkhammer Helsing
6c1c47611f Tests: Add missing Q_UNUSEDs
Change-Id: Ifc7e5d000b7f5d75fb899d2294008f8dcabca777
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
2017-10-16 07:56:49 +00:00
Christophe Chapuis
b3621cfe7c QWaylandWindow: reset window should reset mask
When QWaylandWindow::reset() is called, the window's mask is not changed. It
means that when the window will be initialized again, it will not re-send the
mask description to the server side through Wayland.

Task-number: QTBUG-62638
Change-Id: I07d561f466836bbd90ae58521c0768ed85554256
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
Reviewed-by: Christophe Chapuis <chris.chapuis@gmail.com>
2017-10-13 13:55:36 +00:00