mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	HiDPI: send output_enter events to views when they open
This commit is contained in:
		
							parent
							
								
									aa9720f627
								
							
						
					
					
						commit
						1d92404108
					
				
					 4 changed files with 45 additions and 0 deletions
				
			
		| 
						 | 
					@ -376,6 +376,8 @@ void view_for_each_surface(struct view *view,
 | 
				
			||||||
	wlr_surface_iterator_func_t iterator, void *user_data);
 | 
						wlr_surface_iterator_func_t iterator, void *user_data);
 | 
				
			||||||
void view_for_each_popup_surface(struct view *view,
 | 
					void view_for_each_popup_surface(struct view *view,
 | 
				
			||||||
	wlr_surface_iterator_func_t iterator, void *data);
 | 
						wlr_surface_iterator_func_t iterator, void *data);
 | 
				
			||||||
 | 
					void view_output_enter(struct view *view, struct wlr_output *wlr_output);
 | 
				
			||||||
 | 
					void view_output_leave(struct view *view, struct wlr_output *wlr_output);
 | 
				
			||||||
void view_move_to_edge(struct view *view, const char *direction);
 | 
					void view_move_to_edge(struct view *view, const char *direction);
 | 
				
			||||||
void view_snap_to_edge(struct view *view, const char *direction);
 | 
					void view_snap_to_edge(struct view *view, const char *direction);
 | 
				
			||||||
const char *view_get_string_prop(struct view *view, const char *prop);
 | 
					const char *view_get_string_prop(struct view *view, const char *prop);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										38
									
								
								src/view.c
									
										
									
									
									
								
							
							
						
						
									
										38
									
								
								src/view.c
									
										
									
									
									
								
							| 
						 | 
					@ -254,6 +254,44 @@ view_border(struct view *view)
 | 
				
			||||||
	return border;
 | 
						return border;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void
 | 
				
			||||||
 | 
					surface_enter_for_each_surface(struct wlr_surface *surface, int sx, int sy,
 | 
				
			||||||
 | 
							void *user_data)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						struct wlr_output *wlr_output = user_data;
 | 
				
			||||||
 | 
						wlr_surface_send_enter(surface, wlr_output);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void
 | 
				
			||||||
 | 
					surface_leave_for_each_surface(struct wlr_surface *surface, int sx, int sy,
 | 
				
			||||||
 | 
							void *user_data)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						struct wlr_output *wlr_output = user_data;
 | 
				
			||||||
 | 
						wlr_surface_send_leave(surface, wlr_output);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void
 | 
				
			||||||
 | 
					view_output_enter(struct view *view, struct wlr_output *wlr_output)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						view_for_each_surface(view, surface_enter_for_each_surface,
 | 
				
			||||||
 | 
							wlr_output);
 | 
				
			||||||
 | 
						if (view->toplevel_handle) {
 | 
				
			||||||
 | 
							wlr_foreign_toplevel_handle_v1_output_enter(
 | 
				
			||||||
 | 
								view->toplevel_handle, wlr_output);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void
 | 
				
			||||||
 | 
					view_output_leave(struct view *view, struct wlr_output *wlr_output)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						view_for_each_surface(view, surface_leave_for_each_surface,
 | 
				
			||||||
 | 
							wlr_output);
 | 
				
			||||||
 | 
						if (view->toplevel_handle) {
 | 
				
			||||||
 | 
							wlr_foreign_toplevel_handle_v1_output_leave(
 | 
				
			||||||
 | 
								view->toplevel_handle, wlr_output);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void
 | 
					void
 | 
				
			||||||
view_move_to_edge(struct view *view, const char *direction)
 | 
					view_move_to_edge(struct view *view, const char *direction)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -343,6 +343,8 @@ xdg_toplevel_view_map(struct view *view)
 | 
				
			||||||
				 current.link) {
 | 
									 current.link) {
 | 
				
			||||||
			view_subsurface_create(view, subsurface);
 | 
								view_subsurface_create(view, subsurface);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							struct wlr_output *wlr_output = view_wlr_output(view);
 | 
				
			||||||
 | 
							view_output_enter(view, wlr_output);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		view->been_mapped = true;
 | 
							view->been_mapped = true;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -256,6 +256,9 @@ map(struct view *view)
 | 
				
			||||||
		view->x = box.x;
 | 
							view->x = box.x;
 | 
				
			||||||
		view->y = box.y;
 | 
							view->y = box.y;
 | 
				
			||||||
		view_center(view);
 | 
							view_center(view);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							struct wlr_output *wlr_output = view_wlr_output(view);
 | 
				
			||||||
 | 
							view_output_enter(view, wlr_output);
 | 
				
			||||||
		view->been_mapped = true;
 | 
							view->been_mapped = true;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue