91861 / wayst

A simple terminal emulator
MIT License
287 stars 9 forks source link

Resizing wayst window size, happens only if focused #35

Closed freed00m closed 4 years ago

freed00m commented 4 years ago

Using a tiling WM, users can resize window without having a focus on it. (Like active window shrinks then non active window expands.)

Wayst if not focused wont expand content, but onlyu if it was previously focused.

Reproduction: Open two wayst terminals in Tiling WM, make focus on both windows ( so they write their last know sizes ), then shrink the active wayst window and observe the non-focused terminal not size adjusted.

2020-07-14-232011_grim

freed00m commented 4 years ago

It seems all drawing is stopped.

91861 commented 4 years ago

The problem with this is that redrawing when the window is offscreen will block until the window is mapped again, stop the interpreter and cause #33. Sway is not sending wl_surface::leave events when moving windows to other workspaces (I'm not sure if it should or if it's a bug, gnome for example does and 97045b7d14e44af7e5a16ca706d9e048e4f670c8 works fine there) so there is no way that I know of to detect if the window can be repainted.

freed00m commented 4 years ago

@91861 well all rendering stops when I leave the focus even on the same workspace, that would make the terminal completely unuseable.

Well some workspaces can be off screen

That 97045b7 commit fixed it even on wlroots/sway, so thx, do you think we should ask @emersion for opinnion ?

And #33 still sometimes happens with it.

emersion commented 4 years ago

Sway is not sending wl_surface::leave events when moving windows to other workspaces (I'm not sure if it should or if it's a bug, gnome for example does and 97045b7 works fine there) so there is no way that I know of to detect if the window can be repainted.

wl_surface.leave should not be used for this purpose. Even on GNOME there are cases where wl_surface.leave isn't sent and the window shouldn't be repainted, I bet this happens when the window is hidden behind other windows for instance.

Instead wl_surface.frame should be used. See: https://emersion.fr/blog/2018/wayland-rendering-loop/

emersion commented 4 years ago

Opened https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/86 to make this clear in the protocol.