Skip to content

gtk/wayland: refactor global handling - #11559

Merged
pluiedev merged 1 commit into
ghostty-org:mainfrom
pluiedev:pluie/jj-wlztolkqxlmz
Mar 16, 2026
Merged

pluiedev merged 1 commit into
ghostty-org:mainfrom
pluiedev:pluie/jj-wlztolkqxlmz

Conversation

@pluiedev

Copy link
Copy Markdown
Member

The way we originally handled globals gradually escalated into an unholy mess of ad-hoc helper functions and special-case handlers, which proved to be hard to scale. Using a type-erased EnumMap like this makes everything far easier to work and reason with, I think.

Also nuked the xdg_wm_dialog_v1 hack that was necessary to prevent old versions of gtk4-layer-shell crashing. If by the time of 1.4's release people are still using those versions, it's on them.

@pluiedev
pluiedev requested a review from a team as a code owner March 16, 2026 08:09
@pluiedev pluiedev added this to the 1.4.0 milestone Mar 16, 2026
@pluiedev

Copy link
Copy Markdown
Member Author

@jguthmiller Could you try and see if this PR kept the changes you introduced in #11117? I don't have a KDE test setup and I wanna be sure I didn't accidentally introduce any regressions :)

@mitchellh mitchellh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Generally excellent.

Comment thread src/apprt/gtk/winproto/wayland/Globals.zig Outdated
Comment thread src/apprt/gtk/winproto/wayland/Globals.zig
The way we originally handled globals gradually escalated into an unholy
mess of ad-hoc helper functions and special-case handlers, which proved
to be hard to scale. Using a type-erased EnumMap like this makes
everything *far* easier to work and reason with, I think.

Also nuked the `xdg_wm_dialog_v1` hack that was necessary to prevent
old versions of gtk4-layer-shell crashing. If by the time of 1.4's
release people are still using those versions, it's on them.
@pluiedev
pluiedev force-pushed the pluie/jj-wlztolkqxlmz branch from d2fb60a to 8966d37 Compare March 16, 2026 17:15
@pluiedev
pluiedev requested a review from mitchellh March 16, 2026 17:15

@mitchellh mitchellh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved, I didn't test it so just trusting you.

@pluiedev

Copy link
Copy Markdown
Member Author

Yeah it works for me for basic things but I'm waiting for @jguthmiller to verify if I broke anything since that's were most of the complexity lies :)

@jguthmiller

Copy link
Copy Markdown
Contributor

@pluiedev Looks good! All of the quick terminal screen options behave as expected.

@pluiedev

Copy link
Copy Markdown
Member Author

Excellent. :shipit:

@pluiedev
pluiedev merged commit 2318e18 into ghostty-org:main Mar 16, 2026
63 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.

3 participants