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

GTK: title config should be respected and set immediately on new windows, tabs #5934

Open
mitchellh opened this issue Feb 22, 2025 · 1 comment · Fixed by #6056 · May be fixed by #5966
Open

GTK: title config should be respected and set immediately on new windows, tabs #5934

mitchellh opened this issue Feb 22, 2025 · 1 comment · Fixed by #6056 · May be fixed by #5966
Labels
gui GUI or app issue regardless of platform (i.e. Swift, GTK) os/linux
Milestone

Comments

@mitchellh
Copy link
Contributor

Discussed in #5836

Originally posted by vaygr February 17, 2025
Steps to reproduce:

yabai -m rule --add app="Ghostty" title="^scratchterm$" scratchpad="scratchterm" grid=5:5:1:0:3:3
open -na Ghostty.app --args --title="scratchterm"

Even though the title is reported correctly once ghostty is launched:

{
        "id":5281,
        "pid":13867,
        "app":"Ghostty",
        "title":"scratchterm",
        "scratchpad":"",
        "frame":{
                "x":12.0000,
                "y":50.0000,
                "w":1488.0000,
                "h":920.0000
        },
        "role":"AXWindow",
        "subrole":"AXStandardWindow",
        "root-window":true,
        "display":1,
        "space":1,
        "level":0,
        "sub-level":-20,
        "layer":"normal",
        "sub-layer":"below",
        "opacity":1.0000,
        "split-type":"vertical",
        "split-child":"second_child",
        "stack-index":0,
        "can-move":true,
        "can-resize":true,
        "has-focus":true,
        "has-shadow":true,
        "has-parent-zoom":false,
        "has-fullscreen-zoom":true,
        "has-ax-reference":true,
        "is-native-fullscreen":false,
        "is-visible":true,
        "is-minimized":false,
        "is-hidden":false,
        "is-floating":false,
        "is-sticky":false,
        "is-grabbed":false
}

But the rule never gets triggered, that is unless I remove title argument for yabai -m rule or set it to ^.*$.

I tested it with kitty to see if it could be yabai's issue, but no, it worked as expected:

yabai -m rule --add app="kitty" title="^scratchterm$" scratchpad="scratchterm" grid=5:5:1:0:3:3
kitty --title "scratchterm"

My assumption is ghostty could be setting the title a bit too late?

Notes

Right now, the core Surface sends a set_title apprt action AFTER the surface is initialized, which -- at least for macOS -- happens to be after the Window (tabs are also windows in macOS) is created.

If the user sets an explicit title config, we should set that as part of the window creation process rather than wait for this message.

@mitchellh mitchellh added gui GUI or app issue regardless of platform (i.e. Swift, GTK) os/linux os/macos labels Feb 22, 2025
pluiedev added a commit to pluiedev/ghostty that referenced this issue Feb 24, 2025
pluiedev added a commit to pluiedev/ghostty that referenced this issue Feb 24, 2025
pluiedev added a commit to pluiedev/ghostty that referenced this issue Feb 24, 2025
pluiedev added a commit to pluiedev/ghostty that referenced this issue Feb 24, 2025
pluiedev added a commit to pluiedev/ghostty that referenced this issue Feb 25, 2025
pluiedev added a commit to pluiedev/ghostty that referenced this issue Feb 25, 2025
mitchellh added a commit that referenced this issue Mar 2, 2025
Fixes #5934 for macOS

If a `title` config is set, this change sets the title immediately on
windowDidLoad to ensure that the window appears with the correct title
right away.

If there is any reason to set another title, the `set_title` apprt
action will come on another event loop tick (due to our usage of
notifications) but that's okay since that's already how it works. This
is just to say that setting this here won't break any shell integration
or anything.
@mitchellh mitchellh removed the os/macos label Mar 2, 2025
@mitchellh
Copy link
Contributor Author

macOS resolved, Linux still an issue, renamed and relabeled.

@mitchellh mitchellh reopened this Mar 2, 2025
@github-actions github-actions bot added this to the 1.2.0 milestone Mar 2, 2025
@mitchellh mitchellh changed the title title config should be respected and set immediately on new windows, tabs GTK: title config should be respected and set immediately on new windows, tabs Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gui GUI or app issue regardless of platform (i.e. Swift, GTK) os/linux
Projects
None yet
1 participant