mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	src/view.c: add always_on_top criteria
This commit is contained in:
		
							parent
							
								
									2734302fd2
								
							
						
					
					
						commit
						4d679801ad
					
				
					 2 changed files with 21 additions and 4 deletions
				
			
		| 
						 | 
					@ -222,12 +222,24 @@ struct xdg_toplevel_view {
 | 
				
			||||||
	struct wl_listener new_popup;
 | 
						struct wl_listener new_popup;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* All criteria is applied in AND logic */
 | 
				
			||||||
enum lab_view_criteria {
 | 
					enum lab_view_criteria {
 | 
				
			||||||
 | 
						/* No filter -> all focusable views */
 | 
				
			||||||
	LAB_VIEW_CRITERIA_NONE = 0,
 | 
						LAB_VIEW_CRITERIA_NONE = 0,
 | 
				
			||||||
	LAB_VIEW_CRITERIA_CURRENT_WORKSPACE = 1 << 0,
 | 
					
 | 
				
			||||||
	LAB_VIEW_CRITERIA_FULLSCREEN = 1 << 1,
 | 
						/*
 | 
				
			||||||
	LAB_VIEW_CRITERIA_NO_ALWAYS_ON_TOP = 1 << 2,
 | 
						 * Includes always-on-top views, e.g.
 | 
				
			||||||
	LAB_VIEW_CRITERIA_NO_SKIP_WINDOW_SWITCHER = 1 << 3,
 | 
						 * what is visible on the current workspace
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
 | 
						LAB_VIEW_CRITERIA_CURRENT_WORKSPACE       = 1 << 0,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/* Positive criteria */
 | 
				
			||||||
 | 
						LAB_VIEW_CRITERIA_FULLSCREEN              = 1 << 1,
 | 
				
			||||||
 | 
						LAB_VIEW_CRITERIA_ALWAYS_ON_TOP           = 1 << 2,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/* Negative criteria */
 | 
				
			||||||
 | 
						LAB_VIEW_CRITERIA_NO_ALWAYS_ON_TOP        = 1 << 6,
 | 
				
			||||||
 | 
						LAB_VIEW_CRITERIA_NO_SKIP_WINDOW_SWITCHER = 1 << 7,
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -105,6 +105,11 @@ matches_criteria(struct view *view, enum lab_view_criteria criteria)
 | 
				
			||||||
			return false;
 | 
								return false;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						if (criteria & LAB_VIEW_CRITERIA_ALWAYS_ON_TOP) {
 | 
				
			||||||
 | 
							if (!view_is_always_on_top(view)) {
 | 
				
			||||||
 | 
								return false;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
	if (criteria & LAB_VIEW_CRITERIA_NO_ALWAYS_ON_TOP) {
 | 
						if (criteria & LAB_VIEW_CRITERIA_NO_ALWAYS_ON_TOP) {
 | 
				
			||||||
		if (view_is_always_on_top(view)) {
 | 
							if (view_is_always_on_top(view)) {
 | 
				
			||||||
			return false;
 | 
								return false;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue