]> git.mdlowis.com Git - proto/labwc.git/commitdiff
cursor: do not clamp motion coordinates for xdg-shell surfaces
authorJohan Malm <jgm323@gmail.com>
Tue, 16 Aug 2022 20:56:39 +0000 (21:56 +0100)
committerConsolatis <35009135+Consolatis@users.noreply.github.com>
Wed, 17 Aug 2022 12:03:38 +0000 (14:03 +0200)
...when pointer moves off the xdg-shell surface which is possible when
for example grabbing a scroll-bar or selecting text.

Clamping results in undetected pointer motion when applied in the
direction of movement (for example clamping at view->y masks vertical
movement when the y-coordinate is greater than view->y), which in turn
can appear as sporadic to the end-user.

src/cursor.c

index 6d97ae52817a1da46c3813ad95f8560c9457d0b2..68b2410e03611f5277897629b09597405fb65626 100644 (file)
@@ -304,14 +304,6 @@ process_cursor_motion(struct server *server, uint32_t time)
                sy = server->seat.cursor->y - ly;
 
                if (view && view->type == LAB_XDG_SHELL_VIEW) {
-                       /*
-                        * X11 apps expect to be able to receive motion events outside
-                        * the window area (this is necessary for client-side move/resize
-                        * handles to work properly). So only clamp the motion coordinates
-                        * for XDG surfaces.
-                        */
-                       sx = sx < 0 ? 0 : (sx > view->w ? view->w : sx);
-                       sy = sy < 0 ? 0 : (sy > view->h ? view->h : sy);
                        /* Take into account invisible CSD borders */
                        if (view->xdg_surface) {
                                struct wlr_box geo;