]> git.mdlowis.com Git - proto/labwc.git/commitdiff
src/cursor.c: Ignore out-of-surface movement for surfaces without views
authorConsolatis <35009135+Consolatis@users.noreply.github.com>
Wed, 25 May 2022 19:46:47 +0000 (21:46 +0200)
committerJohan Malm <johanmalm@users.noreply.github.com>
Wed, 25 May 2022 20:32:48 +0000 (21:32 +0100)
src/cursor.c

index b4a82638172f74e784882f3afa52457c0dc0a055..f9cbad7eed744065b810cb6b52a7bbe1ce22d2d6 100644 (file)
@@ -297,13 +297,17 @@ process_cursor_motion(struct server *server, uint32_t time)
                        server->seat.pressed.surface != surface &&
                        !server->seat.drag_icon) {
                /*
-                * Button has been pressed while over a view surface
+                * Button has been pressed while over another surface
                 * and is still held down. Just send the adjusted motion
                 * events to the focused surface so we can keep scrolling
                 * or selecting text even if the cursor moves outside of
                 * the surface.
                 */
                view = server->seat.pressed.view;
+               if (!view) {
+                       /* Button press originated on a layer surface, just ignore */
+                       return;
+               }
                sx = server->seat.cursor->x - view->x;
                sy = server->seat.cursor->y - view->y;
                sx = sx < 0 ? 0 : (sx > view->w ? view->w : sx);