zed icon indicating copy to clipboard operation
zed copied to clipboard

Set appid/wmclass for zed window

Open jakobhellermann opened this issue 1 year ago • 11 comments

fixes https://github.com/zed-industries/zed/issues/9132

By setting the app id, window managers like sway can apply custom configuration like for_window [app_id="zed"] floating enable. Tested using wlprop/hyprctl activewindow for wayland, xprop for x11.

Release Notes:

  • Zed now sets the window app id / class, which can be used e.g. in window managers like sway/i3 to define custom rules

jakobhellermann avatar Apr 23 '24 21:04 jakobhellermann

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'.

cla-bot[bot] avatar Apr 23 '24 21:04 cla-bot[bot]

@cla-bot check

jakobhellermann avatar Apr 23 '24 21:04 jakobhellermann

The cla-bot has been summoned, and re-checked this pull request!

cla-bot[bot] avatar Apr 23 '24 21:04 cla-bot[bot]

Looks like the tests end up calling this function, I'd suggest not using unimplemented!() ever, just let it be a noop :)

mikayla-maki avatar Apr 25 '24 21:04 mikayla-maki

The new test failure is in test_chunk_text_grammar (and only on mac) so nothing caused by these changes.

jakobhellermann avatar Apr 26 '24 10:04 jakobhellermann

so nothing caused by these changes

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.

mikayla-maki avatar Apr 26 '24 20:04 mikayla-maki

Mark it for review once that test is fixed!

mikayla-maki avatar Apr 26 '24 20:04 mikayla-maki

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.

Oh right, I totally forgot I changed that test.

I've changed the identifier to dev.zed.Zed and fixed that test.

jakobhellermann avatar Apr 27 '24 11:04 jakobhellermann

There's still a CI failure during cargo xtask clippy on linux that I can't seem to reproduce or understand.

It's complaining about

no field `xcb_connection` on type `&mut platform::linux::x11::window::X11Window`

on line 503, suggesting self.0.xcb_connection,

but

  1. the code should be actually at line 466. Line 503 is unrelated
  2. the other code like set_title also directly calls self.xcb_connection.
  3. X11Window has the fields xcb_connection and x_window

not sure what's going on there...

jakobhellermann avatar Apr 27 '24 11:04 jakobhellermann

@jakobhellermann It's a conflict with https://github.com/zed-industries/zed/pull/11008, you just need to rebase and it should be good to go :slightly_smiling_face:

apricotbucket28 avatar Apr 27 '24 12:04 apricotbucket28

rebased

jakobhellermann avatar Apr 27 '24 12:04 jakobhellermann

Thank you!

mikayla-maki avatar Apr 29 '24 16:04 mikayla-maki