--- button.c 2021-02-04 09:00:26.000000000 +0800 +++ button.patched.c 2021-02-07 21:31:45.960978282 +0800 @@ -5258,6 +5258,10 @@ if (screen->extend_coords == SET_PIXEL_POSITION_MOUSE) { row = event->y - OriginY(screen); col = event->x - OriginX(screen); + if (row < 0) + row = 0; + if (col < 0) + col = 0; } else { /* Compute character position of mouse pointer */ row = (event->y - screen->border) / FontHeight(screen);