Mir

mir_surface_apply_spec doesnt have a wait or a callback

Bug #1594485 reported by Brandon Schaefer
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mir
Expired
Undecided
Unassigned

Bug Description

When using mir_surface_apply_spec there is no one to know when that spec has actually applied to the surface. This leads to racy conditions when you set a spec, but dont know when it'll apply. There should be a callback to when the spec has been set ideally.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I vaguely recall this opaqueness is an intentional design.

Having a wait handle or callback would be misleading. Because having the spec fully applied and completed does not imply that the change is visible on screen yet. It would only imply that the internal model has updated rather than the screen contents. Completion of mir_surface_apply_spec also does not mean the client has yet been notified or responded yet. Because IPC takes time and we don't trust or ever wait for clients anyway.

The most you can ask for is notification of when the internal (server-side only) model has updated. And you should always assume the screen contents have not yet visually changed due to buffering and hardware lag.

Finally, we do not implement errors for spec changes. If the server refuses to apply a spec, you should never see that as successful completion of the function.

So is there still a use case to for a wait handle or callback at all?

Changed in mir:
status: New → Incomplete
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

The design is indeed intentional: "apply_spec" is a request for the server to make changes. These changes might be rejected or race with changes requested by user interaction.

The client will be notified of the changes that the server effects, but there is no way for the client to correlate them with an "apply_spec" call.

Consider a simple example:

The client requests a resize at the same time as the user manually resizes the surface: The client is notified of the resulting size via the mir_surface_event_callback callback (but can't know if the apply_spec() request caused it).

Note: there are existing APIs that overlap the "apply_spec" functionality and incorrectly provide a wait handle (e.g. mir_surface_set_state()). For these all the wait handle provides is a way to know the server received the request, not that the request was accepted or resulted in any action by the server.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Mir because there has been no activity for 60 days.]

Changed in mir:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.