-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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 appid/wmclass for zed window #10909
Set appid/wmclass for zed window #10909
Conversation
We require contributors to sign our Contributor License Agreement, and we don't have @jakobhellermann on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
let mut data = Vec::with_capacity(app_id.len() * 2 + 1); | ||
data.extend(app_id.bytes()); // instance https://unix.stackexchange.com/a/494170 | ||
data.push(b'\0'); | ||
data.extend(app_id.bytes()); // class |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The x11
WM_CLASS
property contains two null-terminated strings, often referred to as "instance"/"class".
In this PR I just wrote a single set_app_id
function on the PlatformWindow
that sets both to the same value since as far as I can tell x11 is the only platform on which this is relevant.
@cla-bot check |
The cla-bot has been summoned, and re-checked this pull request! |
Looks like the tests end up calling this function, I'd suggest not using unimplemented!() ever, just let it be a noop :) |
The new test failure is in |
That seems incorrect. The test is relying on text length checks, and this PR modifies the sample text. You should remove that change or recalculate the values. macOS is the only CI check that actually runs the tests right now, due to crashes in other implementations. |
Mark it for review once that test is fixed! |
Oh right, I totally forgot I changed that test. I've changed the identifier to |
There's still a CI failure during It's complaining about no field `xcb_connection` on type `&mut platform::linux::x11::window::X11Window` on line 503, suggesting but
not sure what's going on there... |
@jakobhellermann It's a conflict with #11008, you just need to rebase and it should be good to go 🙂 |
b551a9b
to
6d1badc
Compare
rebased |
Thank you! |
This has to match the WMClass/AppID, which was added here: #10909
This has to match the WMClass/AppID, which was added here: #10909 Release Notes: - N/A
fixes #9132
By setting the app id, window managers like
sway
can apply custom configuration likefor_window [app_id="zed"] floating enable
.Tested using
wlprop
/hyprctl activewindow
for wayland,xprop
for x11.Release Notes:
sway
/i3
to define custom rules