sminez / penrose

A library for writing an X11 tiling window manager
https://sminez.github.io/penrose/
MIT License
1.26k stars 88 forks source link

ActiveWindowName won't respect max_chars #286

Closed greweln closed 10 months ago

greweln commented 11 months ago

Describe the bug

The widget displays full length text ignoring the max_chars value. ...

To Reproduce

...

Screenshots

screenshot

sminez commented 10 months ago

Hey @greweln, sorry about the delay on this one! I think the fix might be embarrassingly simple...

https://github.com/sminez/penrose/blob/develop/crates/penrose_ui/src/bar/widgets/simple.rs#L129

Pretty sure that all that is required is to change that line from

self.inner.set_text(x.window_title(*id)?)

to

self.set_text(x.window_title(*id)?)

I've just pushed that change on a branch (issue-286) are you able to try that out and verify if it fixes the issue for you?

greweln commented 10 months ago

@sminez I think it should be borrowed here: self.set_text(&x.window_title(*id)?) right?

sminez commented 10 months ago

The fact that those two signatures don't match makes me all kinds of sad 😞

And yeah, that should either be a reference or the signature should be updated so it matches Text::set_text

sminez commented 10 months ago

fixed in #287