mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	Merge pull request #716 from emersion/fix-cursor-hotspot-update
Fix cursor hotspot update
This commit is contained in:
		
						commit
						efa9eeb5d5
					
				
					 1 changed files with 17 additions and 4 deletions
				
			
		| 
						 | 
					@ -602,12 +602,25 @@ static bool wlr_drm_connector_set_cursor(struct wlr_output *output,
 | 
				
			||||||
		wlr_output_transform_invert(output->transform);
 | 
							wlr_output_transform_invert(output->transform);
 | 
				
			||||||
	wlr_box_transform(&hotspot, transform,
 | 
						wlr_box_transform(&hotspot, transform,
 | 
				
			||||||
		plane->surf.width, plane->surf.height, &hotspot);
 | 
							plane->surf.width, plane->surf.height, &hotspot);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (plane->cursor_hotspot_x != hotspot.x ||
 | 
				
			||||||
 | 
								plane->cursor_hotspot_y != hotspot.y) {
 | 
				
			||||||
 | 
							// Update cursor hotspot
 | 
				
			||||||
 | 
							conn->cursor_x -= hotspot.x - plane->cursor_hotspot_x;
 | 
				
			||||||
 | 
							conn->cursor_y -= hotspot.y - plane->cursor_hotspot_y;
 | 
				
			||||||
		plane->cursor_hotspot_x = hotspot.x;
 | 
							plane->cursor_hotspot_x = hotspot.x;
 | 
				
			||||||
		plane->cursor_hotspot_y = hotspot.y;
 | 
							plane->cursor_hotspot_y = hotspot.y;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!update_pixels) {
 | 
							if (!drm->iface->crtc_move_cursor(drm, conn->crtc, conn->cursor_x,
 | 
				
			||||||
		// Only update the cursor hotspot
 | 
									conn->cursor_y)) {
 | 
				
			||||||
 | 
								return false;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		wlr_output_update_needs_swap(output);
 | 
							wlr_output_update_needs_swap(output);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (!update_pixels) {
 | 
				
			||||||
 | 
							// Don't update cursor image
 | 
				
			||||||
		return true;
 | 
							return true;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue