Skip to content

Conversation

@ftyghome
Copy link
Contributor

@ftyghome ftyghome commented Oct 1, 2025

This PR introduces support for the wlr-foreign-toplevel-management protocol in Cage.

The protocol is especially useful in kiosk scenarios. In our use case, the system needs to run multiple windows (for example, a VNC remote connection window and a WebKit browser). We would like these windows to remain active simultaneously and allow a background daemon to handle requests to switch between them. This enables smoother workflows where the remote connection window and the browser can be freely toggled when messages arrive.

I also noticed related discussions in the following issues, where adding support for this protocol has been requested:
#99
#302
#391

This implementation aims to address those needs by integrating the protocol directly into Cage.

Copy link
Member

@emersion emersion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like support for Xwayland is missing?

@ftyghome
Copy link
Contributor Author

ftyghome commented Nov 3, 2025

Hi emersion,

Thanks for the review! I've addressed the comments and added support for XWayland.

Please let me know if anything else is needed :)

@ftyghome
Copy link
Contributor Author

ftyghome commented Dec 6, 2025

Thanks for the review! I've moved the foreign-toplevel creation and destruction logic to the map/unmap paths, and moved the duplicated code to view.c. Please let me know if there's anything else needed:)

@ftyghome
Copy link
Contributor Author

ftyghome commented Dec 7, 2025

Hi emersion,

I've now moved the request_activate and request_close related code to view.c. I noticed that the view->type == CAGE_XWAYLAND_VIEW check might not be very elegant, but I felt it would be even more awkward to place handle_activate in view.c while splitting handle_close between xdg_shell.c and xwayland.c. Do you have any suggestions for improvement, or is this approach acceptable?

Thanks again for your review!

Copy link
Member

@emersion emersion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating this PR! I think we're getting close now.

@ftyghome
Copy link
Contributor Author

Hi @emersion,

I have updated this PR, thanks for the review! Please let me know if there are any other changes needed:)

Copy link
Member

@emersion emersion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've pushed some minor cleanups.

LGTM, thank you!

@emersion emersion merged commit af0a3cf into cage-kiosk:master Dec 11, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants