Skip to content

Conversation

@diniamo
Copy link

@diniamo diniamo commented Jul 31, 2025

The current implementation is a good basis, but off in a few places, which I attempted to fix in this PR.

Tell me if I should explain/revert anything.

Draft because I might still attempt some of the remaining problems. They are:

  • Resizes are laggy, because after the resize event is fired, no matter how fast we update the surface, it will be too slow to get to the compositor, before the compositor's next frame. This can be fixed by making the buffer passed to the compositor way bigger (the programs I tested make it the same size as the bounding rectangle of all of the my monitor's, as far as I can tell), so it can display the contents from it while waiting on the surface update (this is still not a full fix, because we would have to choose a base color that is displayed under the user's buffer, instead of the current transparency). Yeah, resizing on Wayland is a pain.
  • Monitor scaling is not implemented
  • Window flags are not implemented
  • Keymaps are not respected
  • Key repetition is not implemented (should it even be?)
  • Viewports are not implemented (or are they? I'm not sure what the TODO means in the code)

@Darky-Lucera
Copy link
Collaborator

Let me know when you finish

- Fix window not opening
- Use minimum protocol versions
- Fix compiler warnings
- Do keyboard input properly using libxkbcommon (keymaps are respected)
- Remove unnecessary code
- Respect cursor theme
- Support resizing and closing
- Support scaling
- Fix other issues stemming from logical errors/protocol violations
@diniamo diniamo marked this pull request as ready for review August 1, 2025 12:41
@diniamo
Copy link
Author

diniamo commented Aug 1, 2025

@Darky-Lucera I think I've done all I can. I have 2 questions though:

  1. What is WF_FULLSCREEN_DESKTOP meant to do?
  2. What is the mfb_set_viewport function meant to do? What does it do currently on Wayland (I'm not sure what the dst function/variables used in it mean)? What does the TODO comment mean?

@Darky-Lucera
Copy link
Collaborator

Hello!

Excuse me for the long delay.

  • WF_FULLSCREEN_DESKTOP: creates a window as big as the desktop screen with decorators but a normal window.
  • mfb_set_viewport: Sets a specific rendering region within the window where the framebuffer content will be displayed.

Best regards!

@anzz1
Copy link

anzz1 commented Sep 30, 2025

Resizes are laggy, because after the resize event is fired, no matter how fast we update the surface, it will be too slow to get to the compositor, before the compositor's next frame. This can be fixed by making the buffer passed to the compositor way bigger (the programs I tested make it the same size as the bounding rectangle of all of the my monitor's, as far as I can tell), so it can display the contents from it while waiting on the surface update (this is still not a full fix, because we would have to choose a base color that is displayed under the user's buffer, instead of the current transparency). Yeah, resizing on Wayland is a pain.

Sounds like Wayland itself needs more work before its ready for prime-time, that sounds ridiculous.
How can resizing be painful that's one of the main features of a window manager, if that doesn't work properly it doesn't sound like it's ready for prod yet.

@Darky-Lucera
Copy link
Collaborator

Hello!
Are there any updates on this?
Thanks!

@diniamo
Copy link
Author

diniamo commented Oct 28, 2025

I didn't manage to make the viewport stuff work, but we could still merge this as is.

Would you like me to revert anything? I think I unnecessarily changed some stuff that's only semantic (e.g., 0x0 -> NULL).

@Darky-Lucera
Copy link
Collaborator

Hello!

I've been working to get the MiniFB examples to compile and run on Wayland, which required some code changes. Since these might be relevant to your current work, I'd appreciate it if you could review the modifications.

I apologize for any inconvenience.

@diniamo
Copy link
Author

diniamo commented Nov 1, 2025

That... was the point of this PR as well.

@Darky-Lucera
Copy link
Collaborator

Could you please test the current version and apply you changes if needed?

@Darky-Lucera
Copy link
Collaborator

Are there some changes on this?

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.

3 participants