mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	src/view.c: Allow snapping to the same edge
Reported-by: @Flrian via IRC Debugged-by: @Flrian Tested-by: @Flrian
This commit is contained in:
		
							parent
							
								
									0db67a508c
								
							
						
					
					
						commit
						83a0be1b9c
					
				
					 1 changed files with 16 additions and 1 deletions
				
			
		
							
								
								
									
										17
									
								
								src/view.c
									
										
									
									
									
								
							
							
						
						
									
										17
									
								
								src/view.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -855,7 +855,22 @@ view_snap_to_edge(struct view *view, const char *direction,
 | 
			
		|||
			edge = view_edge_invert(edge);
 | 
			
		||||
			output = output_from_wlr_output(view->server, new_output);
 | 
			
		||||
		} else {
 | 
			
		||||
			/* No more output to move to */
 | 
			
		||||
			/*
 | 
			
		||||
			 * No more output to move to
 | 
			
		||||
			 *
 | 
			
		||||
			 * We re-apply the tiled geometry without changing any
 | 
			
		||||
			 * state because the window might have been moved away
 | 
			
		||||
			 * (and thus got untiled) and then snapped back to the
 | 
			
		||||
			 * original edge.
 | 
			
		||||
			 *
 | 
			
		||||
			 * TODO: The described pattern will cause another bug
 | 
			
		||||
			 *       in multi monitor setups: it will snap the
 | 
			
		||||
			 *       window to the inverted edge of the nearest
 | 
			
		||||
			 *       output. This is the desired behavior when
 | 
			
		||||
			 *       caused by a keybind but doesn't make sense
 | 
			
		||||
			 *       when caused by mouse movement.
 | 
			
		||||
			 */
 | 
			
		||||
			view_apply_tiled_geometry(view, output);
 | 
			
		||||
			return;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue