wayland: xdg-toplevel-configure: no need to detect early configure events

We can now lookup terminal instances at all times, making it
unnecessary to detect "early" configure events.

Note that we still need to prevent a resize from happening when
width/height is 0.
This commit is contained in:
Daniel Eklöf 2020-01-03 11:18:43 +01:00
parent 913c684844
commit 304355d8ed
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -411,20 +411,14 @@ xdg_toplevel_configure(void *data, struct xdg_toplevel *xdg_toplevel,
{
LOG_DBG("xdg-toplevel: configure: %dx%d", width, height);
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);
@ -433,7 +427,8 @@ xdg_toplevel_configure(void *data, struct xdg_toplevel *xdg_toplevel,
else if (!is_focused && term->visual_focus)
term_visual_focus_out(term);
render_resize(term, width, height);
if (width > 0 && height > 0)
render_resize(term, width, height);
}
static void