mirror of
				https://github.com/swaywm/sway.git
				synced 2025-11-03 09:01:43 -05:00 
			
		
		
		
	When moving between outputs, use output center as reference
This commit is contained in:
		
							parent
							
								
									606d322bc2
								
							
						
					
					
						commit
						37b173f326
					
				
					 1 changed files with 3 additions and 6 deletions
				
			
		| 
						 | 
					@ -308,14 +308,11 @@ void container_move(struct sway_container *container,
 | 
				
			||||||
		case C_OUTPUT: {
 | 
							case C_OUTPUT: {
 | 
				
			||||||
			enum wlr_direction wlr_dir;
 | 
								enum wlr_direction wlr_dir;
 | 
				
			||||||
			sway_dir_to_wlr(move_dir, &wlr_dir);
 | 
								sway_dir_to_wlr(move_dir, &wlr_dir);
 | 
				
			||||||
			double ref_x = current->x + current->width / 2;
 | 
								double ref_lx = current->x + current->width / 2;
 | 
				
			||||||
			double ref_y = current->y + current->height / 2;
 | 
								double ref_ly = current->y + current->height / 2;
 | 
				
			||||||
			ref_x += current->sway_output->swayc->x;
 | 
					 | 
				
			||||||
			ref_y += current->sway_output->swayc->y;
 | 
					 | 
				
			||||||
			struct wlr_output *next = wlr_output_layout_adjacent_output(
 | 
								struct wlr_output *next = wlr_output_layout_adjacent_output(
 | 
				
			||||||
				root_container.sway_root->output_layout, wlr_dir,
 | 
									root_container.sway_root->output_layout, wlr_dir,
 | 
				
			||||||
				current->sway_output->wlr_output,
 | 
									current->sway_output->wlr_output, ref_lx, ref_ly);
 | 
				
			||||||
				current->x, current->y);
 | 
					 | 
				
			||||||
			if (!next) {
 | 
								if (!next) {
 | 
				
			||||||
				wlr_log(L_DEBUG, "Hit edge of output, nowhere else to go");
 | 
									wlr_log(L_DEBUG, "Hit edge of output, nowhere else to go");
 | 
				
			||||||
				return;
 | 
									return;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue