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

Set wayland app_id #196

Merged
merged 4 commits into from
Jan 13, 2025
Merged

Conversation

DownerCase
Copy link
Contributor

Thanks to this mod, its possible to run minecraft natively on Wayland, however it does not set the app_id, the identifier for windows spawned by an application. Setting this allows Wayland compositors to apply rules to windows (in my case I wanted minecraft to always be floating, not tiled).

This PR simply sets the Wayland app_id via GLFW. The window hint is ignored by other platforms, same as for the X11 and Cocoa hints.

Output from swaymsg -t get_tree (which shows information about the current windows)
Before (minecraft has no app_id, but prism does):

#6: workspace "1"
    #31: con "Prism Launcher 9.1" (xdg_shell, pid: 172749, app_id: "org.prismlauncher.PrismLauncher")
    #32: con "Console window for GT_New_Horizons_2.7.1_Java_17-21 — Prism Launcher 9.1" (xdg_shell, pid: 172749, app_id: "org.prismlauncher.PrismLauncher")
    #47: floating_con "GT: New Horizons 2.7.1" (xdg_shell, pid: 236404)

After (minecraft has the app_id "minecraft"):

#6: workspace "1"
    #31: con "Prism Launcher 9.1" (xdg_shell, pid: 172749, app_id: "org.prismlauncher.PrismLauncher")
    #32: con "Console window for GT_New_Horizons_2.7.1_Java_17-21 — Prism Launcher 9.1" (xdg_shell, pid: 172749, app_id: "org.prismlauncher.PrismLauncher")
    #57: floating_con "GT: New Horizons 2.7.1" (xdg_shell, pid: 268388, app_id: "minecraft")

Tested locally, and now sway is able to make my game window float for me on load 😄

Ps: I did the gradlew updateBuildScript thing because otherwise the build was failing on spotless. I don't understand why, Java development is totally new to me, but that's why those changes are in this too... 🙃

@Dream-Master Dream-Master requested review from eigenraven and a team December 30, 2024 20:56
@eigenraven eigenraven enabled auto-merge (squash) January 13, 2025 20:15
@eigenraven eigenraven merged commit c4bfbd5 into GTNewHorizons:master Jan 13, 2025
1 check 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