improve xdg + layer shell support

This commit is contained in:
DanyLE
2024-04-01 15:38:57 +02:00
parent 55719d6dba
commit a54dcb682c
13 changed files with 355 additions and 141 deletions

13
layer.c
View File

@ -6,6 +6,7 @@
#include "node.h"
#include "output.h"
#include "seat.h"
#include "cursor.h"
static void popup_handle_new_popup(struct wl_listener *listener, void *data);
static struct diyac_popup *create_layer_popup(struct wlr_xdg_popup *wlr_popup, struct wlr_scene_tree *parent);
@ -76,7 +77,6 @@ static void layer_surface_commit(struct wl_listener *listener, void *data)
/* Process keyboard-interactivity change */
if (committed & WLR_LAYER_SURFACE_V1_STATE_KEYBOARD_INTERACTIVITY)
{
wlr_log(WLR_INFO, "Process keyboard");
process_keyboard_interactivity(layer);
}
@ -89,7 +89,7 @@ static void layer_surface_commit(struct wl_listener *listener, void *data)
* enter a new/moved/resized layer surface.
*/
// cursor_update_focus(layer->server);
wlr_log(WLR_INFO, "update focus");
diyac_cursor_focus(layer->server);
}
}
static void
@ -172,10 +172,13 @@ static void popup_handle_commit(struct wl_listener *listener, void *data)
{
struct diyac_popup *popup =
wl_container_of(listener, popup, commit);
if (popup->wlr_popup->base->initial_commit)
struct wlr_box popup_box ;
wlr_xdg_surface_get_geometry(popup->wlr_popup->base, &popup_box);
wlr_xdg_popup_unconstrain_from_box(popup->wlr_popup, &popup->output_toplevel_sx_box);
if (!wlr_box_empty(&popup_box))
//if (popup->wlr_popup->base->initial_commit)
{
wlr_xdg_popup_unconstrain_from_box(popup->wlr_popup, &popup->output_toplevel_sx_box);
/* Prevent getting called over and over again */
wl_list_remove(&popup->commit.link);