mirror of
https://github.com/labwc/labwc.git
synced 2026-02-06 04:06:33 -05:00
src/cursor.c: Ignore out-of-surface movement for surfaces without views
Backport of 499df78531
This commit is contained in:
parent
0738965f2d
commit
0284956ce8
1 changed files with 5 additions and 1 deletions
|
|
@ -300,13 +300,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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue