mirror of
				https://codeberg.org/dwl/dwl.git
				synced 2025-11-03 09:01:45 -05:00 
			
		
		
		
	set position of the drag icon in startdrag()
This commit is contained in:
		
							parent
							
								
									f353a0e759
								
							
						
					
					
						commit
						c2899bc00b
					
				
					 1 changed files with 5 additions and 6 deletions
				
			
		
							
								
								
									
										11
									
								
								dwl.c
									
										
									
									
									
								
							
							
						
						
									
										11
									
								
								dwl.c
									
										
									
									
									
								
							| 
						 | 
					@ -1288,21 +1288,20 @@ motionnotify(uint32_t time)
 | 
				
			||||||
	double sx = 0, sy = 0;
 | 
						double sx = 0, sy = 0;
 | 
				
			||||||
	Client *c = NULL;
 | 
						Client *c = NULL;
 | 
				
			||||||
	struct wlr_surface *surface = NULL;
 | 
						struct wlr_surface *surface = NULL;
 | 
				
			||||||
 | 
						struct wlr_drag_icon *icon;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* time is 0 in internal calls meant to restore pointer focus. */
 | 
						/* time is 0 in internal calls meant to restore pointer focus. */
 | 
				
			||||||
	if (time) {
 | 
						if (time) {
 | 
				
			||||||
		struct wlr_drag_icon *icon;
 | 
					 | 
				
			||||||
		wlr_idle_notify_activity(idle, seat);
 | 
							wlr_idle_notify_activity(idle, seat);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		/* Update selmon (even while dragging a window) */
 | 
							/* Update selmon (even while dragging a window) */
 | 
				
			||||||
		if (sloppyfocus)
 | 
							if (sloppyfocus)
 | 
				
			||||||
			selmon = xytomon(cursor->x, cursor->y);
 | 
								selmon = xytomon(cursor->x, cursor->y);
 | 
				
			||||||
 | 
					 | 
				
			||||||
		if (seat->drag && (icon = seat->drag->icon))
 | 
					 | 
				
			||||||
			wlr_scene_node_set_position(icon->data, cursor->x + icon->surface->sx,
 | 
					 | 
				
			||||||
					cursor->y + icon->surface->sy);
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (seat->drag && (icon = seat->drag->icon))
 | 
				
			||||||
 | 
							wlr_scene_node_set_position(icon->data, cursor->x + icon->surface->sx,
 | 
				
			||||||
 | 
									cursor->y + icon->surface->sy);
 | 
				
			||||||
	/* If we are currently grabbing the mouse, handle and return */
 | 
						/* If we are currently grabbing the mouse, handle and return */
 | 
				
			||||||
	if (cursor_mode == CurMove) {
 | 
						if (cursor_mode == CurMove) {
 | 
				
			||||||
		/* Move the grabbed client to the new position. */
 | 
							/* Move the grabbed client to the new position. */
 | 
				
			||||||
| 
						 | 
					@ -1955,7 +1954,7 @@ startdrag(struct wl_listener *listener, void *data)
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	drag->icon->data = wlr_scene_subsurface_tree_create(layers[LyrTop], drag->icon->surface);
 | 
						drag->icon->data = wlr_scene_subsurface_tree_create(layers[LyrTop], drag->icon->surface);
 | 
				
			||||||
	wlr_scene_node_raise_to_top(drag->icon->data);
 | 
						motionnotify(0);
 | 
				
			||||||
	wl_signal_add(&drag->icon->events.destroy, &drag_icon_destroy);
 | 
						wl_signal_add(&drag->icon->events.destroy, &drag_icon_destroy);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue