mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-22 05:33:45 -04:00
term: add visually focused attribute to terminal struct
This commit is contained in:
parent
4ecb0ecf4d
commit
eb1ea2d80d
2 changed files with 14 additions and 4 deletions
|
|
@ -276,6 +276,7 @@ struct terminal {
|
||||||
|
|
||||||
struct wayland *wl;
|
struct wayland *wl;
|
||||||
struct wl_window *window;
|
struct wl_window *window;
|
||||||
|
bool visual_focus;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
int scrollback_lines;
|
int scrollback_lines;
|
||||||
|
|
|
||||||
17
wayland.c
17
wayland.c
|
|
@ -411,12 +411,21 @@ xdg_toplevel_configure(void *data, struct xdg_toplevel *xdg_toplevel,
|
||||||
{
|
{
|
||||||
LOG_DBG("xdg-toplevel: configure: %dx%d", width, height);
|
LOG_DBG("xdg-toplevel: configure: %dx%d", width, height);
|
||||||
|
|
||||||
if (width <= 0 || height <= 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
struct wayland *wayl = data;
|
struct wayland *wayl = data;
|
||||||
struct terminal *term = wayl_terminal_from_xdg_toplevel(wayl, xdg_toplevel);
|
struct terminal *term = wayl_terminal_from_xdg_toplevel(wayl, xdg_toplevel);
|
||||||
render_resize(term, width, height);
|
|
||||||
|
bool is_focused = false;
|
||||||
|
enum xdg_toplevel_state *state;
|
||||||
|
wl_array_for_each(state, states) {
|
||||||
|
if (*state == XDG_TOPLEVEL_STATE_ACTIVATED) {
|
||||||
|
is_focused = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
term->visual_focus = is_focused;
|
||||||
|
|
||||||
|
if (width >= 0 && height >= 0)
|
||||||
|
render_resize(term, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue