struct wl_listener commit;
struct wl_listener destroy;
struct wl_listener new_popup;
+ struct wl_listener reposition;
};
void layers_init(struct server *server);
wl_container_of(listener, popup, destroy);
wl_list_remove(&popup->destroy.link);
wl_list_remove(&popup->new_popup.link);
+ wl_list_remove(&popup->reposition.link);
/* Usually already removed unless there was no commit at all */
if (popup->commit.notify) {
}
}
+static void
+popup_handle_reposition(struct wl_listener *listener, void *data)
+{
+ struct lab_layer_popup *popup =
+ wl_container_of(listener, popup, reposition);
+ wlr_xdg_popup_unconstrain_from_box(popup->wlr_popup,
+ &popup->output_toplevel_sx_box);
+}
+
static void popup_handle_new_popup(struct wl_listener *listener, void *data);
static struct lab_layer_popup *
popup->commit.notify = popup_handle_commit;
wl_signal_add(&wlr_popup->base->surface->events.commit, &popup->commit);
+ popup->reposition.notify = popup_handle_reposition;
+ wl_signal_add(&wlr_popup->events.reposition, &popup->reposition);
+
return popup;
}
struct wl_listener commit;
struct wl_listener destroy;
struct wl_listener new_popup;
+ struct wl_listener reposition;
};
static void
struct xdg_popup *popup = wl_container_of(listener, popup, destroy);
wl_list_remove(&popup->destroy.link);
wl_list_remove(&popup->new_popup.link);
+ wl_list_remove(&popup->reposition.link);
/* Usually already removed unless there was no commit at all */
if (popup->commit.notify) {
}
}
+static void
+handle_xdg_popup_reposition(struct wl_listener *listener, void *data)
+{
+ struct xdg_popup *popup = wl_container_of(listener, popup, reposition);
+ popup_unconstrain(popup);
+}
+
static void
popup_handle_new_xdg_popup(struct wl_listener *listener, void *data)
{
popup->commit.notify = handle_xdg_popup_commit;
wl_signal_add(&wlr_popup->base->surface->events.commit, &popup->commit);
+ popup->reposition.notify = handle_xdg_popup_reposition;
+ wl_signal_add(&wlr_popup->events.reposition, &popup->reposition);
+
/*
* We must add xdg popups to the scene graph so they get rendered. The
* wlroots scene graph provides a helper for this, but to use it we must
#include "window-rules.h"
#include "workspaces.h"
-#define LAB_XDG_SHELL_VERSION (2)
+#define LAB_XDG_SHELL_VERSION (3)
#define CONFIGURE_TIMEOUT_MS 100
static struct xdg_toplevel_view *