Skip to content
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

Implement -no-xwayland flag #993

Closed
wants to merge 0 commits into from
Closed

Conversation

novakne
Copy link
Contributor

@novakne novakne commented Feb 19, 2024

Add a cli flag to river command to disable xwayland at runtime if river has been build with xwayland support.

It does works as expected right now but a few questions, no sure how types should be handled, for e.g. xwayland_override_redirect: if (build_options.xwayland) *wlr.SceneTree else void,?
And some others things that I'll write in a review to be more clear.

closes #913

@novakne
Copy link
Contributor Author

novakne commented Feb 19, 2024

Well not a review since the code is not in the changed files...

Not sure if an if (server.runtime_xwayland) statement is needed here or maybe an assert
https://github.com/riverwm/river/blob/master/river/Cursor.zig#L938-L940

Same here, not sure if it would cause any problem to let it like that
https://github.com/riverwm/river/blob/master/river/Root.zig#L131

Copy link
Member

@ifreund ifreund 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 working on this!

Not sure if an if (server.runtime_xwayland) statement is needed here or maybe an assert
https://github.com/riverwm/river/blob/master/river/Cursor.zig#L938-L940

An assert(server.xwayland != null); would be good.

Same here, not sure if it would cause any problem to let it like that
https://github.com/riverwm/river/blob/master/river/Root.zig#L131

I think we should make this have type ?*wlr.SceneTree and initialize it to null if xwayland is disabled at runtime.

@novakne
Copy link
Contributor Author

novakne commented Feb 19, 2024

@ifreund any preference, when needed, between:

if (build_options.xwayland and server.xwayland != null) {
    server.xwayland.?.<function>
}

// or 
if (build_options.xwayland) {
    if (server.xwayland) |xwayland| {
        xwayland.<function>
    }
}

@ifreund
Copy link
Member

ifreund commented Feb 19, 2024

@ifreund any preference, when needed, between:

if (build_options.xwayland and server.xwayland != null) {
    server.xwayland.?.<function>
}

// or 
if (build_options.xwayland) {
    if (server.xwayland) |xwayland| {
        xwayland.<function>
    }
}

I prefer the second one :)

@novakne
Copy link
Contributor Author

novakne commented Feb 19, 2024

Should be better, even if I'm not super fan of the xwayland_override_redirect code

Copy link
Member

@ifreund ifreund left a comment

Choose a reason for hiding this comment

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

Just a bit more minor style cleanup then this should be ready to land :)

Copy link
Member

@ifreund ifreund 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 the patch! I ended up changing my mind on the xwayland_override_redirect scene tree thing. I think it's cleaner to just create it regardless of whether -no-xwayland is passed or not, the amount of memory "wasted" is insignificant.

@ifreund
Copy link
Member

ifreund commented Feb 19, 2024

Well, I've failed to trick github into saying this PR got merged. Codeberg's manually merged feature is so much nicer...

@novakne novakne deleted the feat/no-xwayland branch February 19, 2024 16:42
@novakne
Copy link
Contributor Author

novakne commented Feb 19, 2024

Well, I've failed to trick github into saying this PR got merged. Codeberg's manually merged feature is so much nicer...

Soon, we're free :)
I also found this morning that is way nicer to get a patch or diff from a PR on codeberg, which is really cool!

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.

[Feature request] Add a startup option to disable xwayland
2 participants