-
-
Notifications
You must be signed in to change notification settings - Fork 22
[Snowcap] Implement support for Popup #402
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
base: main
Are you sure you want to change the base?
Conversation
29c476b to
68f542e
Compare
7e48c10 to
4a3f9a6
Compare
| optional Style style = 10; | ||
| optional string id = 11; |
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.
It occurs to me that adding an ID on containers might not be the best way to achieve this.
The id is needed to have something we can compute a anchor rect from, but idk if we want to use the Container widget and add an id on it.
This could break some config, if they build the container using the Container {} syntax without adding ...
However, assuming we want to create a new type for this, there are a few way to manage that:
- Exact duplicate
- Strip everything but the Id (meaning user may have to nest another container if they want the same theming property).
- Strip some of the container config (e.g. keep width and height ?).
IMO, we should either go with an empty Bounded type, or just add the id on the container.
4a3f9a6 to
c2d05d3
Compare
I'm not sure how to handle this one. At the moment, only one popup can get the keyboard grab, but since you can opt-out of keyboard grab, it could be used to have a few widget that don't have keyboard grab, but can still be displayed (and get pointer inputs). OTOH, there are currently no mechanism to give keyboard grab to an open popup, and grab can only be taken if the parent has it.
Ok, change of plan. To support multiple opened popup cleanly means I'd have to rework the popup deletion, (since you need to delete popups top-down). I don't want to do that just yet, so hard error it is.
Never mind that last part. I've changed how we get the serial since then, and having to manually manage popups was tedious for no good reason. I'm not changing the number of concurrent popups, because then you have to ensure no other popup took a grab, otherwise snowcap can crash. Popups are now replaced by default (which is usually what you'd expect anyway). |
c2d05d3 to
e099ecf
Compare
|
Constraint adjustment is partially broken by this: Lines 1063 to 1066 in d6582b4
Not a big deal, but FlipX is always ignored for first generation popup. However, these lines don't work as advertised either, since SlideX bit is not added. I see a few way to fix that:
Or we can leave it that way, too. @Ottatop you have a preference ? Either are fine for me. |
562b922 to
1095a6d
Compare
|
Okay implementation is done. I have a few commits I want to add to help with re-basing on main (like refactoring widget callback so the code isn't duplicated everywhere, which would decouple this PR from text-area & mouse-area). |
1095a6d to
411dc2e
Compare
|
I think there should be a way to detect a popup is closing. Contrary to layer, popups can be closed by the compositor without the client being notified (well snowcap is notified, but since it acts as a proxy, it should forward the information). Pinnacle handle this with signals (for some object at least), but that system is supposed to get reworked and isn't part of Snowcap. I might add a RPC to monitor popups that you'd register to if you plan on keeping the handle around. Let me know if you see a better way to handle this. OTOH, the maximum lifetime of a popup is tied to their parent surface (i.e. the layer), and it's possible to check if a popup is still alive by sending an empty message to it (in which case it will fail), so there are workaround if we don't have a specific stream to handle this |
411dc2e to
071a13d
Compare
The on_key_pressed handler can be limiting since: - it doesn't allow to react to key being released - it doesn't transmit the processed `text` associated with keys when using a layout with dead keys. - it doesn't transmit captured events (I've added this one to conserve the previous behavior.) This commit address this by adding a on_key_event that transmit the key state, whether it was captured on the server side, and the associated text if available.
The on_key_pressed handler can be limiting since: - it doesn't allow to react to key being released - it doesn't transmit the processed `text` associated with keys when using a layout with dead keys. - it doesn't transmit captured events (I've added this one to conserve the previous behavior.) This commit address this by adding a on_key_event that transmit the key state, whether it was captured on the server side, and the associated text if available.
Smithay PopupSurface::sent_reposition already does the full configure sequence (xdg_popup::reposition > xdg_popup::configure > xdg_surface::configure). The additional PopupSurface::send_configure() tried to send a reactive reposition. This behavior is invalid, since it's not allowed to send a reactive reposition unless the client requested it, but a reposition can be requested on a non-reactive popup. On top of that, the client would receive 2 configure (one in response to the reposition request, the other being a fake 'reaction'). While the server will not send the second configure sequence if unless the positioner is marked as reactive, this is spamming the log, which is aggravated by smithay only checking the cached positioner, which only gets populated once the popup is assigned a buffer.
changes: - Initial implementation - Support nested popups - Popup positioning - Gravity & Anchor - Offset - Position popup at widget - Keyboard events for popups - Make constraint adjustment configurable - Allow updating positioner attributes - Support widget operations
changes: - Initial implementation - Support nested popups - Popup positioning - Gravity & Anchor - Offset - Position popup at widget - Keyboard events for popups - Make constraint adjustment configurable - Allow updating positioner attributes - Support widget operations
46708cd to
f94b0cc
Compare
Until I rebase everything, I'm basing this on my own branch, since this allows me to work on this without breaking my config.Mostly rebased. I removed commits from open PR this one doesn't depends upon.Interesting stuff starts here: 9b7332a
TODO:
SnowcapPopupDecorationNot planned for this MR, since the protocol doesn't support creating popups.8a79256 could be squashed with the one introducing operation (from #369). The old implementation bring nothing to the table and is somewhat broken anyway.
closes #400