aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-01-03 12:40:37 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-01-03 12:40:37 +0000
commit9372fb41666f21a96c300793e7b4b6721eb1a838 (patch)
tree7cd07bee4cf59c5959179fc204264af4522eb670
parentwayland: window now keeps pointer to owning terminal, not wayland (diff)
wayland: window: pass window pointer to wl-surface callbacks
-rw-r--r--wayland.c16
1 files 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);