From 9372fb41666f21a96c300793e7b4b6721eb1a838 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Fri, 3 Jan 2020 13:40:37 +0100 Subject: [PATCH] wayland: window: pass window pointer to wl-surface callbacks --- wayland.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/wayland.c b/wayland.c index 18db638a..50e2c0ff 100644 --- a/wayland.c +++ b/wayland.c @@ -361,10 +361,10 @@ static void surface_enter(void *data, struct wl_surface *wl_surface, struct wl_output *wl_output) { - struct wayland *wayl = data; - struct terminal *term = wayl_terminal_from_surface(wayl, wl_surface); + struct wl_window *win = data; + struct terminal *term = win->term; - tll_foreach(wayl->monitors, it) { + tll_foreach(term->wl->monitors, it) { if (it->item.output == wl_output) { LOG_DBG("mapped on %s", it->item.name); tll_push_back(term->window->on_outputs, &it->item); @@ -372,7 +372,7 @@ surface_enter(void *data, struct wl_surface *wl_surface, /* Resize, since scale-to-use may have changed */ int scale = term->scale; render_resize(term, term->width / scale, term->height / scale, true); - wayl_reload_cursor_theme(wayl, term); + wayl_reload_cursor_theme(term->wl, term); return; } } @@ -384,8 +384,8 @@ static void surface_leave(void *data, struct wl_surface *wl_surface, struct wl_output *wl_output) { - struct wayland *wayl = data; - struct terminal *term = wayl_terminal_from_surface(wayl, wl_surface); + struct wl_window *win = data; + struct terminal *term = win->term; tll_foreach(term->window->on_outputs, it) { if (it->item->output != wl_output) @@ -397,7 +397,7 @@ surface_leave(void *data, struct wl_surface *wl_surface, /* Resize, since scale-to-use may have changed */ int scale = term->scale; render_resize(term, term->width / scale, term->height / scale, true); - wayl_reload_cursor_theme(wayl, term); + wayl_reload_cursor_theme(term->wl, term); return; } @@ -838,7 +838,7 @@ wayl_win_init(struct terminal *term) goto out; } - wl_surface_add_listener(win->surface, &surface_listener, wayl); + wl_surface_add_listener(win->surface, &surface_listener, win); win->xdg_surface = xdg_wm_base_get_xdg_surface(wayl->shell, win->surface); xdg_surface_add_listener(win->xdg_surface, &xdg_surface_listener, wayl);