[WIP] Send xdg_output done event only when wl_output does too
AbandonedPublic

Authored by romangg on Feb 23 2019, 3:04 PM.

Details

Reviewers
None
Group Reviewers
KWin
Summary

XWayland expects the wl_output and xdg_output done calls always to come
in pairs. But when the wl_output position is not changed our
KWayland::Server::OutputInterface does not send a done event.

Then the next time a pair is sent before the xdg-output information is
received XWayland pairs the wl_output data with the data from the previous
xdg_output data, what breaks XWayland screen bound calculations and by that
cursor placement.

This preliminary fix makes sure the events are only sent in pairs. Long-term
it would be nicer to have the synchronization directly in KWayland, such that
we don't need to check its expected behavior from the outside.

BUG: 404730

Test Plan

Manually in two heads setup:

  • Start with two connected monitors of similar resolution.
  • Remove monitor to the right.
  • Reconnect monitor.
  • Switch monitor positions.

Without the fix X cursor on the right monitor is can not reach all area.

Diff Detail

Repository
R108 KWin
Branch
xdgOutputDone
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 8736
Build 8754: arc lint + arc unit
romangg created this revision.Feb 23 2019, 3:04 PM
Restricted Application added a project: KWin. · View Herald TranscriptFeb 23 2019, 3:04 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
romangg requested review of this revision.Feb 23 2019, 3:04 PM
romangg planned changes to this revision.Feb 23 2019, 3:05 PM

Instead of checking against xdg_output current values, check if wl_output's values have changed resulting in a done event.

romangg requested review of this revision.Feb 23 2019, 3:40 PM

Although this doesn't directly work, I assume because xdg_output property changes can come in on bind, while the wl_output properties are sent explicity. I'm leaving this diff as it is now again up for review, so we can discuss a proper solution. I fear we need to remodel the XdgOutputInterface class completely.

Long-term it would be nicer to have the synchronization directly in KWayland,

In terms of long term, I want to have explicit synchronization handled by kwin.
We should expose OutputInterface::done() to be explicit rather than being done implicitly in setBlah. The attempt to make things simpler actually ends up making things a lot harder to do properly.

As for this, I made an alternative approach: https://phabricator.kde.org/D19255
It's basically the same thing, but without checking for differences twice.

I've not tested for the problem you're solving, but it should be the same.

I wrote my comment before you added your last two comments. Mine won't fix the issue for the same reason yours doesn't.
Still maybe makes sense.

But in either case, my comment about it being OutputInteface with the problem not XdgOutputInterface still apply.

Long-term it would be nicer to have the synchronization directly in KWayland,

In terms of long term, I want to have explicit synchronization handled by kwin.
We should expose OutputInterface::done() to be explicit rather than being done implicitly in setBlah. The attempt to make things simpler actually ends up making things a lot harder to do properly.

I would say this is a different question. We should indeed expose the done event of a "generic" output, such that not after each property change we send the done event. But that afterwards the xdg_output done event must be sent could be handled by KWayland directly. On the other side if we expose the done event of OutputInterface it's clear when to call the done event of XdgOutputInterface as well. It's just a bit clunky to not do this directly in the library but have the compositor writer keep track what was called already and what not, I think.

As for this, I made an alternative approach: https://phabricator.kde.org/D19255
It's basically the same thing, but without checking for differences twice.

I've not tested for the problem you're solving, but it should be the same.

The description says "Done nothing yet". Does this mean one should wait with testing until you made some further changes to the diff?

The nothing done yet was on regards to testing.

Its ready for testing, but it'll behave the same as yours.

romangg abandoned this revision.Feb 25 2019, 5:21 PM

Superseded by D19255.