From 129deaffa82650a1383f5816aa46f4a78a73b2ed Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 16 Apr 2022 17:41:14 +0200 Subject: wayland: optionally disable pointer input on subsurfaces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We have a number of sub-surfaces for which we are *not* interrested in pointer (or touch) input. Up until now, we’ve manually dealt with these, by recognizing these surfaces in all pointer events, and ignoring them. But, lo and behold, there are better ways of doing this. By clearing the subsurface’s input region, the compositor will do this for us - when a pointer is outside a surface’s input region, the event is passed to the next surface underneath it. This is exactly what we want! Do this for all subsurfaces, *except* the CSDs. --- terminal.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'terminal.c') diff --git a/terminal.c b/terminal.c index b78279e4..87c14b58 100644 --- a/terminal.c +++ b/terminal.c @@ -3008,10 +3008,6 @@ term_xcursor_update_for_seat(struct terminal *term, struct seat *seat) : XCURSOR_LEFT_PTR; break; } - case TERM_SURF_SEARCH: - case TERM_SURF_SCROLLBACK_INDICATOR: - case TERM_SURF_RENDER_TIMER: - case TERM_SURF_JUMP_LABEL: case TERM_SURF_TITLE: case TERM_SURF_BUTTON_MINIMIZE: case TERM_SURF_BUTTON_MAXIMIZE: @@ -3389,12 +3385,6 @@ term_surface_kind(const struct terminal *term, const struct wl_surface *surface) { if (likely(surface == term->window->surface)) return TERM_SURF_GRID; - else if (surface == term->window->search.surf) - return TERM_SURF_SEARCH; - else if (surface == term->window->scrollback_indicator.surf) - return TERM_SURF_SCROLLBACK_INDICATOR; - else if (surface == term->window->render_timer.surf) - return TERM_SURF_RENDER_TIMER; else if (surface == term->window->csd.surface[CSD_SURF_TITLE].surf) return TERM_SURF_TITLE; else if (surface == term->window->csd.surface[CSD_SURF_LEFT].surf) @@ -3411,13 +3401,8 @@ term_surface_kind(const struct terminal *term, const struct wl_surface *surface) return TERM_SURF_BUTTON_MAXIMIZE; else if (surface == term->window->csd.surface[CSD_SURF_CLOSE].surf) return TERM_SURF_BUTTON_CLOSE; - else { - tll_foreach(term->window->urls, it) { - if (surface == it->item.surf.surf) - return TERM_SURF_JUMP_LABEL; - } + else return TERM_SURF_NONE; - } } static bool -- cgit v1.3