mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-09 08:21:01 -04:00
term: don't enable ptmx FDM callback until Wayland window has been configured
The way things works right now, we cannot enable the ptmx FDM callback right away. We need to wait for the Wayland window to have been configured. Before the window is configured, we don't have a size, and no grid. Thus, if we try to process ptmx data we'll crash since we have no where to write it to. So, registering the ptmx fd with the FDM is now delayed until we've received the first 'configure' event from Wayland.
This commit is contained in:
parent
ae5af7bb06
commit
fc2e385d87
3 changed files with 26 additions and 4 deletions
|
|
@ -454,6 +454,7 @@ xdg_surface_configure(void *data, struct xdg_surface *xdg_surface,
|
|||
struct wl_window *win = data;
|
||||
struct terminal *term = win->term;
|
||||
|
||||
bool wasnt_configured = !win->is_configured;
|
||||
win->is_configured = true;
|
||||
win->is_maximized = win->configure.is_maximized;
|
||||
|
||||
|
|
@ -481,6 +482,9 @@ xdg_surface_configure(void *data, struct xdg_surface *xdg_surface,
|
|||
*/
|
||||
wl_surface_commit(win->surface);
|
||||
}
|
||||
|
||||
if (wasnt_configured)
|
||||
term_window_configured(term);
|
||||
}
|
||||
|
||||
static const struct xdg_surface_listener xdg_surface_listener = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue