mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	data-device: only allow one drag at a time
This commit is contained in:
		
							parent
							
								
									faa00a4a33
								
							
						
					
					
						commit
						29952dee19
					
				
					 1 changed files with 10 additions and 0 deletions
				
			
		| 
						 | 
					@ -122,6 +122,9 @@ static void drag_end(struct wlr_drag *drag) {
 | 
				
			||||||
			drag_icon_set_mapped(drag->icon, false);
 | 
								drag_icon_set_mapped(drag->icon, false);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							assert(drag->seat->drag == drag);
 | 
				
			||||||
 | 
							drag->seat->drag = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		wlr_signal_emit_safe(&drag->events.destroy, drag);
 | 
							wlr_signal_emit_safe(&drag->events.destroy, drag);
 | 
				
			||||||
		free(drag);
 | 
							free(drag);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -434,6 +437,13 @@ bool seat_client_start_drag(struct wlr_seat_client *client,
 | 
				
			||||||
		return true;
 | 
							return true;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (seat->drag != NULL) {
 | 
				
			||||||
 | 
							wlr_log(WLR_DEBUG, "Refusing to start drag, "
 | 
				
			||||||
 | 
								"another drag is already in progress");
 | 
				
			||||||
 | 
							free(drag);
 | 
				
			||||||
 | 
							return true;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (icon_surface) {
 | 
						if (icon_surface) {
 | 
				
			||||||
		int32_t touch_id = (point ? point->touch_id : 0);
 | 
							int32_t touch_id = (point ? point->touch_id : 0);
 | 
				
			||||||
		struct wlr_drag_icon *icon =
 | 
							struct wlr_drag_icon *icon =
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue