Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

xdg-shell: force configure when pending different #280

Merged

Conversation

acrisci
Copy link

@acrisci acrisci commented Oct 17, 2017

This bug exists in Weston as well.

Run rootston (or weston) like this:

(sleep 1 && gnome-terminal) &
(sleep 1 && gnome-terminal) &
rootston

You will see that both of the windows are shown as activated. This is because the pending surface state is set to activated and then fipped back to deactivated before the ack_configure (which is the time at which the next state is updated) so the state_compare function says there is no difference between pending/current/next state and the configure request is deemed not necessary.

cc @sardemff7

@ddevault
Copy link
Contributor

This bug exists in Weston as well.

Shoot wayland-devel an email about it?

@ddevault ddevault merged commit 9129687 into swaywm:master Oct 17, 2017
@sardemff7
Copy link

This commit is actually short-circuiting the whole feature. Also, state_compare does not check next at all, it’s only about the currently used state (the one on screen) and the pending state (the one we will ask the client for).

I can see two possible fixes that keep the optimization useful:

  1. schedule a configure on committed: will do nothing if pending is still the same as current, but in the bug case, pending change, we’re good
  2. make state_compare return false if the configure list is not empty, because it means we sent a different-than-current state already

I think solution 1 can somehow flicker, especially if rendering is slow, since the client will have to render a “wrong” surface before sending the “good” state. While solution 2 may have some corner cases, like, while in state A, sending B then A then B will actually send 3 configure, while sending the first B would have been enough. But good clients should ignore first B and first A anyway, so it should be fine.

I’ve sent a patch for solution 2 for libweston-desktop.

@sardemff7
Copy link

@acrisci acrisci deleted the bug/xdg-shell-pending-different-force branch October 29, 2017 15:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants