mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	xwayland: notify correct window stacking order to xwayland
Before this commit, when a normal window is raised, xwayland thought it's above always-on-top (AOT) windows even though it's actually below AOT windows in the scene. This means mouse scroll events may be unexpectedly sent to normal windows below AOT windows even when the cursor is hovering over a AOT window. So this commit fixes it by notifying the correct stacking order (where AOT windows are placed above normal windows) to xwayland every time the stacking order is updated. Other benefits of this commit are: - It makes the code more readable and predictable by aggregating logic about stacking order management in xwayland (e.g. shaded windows or windows in other workspaces should be notified to xwayland as being placed at the bottom). - As server->last_raised_view is removed in the previous commit, we were notifying the stacking order to xwayland every time a window with dialog windows is clicked (not when clicking a topmost window without dialogs, due to some optimization in wlroots). This commit fixes this by caching the window stacking order in xwayland_view->stacking_order and notifying it to xwayland only when it's updated.
This commit is contained in:
		
							parent
							
								
									de49054d75
								
							
						
					
					
						commit
						81204b0537
					
				
					 7 changed files with 112 additions and 116 deletions
				
			
		| 
						 | 
				
			
			@ -2,29 +2,12 @@
 | 
			
		|||
/* view-impl-common.c: common code for shell view->impl functions */
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <strings.h>
 | 
			
		||||
#include "common/list.h"
 | 
			
		||||
#include "foreign-toplevel.h"
 | 
			
		||||
#include "labwc.h"
 | 
			
		||||
#include "view.h"
 | 
			
		||||
#include "view-impl-common.h"
 | 
			
		||||
#include "window-rules.h"
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
view_impl_move_to_front(struct view *view)
 | 
			
		||||
{
 | 
			
		||||
	wl_list_remove(&view->link);
 | 
			
		||||
	wl_list_insert(&view->server->views, &view->link);
 | 
			
		||||
	wlr_scene_node_raise_to_top(&view->scene_tree->node);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
view_impl_move_to_back(struct view *view)
 | 
			
		||||
{
 | 
			
		||||
	wl_list_remove(&view->link);
 | 
			
		||||
	wl_list_append(&view->server->views, &view->link);
 | 
			
		||||
	wlr_scene_node_lower_to_bottom(&view->scene_tree->node);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
view_impl_map(struct view *view)
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue