VALID_WINDOW(win, return);
g_return_if_fail(win->type == wintype_TextGrid);
+ /* Don't do anything if the window is shrunk down to nothing */
+ if(win->width == 0 || win->height == 0)
+ return;
+
/* Calculate actual position if cursor is moved past the right edge */
if(xpos >= win->width)
{