feat: add wlr_foreign_toplevel support

This commit is contained in:
DanyLE
2024-04-12 21:18:42 +02:00
parent bca498f387
commit dced6db8b2
9 changed files with 223 additions and 49 deletions

19
diyac.h
View File

@ -15,6 +15,7 @@
#include <wlr/types/wlr_primary_selection_v1.h>
#include <wlr/types/wlr_primary_selection.h>
#include <wlr/types/wlr_fractional_scale_v1.h>
#include <wlr/types/wlr_foreign_toplevel_management_v1.h>
#define LAYER_TREE_SZ 4
/* For brevity's sake, struct members are annotated where they are used. */
@ -43,9 +44,9 @@ struct diyac_view_state
bool fullscreen;
bool minimized;
/**
* if neither state is on, it means that
* if neither state is on, it means that
* the current state is normal
*/
*/
};
struct diyac_seat
@ -113,6 +114,8 @@ struct diyac_server
struct wl_listener new_xdg_surface;
struct wl_listener new_layer_surface;
struct wl_list views;
struct diyac_view * active_view;
struct wlr_foreign_toplevel_manager_v1 *foreign_toplevel_manager;
/*
* Popups need to be rendered above always-on-top views, so we reparent
@ -162,6 +165,17 @@ struct diyac_output
struct wlr_scene_tree *layer_tree[LAYER_TREE_SZ];
};
struct foreign_toplevel
{
struct wlr_foreign_toplevel_handle_v1 *handle;
struct wl_listener maximize;
struct wl_listener minimize;
struct wl_listener fullscreen;
struct wl_listener activate;
struct wl_listener close;
struct wl_listener destroy;
};
struct diyac_view
{
struct wl_list link;
@ -191,6 +205,7 @@ struct diyac_view
struct wl_listener set_app_id; // only useful when using SSD
struct wl_listener new_popup;
struct foreign_toplevel toplevel;
};
struct diyac_keyboard