aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-08-14 05:35:01 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-08-14 05:35:01 +0000
commit44557dc7cf2749469c0f093034f19491f710f540 (patch)
tree250046b3eea01084a71725b94077da48896d2460
parentrender: oops... swprintf() needs to number of *chars*, not *bytes* (diff)
input: don't crash on mouse motion events on the render timer surface
-rw-r--r--input.c4
-rw-r--r--terminal.c4
-rw-r--r--terminal.h1
3 files changed, 8 insertions, 1 deletions
diff --git a/input.c b/input.c
index 55090ff7..5372d044 100644
--- a/input.c
+++ b/input.c
@@ -1072,6 +1072,7 @@ wl_pointer_enter(void *data, struct wl_pointer *wl_pointer,
case TERM_SURF_SEARCH:
case TERM_SURF_SCROLLBACK_INDICATOR:
+ case TERM_SURF_RENDER_TIMER:
case TERM_SURF_TITLE:
render_xcursor_set(seat, term, XCURSOR_LEFT_PTR);
break;
@@ -1151,6 +1152,7 @@ wl_pointer_leave(void *data, struct wl_pointer *wl_pointer,
case TERM_SURF_GRID:
case TERM_SURF_SEARCH:
case TERM_SURF_SCROLLBACK_INDICATOR:
+ case TERM_SURF_RENDER_TIMER:
case TERM_SURF_TITLE:
case TERM_SURF_BORDER_LEFT:
case TERM_SURF_BORDER_RIGHT:
@@ -1187,6 +1189,7 @@ wl_pointer_motion(void *data, struct wl_pointer *wl_pointer,
case TERM_SURF_NONE:
case TERM_SURF_SEARCH:
case TERM_SURF_SCROLLBACK_INDICATOR:
+ case TERM_SURF_RENDER_TIMER:
case TERM_SURF_BUTTON_MINIMIZE:
case TERM_SURF_BUTTON_MAXIMIZE:
case TERM_SURF_BUTTON_CLOSE:
@@ -1433,6 +1436,7 @@ wl_pointer_button(void *data, struct wl_pointer *wl_pointer,
case TERM_SURF_SEARCH:
case TERM_SURF_SCROLLBACK_INDICATOR:
+ case TERM_SURF_RENDER_TIMER:
break;
case TERM_SURF_GRID: {
diff --git a/terminal.c b/terminal.c
index 1c97ee53..70763aa6 100644
--- a/terminal.c
+++ b/terminal.c
@@ -2412,12 +2412,14 @@ term_print(struct terminal *term, wchar_t wc, int width)
enum term_surface
term_surface_kind(const struct terminal *term, const struct wl_surface *surface)
{
- if (surface == term->window->surface)
+ if (likely(surface == term->window->surface))
return TERM_SURF_GRID;
else if (surface == term->window->search_surface)
return TERM_SURF_SEARCH;
else if (surface == term->window->scrollback_indicator_surface)
return TERM_SURF_SCROLLBACK_INDICATOR;
+ else if (surface == term->window->render_timer_surface)
+ return TERM_SURF_RENDER_TIMER;
else if (surface == term->window->csd.surface[CSD_SURF_TITLE])
return TERM_SURF_TITLE;
else if (surface == term->window->csd.surface[CSD_SURF_LEFT])
diff --git a/terminal.h b/terminal.h
index 14c12a62..8509634a 100644
--- a/terminal.h
+++ b/terminal.h
@@ -194,6 +194,7 @@ enum term_surface {
TERM_SURF_GRID,
TERM_SURF_SEARCH,
TERM_SURF_SCROLLBACK_INDICATOR,
+ TERM_SURF_RENDER_TIMER,
TERM_SURF_TITLE,
TERM_SURF_BORDER_LEFT,
TERM_SURF_BORDER_RIGHT,