mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	cursor: Do not clamp motion coordinates for XWayland surfaces.
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 do not clamp the motion coordinates for XWayland surfaces. Before this change, attempting to enlarge an XWayland window using a client-side resize handle resulted in the window size lagging behind the mouse cursor quite severely, since each motion event was in effect allowed to expand the window by only a few pixels. The closer the initial button-press was to the edge of the window, the worse the lag would be.
This commit is contained in:
		
							parent
							
								
									19dea7450b
								
							
						
					
					
						commit
						8e6d37772e
					
				
					 1 changed files with 10 additions and 2 deletions
				
			
		
							
								
								
									
										12
									
								
								src/cursor.c
									
										
									
									
									
								
							
							
						
						
									
										12
									
								
								src/cursor.c
									
										
									
									
									
								
							| 
						 | 
					@ -296,8 +296,16 @@ process_cursor_motion(struct server *server, uint32_t time)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		sx = server->seat.cursor->x - view->x;
 | 
							sx = server->seat.cursor->x - view->x;
 | 
				
			||||||
		sy = server->seat.cursor->y - view->y;
 | 
							sy = server->seat.cursor->y - view->y;
 | 
				
			||||||
		sx = sx < 0 ? 0 : (sx > view->w ? view->w : sx);
 | 
							/*
 | 
				
			||||||
		sy = sy < 0 ? 0 : (sy > view->h ? view->h : sy);
 | 
							 * 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 do not clamp the motion
 | 
				
			||||||
 | 
							 * coordinates for XWayland surfaces.
 | 
				
			||||||
 | 
							 */
 | 
				
			||||||
 | 
							if (view->type == LAB_XDG_SHELL_VIEW) {
 | 
				
			||||||
 | 
								sx = sx < 0 ? 0 : (sx > view->w ? view->w : sx);
 | 
				
			||||||
 | 
								sy = sy < 0 ? 0 : (sy > view->h ? view->h : sy);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		if (view->type == LAB_XDG_SHELL_VIEW && view->xdg_surface) {
 | 
							if (view->type == LAB_XDG_SHELL_VIEW && view->xdg_surface) {
 | 
				
			||||||
			/* Take into account invisible CSD borders */
 | 
								/* Take into account invisible CSD borders */
 | 
				
			||||||
			struct wlr_box geo;
 | 
								struct wlr_box geo;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue