diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-01-02 16:38:50 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-01-02 16:38:50 +0000 |
| commit | 2192d95fa9126012f7eeae9ac8382dd957b9ae18 (patch) | |
| tree | 0b06fa6f9bb0e938e3033daee957969ea4d497b6 | |
| parent | wayland: ignore early configure calls (diff) | |
wayland: xdg-toplevel-configure: check for stateless configure calls
Ignore configure calls without state, instead of checking for
width/height == 0.
| -rw-r--r-- | wayland.c | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -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) - return; - - struct wayland *wayl = data; - struct terminal *term = wayl_terminal_from_xdg_toplevel(wayl, xdg_toplevel); - + bool stateless = true; bool is_focused = false; + enum xdg_toplevel_state *state; wl_array_for_each(state, states) { - if (*state == XDG_TOPLEVEL_STATE_ACTIVATED) { + 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); + term->visual_focus = is_focused; render_resize(term, width, height); } |
