mirror of
https://github.com/cage-kiosk/cage.git
synced 2025-10-28 05:40:16 -04:00
Compare commits
2 commits
119f98f2b8
...
63f186632e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63f186632e | ||
|
|
60d41fb93c |
3 changed files with 16 additions and 1 deletions
2
cage.c
2
cage.c
|
|
@ -416,7 +416,7 @@ main(int argc, char *argv[])
|
|||
wl_signal_add(&server.idle_inhibit_v1->events.new_inhibitor, &server.new_idle_inhibitor_v1);
|
||||
wl_list_init(&server.inhibitors);
|
||||
|
||||
struct wlr_xdg_shell *xdg_shell = wlr_xdg_shell_create(server.wl_display, 4);
|
||||
struct wlr_xdg_shell *xdg_shell = wlr_xdg_shell_create(server.wl_display, 5);
|
||||
if (!xdg_shell) {
|
||||
wlr_log(WLR_ERROR, "Unable to create the XDG shell interface");
|
||||
ret = 1;
|
||||
|
|
|
|||
14
xdg_shell.c
14
xdg_shell.c
|
|
@ -227,6 +227,8 @@ handle_xdg_toplevel_commit(struct wl_listener *listener, void *data)
|
|||
return;
|
||||
}
|
||||
|
||||
wlr_xdg_toplevel_set_wm_capabilities(xdg_shell_view->xdg_toplevel, XDG_TOPLEVEL_WM_CAPABILITIES_FULLSCREEN);
|
||||
|
||||
/* When an xdg_surface performs an initial commit, the compositor must
|
||||
* reply with a configure so the client can map the surface. */
|
||||
view_position(&xdg_shell_view->view);
|
||||
|
|
@ -293,6 +295,7 @@ popup_handle_destroy(struct wl_listener *listener, void *data)
|
|||
struct cg_xdg_popup *popup = wl_container_of(listener, popup, destroy);
|
||||
wl_list_remove(&popup->destroy.link);
|
||||
wl_list_remove(&popup->commit.link);
|
||||
wl_list_remove(&popup->reposition.link);
|
||||
free(popup);
|
||||
}
|
||||
|
||||
|
|
@ -306,6 +309,14 @@ popup_handle_commit(struct wl_listener *listener, void *data)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
popup_handle_reposition(struct wl_listener *listener, void *data)
|
||||
{
|
||||
struct cg_xdg_popup *popup = wl_container_of(listener, popup, reposition);
|
||||
|
||||
popup_unconstrain(popup->xdg_popup);
|
||||
}
|
||||
|
||||
void
|
||||
handle_new_xdg_popup(struct wl_listener *listener, void *data)
|
||||
{
|
||||
|
|
@ -350,6 +361,9 @@ handle_new_xdg_popup(struct wl_listener *listener, void *data)
|
|||
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);
|
||||
|
||||
struct wlr_scene_tree *popup_scene_tree = wlr_scene_xdg_surface_create(parent_scene_tree, wlr_popup->base);
|
||||
if (popup_scene_tree == NULL) {
|
||||
wlr_log(WLR_ERROR, "Failed to allocate scene-graph node for XDG popup");
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ struct cg_xdg_popup {
|
|||
|
||||
struct wl_listener destroy;
|
||||
struct wl_listener commit;
|
||||
struct wl_listener reposition;
|
||||
};
|
||||
|
||||
void handle_new_xdg_toplevel(struct wl_listener *listener, void *data);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue