diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-01-03 10:18:43 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-01-03 10:18:43 +0000 |
| commit | 304355d8edaf8259ff73d34955b006c8f1abd4d4 (patch) | |
| tree | daaeb81aedda039cf3fd5a572a95cf9c37de844a | |
| parent | term: term_init() calls wl_display_roundtrip() (diff) | |
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.
| -rw-r--r-- | wayland.c | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -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 |
