-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
client-toolkit/toplevel_info: Ignore done
before cosmic events
#39
Conversation
The compositor sends a `done` event for the `ext_foreign_toplevel_handle_v1` before we call `get_cosmic_toplevel`. Ignore that and wait for the `done` that occurs after we get cosmic events. `zcosmic_toplevel_handle_v1::state` seems to be a mandatory event, so it is valid if awkward to use for the purpose. I don't know about a cleaner solution. We could just ignore the first `done`, but technically it could race if the compostior sends a state change before it has processed the `get_cosmic_toplevel`. Maybe a roundtrip/sync could work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we somehow gate this on the cosmic global being available in the first place?
Currently there is a hard requirement on the cosmic toplevel info protocol (this is supposed to be generic over cosmic-toplevel v1 and v2). If we want to produce any useful output when only I see #40 adds a constructor that does not panic when cosmic-toplevel isn't present (which is good), but I guess we could merge both PRs, and if we want to change the API and add support for compositors that just have |
Got it.
Yeah, let's do it later, I thought we already did this, but makes sense.
Honestly I think there is a higher chance to finally get ext-foreign-toplevel-info/management going once the experimental protocol stage is available in a couple of weeks. |
Doesn't this indicate an issue on the server side of the protocol? I'd expect the base object and all extensions objects to schedule a done event on initialization rather than sending it immediately. That way there would only be one done event rather than a done for each object. |
The compositor sends a
done
event for theext_foreign_toplevel_handle_v1
before we callget_cosmic_toplevel
. Ignore that and wait for thedone
that occurs after we get cosmic events.zcosmic_toplevel_handle_v1::state
seems to be a mandatory event, so it is valid if awkward to use for the purpose. I don't know about a cleaner solution. We could just ignore the firstdone
, but technically it could race if the compostior sends a state change before it has processed theget_cosmic_toplevel
. Maybe a roundtrip/sync could work.