mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
wayland: xdg-toplevel-configure: check for stateless configure calls
Ignore configure calls without state, instead of checking for width/height == 0.
This commit is contained in:
parent
4a9f359a6a
commit
2192d95fa9
1 changed files with 12 additions and 9 deletions
21
wayland.c
21
wayland.c
|
|
@ -411,20 +411,23 @@ xdg_toplevel_configure(void *data, struct xdg_toplevel *xdg_toplevel,
|
|||
{
|
||||
LOG_DBG("xdg-toplevel: configure: %dx%d", width, height);
|
||||
|
||||
if (width == 0 && height == 0)
|
||||
bool stateless = true;
|
||||
bool is_focused = false;
|
||||
|
||||
enum xdg_toplevel_state *state;
|
||||
wl_array_for_each(state, states) {
|
||||
stateless = false;
|
||||
|
||||
if (*state == XDG_TOPLEVEL_STATE_ACTIVATED)
|
||||
is_focused = true;
|
||||
}
|
||||
|
||||
if (stateless)
|
||||
return;
|
||||
|
||||
struct wayland *wayl = data;
|
||||
struct terminal *term = wayl_terminal_from_xdg_toplevel(wayl, xdg_toplevel);
|
||||
|
||||
bool is_focused = false;
|
||||
enum xdg_toplevel_state *state;
|
||||
wl_array_for_each(state, states) {
|
||||
if (*state == XDG_TOPLEVEL_STATE_ACTIVATED) {
|
||||
is_focused = true;
|
||||
}
|
||||
}
|
||||
|
||||
term->visual_focus = is_focused;
|
||||
render_resize(term, width, height);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue