Add support for wlr_virtual_keyboard_v1 protocol

This commit is contained in:
DanyLE
2025-03-11 00:01:47 +01:00
parent 4a7219f03c
commit 9e53955336
4 changed files with 267 additions and 66 deletions

40
diyac.h
View File

@ -17,6 +17,7 @@
#include <wlr/types/wlr_fractional_scale_v1.h>
#include <wlr/types/wlr_foreign_toplevel_management_v1.h>
#include <wlr/types/wlr_session_lock_v1.h>
#include <wlr/types/wlr_virtual_keyboard_v1.h>
#define LAYER_TREE_SZ 4
@ -70,7 +71,12 @@ struct diyac_seat
struct wl_listener request_cursor;
struct wl_listener request_set_selection;
struct wl_listener request_set_primary_selection;
struct wl_list keyboards;
// struct wl_list keyboards;
struct wl_list inputs;
// virtual keyboard support
struct wlr_virtual_keyboard_manager_v1 *virtual_keyboard_manager;
struct wl_listener virtual_keyboard_new;
};
struct diyac_popup
@ -108,8 +114,8 @@ struct diyac_session_lock
struct wlr_session_lock_v1* wlr_session_lock;
struct wl_listener new_surface;
struct wl_listener unlock;
struct wl_listener destroy;
struct wl_listener unlock;
struct wl_listener destroy;
//struct wl_listener new_output;
};
@ -149,6 +155,9 @@ struct diyac_server
struct wl_listener new_output;
struct diyac_session_lock * lock;
struct wl_event_source* proc_mon;
pid_t session_pid;
};
struct diyac_layer_surface
@ -167,14 +176,14 @@ struct diyac_layer_surface
struct diyac_output_lock_handle
{
struct wlr_scene_tree *tree;
struct wlr_scene_rect *background;
struct wlr_scene_rect *background;
struct wlr_session_lock_surface_v1 *surface;
struct diyac_output * output;
struct wl_listener surface_destroy;
struct wl_listener surface_map;
struct wl_listener commit;
struct wl_listener commit;
};
struct diyac_output
@ -243,15 +252,22 @@ struct diyac_view
struct foreign_toplevel toplevel;
};
struct diyac_keyboard
struct diyac_input
{
struct wl_list link;
struct diyac_server *server;
struct wlr_keyboard *wlr_keyboard;
struct wl_listener modifiers;
struct wl_listener key;
struct wl_list link; /* seat.inputs */
struct wlr_input_device *device;
struct diyac_seat *seat;
struct wl_listener destroy;
};
struct diyac_keyboard
{
struct diyac_input input;
struct wl_list link;
struct wlr_keyboard *wlr_keyboard;
struct wl_listener modifiers;
struct wl_listener key;
bool is_virtual;
};
#endif