mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	xdg: handle show_window_menu requests
This commit is contained in:
		
							parent
							
								
									31fec2f9cb
								
							
						
					
					
						commit
						80e7b64a41
					
				
					 2 changed files with 15 additions and 0 deletions
				
			
		
							
								
								
									
										14
									
								
								src/xdg.c
									
										
									
									
									
								
							
							
						
						
									
										14
									
								
								src/xdg.c
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -7,6 +7,7 @@
 | 
			
		|||
#include "common/mem.h"
 | 
			
		||||
#include "decorations.h"
 | 
			
		||||
#include "labwc.h"
 | 
			
		||||
#include "menu/menu.h"
 | 
			
		||||
#include "node.h"
 | 
			
		||||
#include "snap-constraints.h"
 | 
			
		||||
#include "view.h"
 | 
			
		||||
| 
						 | 
				
			
			@ -375,6 +376,18 @@ handle_request_fullscreen(struct wl_listener *listener, void *data)
 | 
			
		|||
		&xdg_toplevel_from_view(view)->requested);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
handle_request_show_window_menu(struct wl_listener *listener, void *data)
 | 
			
		||||
{
 | 
			
		||||
	struct xdg_toplevel_view *xdg_toplevel_view = wl_container_of(
 | 
			
		||||
		listener, xdg_toplevel_view, request_show_window_menu);
 | 
			
		||||
	struct server *server = xdg_toplevel_view->base.server;
 | 
			
		||||
	struct menu *menu = menu_get_by_id(server, "client-menu");
 | 
			
		||||
	assert(menu);
 | 
			
		||||
	struct wlr_cursor *cursor = server->seat.cursor;
 | 
			
		||||
	menu_open_root(menu, cursor->x, cursor->y);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void
 | 
			
		||||
handle_set_title(struct wl_listener *listener, void *data)
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			@ -906,6 +919,7 @@ xdg_toplevel_new(struct wl_listener *listener, void *data)
 | 
			
		|||
 | 
			
		||||
	/* Events specific to XDG toplevel views */
 | 
			
		||||
	CONNECT_SIGNAL(toplevel, xdg_toplevel_view, set_app_id);
 | 
			
		||||
	CONNECT_SIGNAL(toplevel, xdg_toplevel_view, request_show_window_menu);
 | 
			
		||||
	CONNECT_SIGNAL(xdg_surface, xdg_toplevel_view, new_popup);
 | 
			
		||||
 | 
			
		||||
	wl_list_insert(&server->views, &view->link);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue