mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-07 04:06:07 -05:00
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:
parent
913c684844
commit
304355d8ed
1 changed files with 2 additions and 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue