Skip to content

Conversation

@fnzr
Copy link

@fnzr fnzr commented Jan 10, 2026

This is more of a proof of concept implementation, because I need to clarify a couple things first:

  1. I moved waiting for wayland events to after try core.initWindow(window_id); call. Otherwise, the resizing logic tries to swap the framebuffer before it's ready, crashing the program.

I don't know if this is a viable solution, but if not, we need another way to check if core.initWindow was already called.

  1. I'm not sure how to provide the initial window size, so currently the window size is defined solely by the compositor (i think that's standard on wayland?) I don't see examples of it in the examples directory, so I'm not sure if this is a library limitation, wayland limitation, or me limitation.

Working example, there's no changes required on userland:

output.mp4
  • By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.

@fnzr
Copy link
Author

fnzr commented Jan 10, 2026

Moved the c.xdg_toplevel_set_title(wl.toplevel, @ptrCast(core_window.title)); call to before the first commit of surface. This allows the window to have a title in creation, allowing compositor to match window rules immediately. This fixes the initial window size problem I was having.

Also added the app_id field on the window, allowing the user to provide a XDG application id to the window. I only made it work on Wayland. I can create a different PR with this feature only if more appropriate.

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.

1 participant