mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	node.c: add helpers for returning structs from node data
Support returning the following structs: - view from LAB_NODE_DESC_VIEW or LAB_NODE_DESC_XDG_POPUP - lab_layer_surface form LAB_NODE_DESC_LAYER_SURFACE - lab_layer_popup from LAB_NODE_DESC_LAYER_POPUP
This commit is contained in:
		
							parent
							
								
									30298228e3
								
							
						
					
					
						commit
						b4cbc20e8c
					
				
					 3 changed files with 66 additions and 13 deletions
				
			
		| 
						 | 
				
			
			@ -1,5 +1,4 @@
 | 
			
		|||
// SPDX-License-Identifier: GPL-2.0-only
 | 
			
		||||
#include <assert.h>
 | 
			
		||||
#include <wlr/types/wlr_layer_shell_v1.h>
 | 
			
		||||
#include <wlr/types/wlr_scene.h>
 | 
			
		||||
#include "buffer.h"
 | 
			
		||||
| 
						 | 
				
			
			@ -113,10 +112,7 @@ get_special(struct server *server, struct wlr_scene_node *node,
 | 
			
		|||
		return "server->view_tree";
 | 
			
		||||
	}
 | 
			
		||||
	if (node->parent == &server->view_tree->node) {
 | 
			
		||||
		struct node_descriptor *desc = node->data;
 | 
			
		||||
		assert(desc->type == LAB_NODE_DESC_VIEW
 | 
			
		||||
			|| desc->type == LAB_NODE_DESC_XDG_POPUP);
 | 
			
		||||
		*last_view = desc->data;
 | 
			
		||||
		*last_view = node_view_from_node(node->data);
 | 
			
		||||
	}
 | 
			
		||||
	const char *view_part = get_view_part(*last_view, node);
 | 
			
		||||
	if (view_part) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue