mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
xwayland-unmanaged: prepare for handling more events
Sway handles some xwayland events that labwc still does not. This commit
just starts to rig up some handlers for these with log messages if they
are caught.
- set_geometry: try to handle, but cannot find an application that uses
it, so is untested.
- request_activate - just log caught event
- override_redirect - just log caught event
This commit is contained in:
parent
fcd2425de3
commit
9dcabbcfdd
2 changed files with 49 additions and 0 deletions
|
|
@ -338,6 +338,11 @@ struct view {
|
||||||
struct wl_listener set_decorations; /* xwayland only */
|
struct wl_listener set_decorations; /* xwayland only */
|
||||||
struct wl_listener override_redirect; /* xwayland only */
|
struct wl_listener override_redirect; /* xwayland only */
|
||||||
struct wl_listener new_popup; /* xdg-shell only */
|
struct wl_listener new_popup; /* xdg-shell only */
|
||||||
|
|
||||||
|
/* Not (yet) implemented */
|
||||||
|
/* struct wl_listener set_role; */
|
||||||
|
/* struct wl_listener set_window_type; */
|
||||||
|
/* struct wl_listener set_hints; */
|
||||||
};
|
};
|
||||||
|
|
||||||
#if HAVE_XWAYLAND
|
#if HAVE_XWAYLAND
|
||||||
|
|
@ -347,11 +352,15 @@ struct xwayland_unmanaged {
|
||||||
struct wl_list link;
|
struct wl_list link;
|
||||||
int lx, ly;
|
int lx, ly;
|
||||||
|
|
||||||
|
struct wl_listener request_activate;
|
||||||
struct wl_listener request_configure;
|
struct wl_listener request_configure;
|
||||||
|
/* struct wl_listener request_fullscreen; */
|
||||||
struct wl_listener commit;
|
struct wl_listener commit;
|
||||||
|
struct wl_listener set_geometry;
|
||||||
struct wl_listener map;
|
struct wl_listener map;
|
||||||
struct wl_listener unmap;
|
struct wl_listener unmap;
|
||||||
struct wl_listener destroy;
|
struct wl_listener destroy;
|
||||||
|
struct wl_listener override_redirect;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,21 @@ unmanaged_handle_commit(struct wl_listener *listener, void *data)
|
||||||
unmanaged->ly = xsurface->y;
|
unmanaged->ly = xsurface->y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
unmanaged_handle_set_geometry(struct wl_listener *listener, void *data)
|
||||||
|
{
|
||||||
|
wlr_log(WLR_INFO, "handling set_geometry");
|
||||||
|
struct xwayland_unmanaged *unmanaged =
|
||||||
|
wl_container_of(listener, unmanaged, commit);
|
||||||
|
struct wlr_xwayland_surface *xsurface = unmanaged->xwayland_surface;
|
||||||
|
|
||||||
|
if (xsurface->x != unmanaged->lx || xsurface->y != unmanaged->ly) {
|
||||||
|
wlr_log(WLR_DEBUG, "xwayland-unmanaged surface has moved");
|
||||||
|
unmanaged->lx = xsurface->x;
|
||||||
|
unmanaged->ly = xsurface->y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
unmanaged_handle_map(struct wl_listener *listener, void *data)
|
unmanaged_handle_map(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
|
|
@ -35,6 +50,9 @@ unmanaged_handle_map(struct wl_listener *listener, void *data)
|
||||||
wl_signal_add(&xsurface->surface->events.commit, &unmanaged->commit);
|
wl_signal_add(&xsurface->surface->events.commit, &unmanaged->commit);
|
||||||
unmanaged->commit.notify = unmanaged_handle_commit;
|
unmanaged->commit.notify = unmanaged_handle_commit;
|
||||||
|
|
||||||
|
wl_signal_add(&xsurface->events.set_geometry, &unmanaged->set_geometry);
|
||||||
|
unmanaged->set_geometry.notify = unmanaged_handle_set_geometry;
|
||||||
|
|
||||||
unmanaged->lx = xsurface->x;
|
unmanaged->lx = xsurface->x;
|
||||||
unmanaged->ly = xsurface->y;
|
unmanaged->ly = xsurface->y;
|
||||||
if (wlr_xwayland_or_surface_wants_focus(xsurface)) {
|
if (wlr_xwayland_or_surface_wants_focus(xsurface)) {
|
||||||
|
|
@ -55,6 +73,7 @@ unmanaged_handle_unmap(struct wl_listener *listener, void *data)
|
||||||
wl_container_of(listener, unmanaged, unmap);
|
wl_container_of(listener, unmanaged, unmap);
|
||||||
struct wlr_xwayland_surface *xsurface = unmanaged->xwayland_surface;
|
struct wlr_xwayland_surface *xsurface = unmanaged->xwayland_surface;
|
||||||
wl_list_remove(&unmanaged->link);
|
wl_list_remove(&unmanaged->link);
|
||||||
|
wl_list_remove(&unmanaged->set_geometry.link);
|
||||||
wl_list_remove(&unmanaged->commit.link);
|
wl_list_remove(&unmanaged->commit.link);
|
||||||
|
|
||||||
struct seat *seat = &unmanaged->server->seat;
|
struct seat *seat = &unmanaged->server->seat;
|
||||||
|
|
@ -94,6 +113,18 @@ unmanaged_handle_destroy(struct wl_listener *listener, void *data)
|
||||||
free(unmanaged);
|
free(unmanaged);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
unmanaged_handle_override_redirect(struct wl_listener *listener, void *data)
|
||||||
|
{
|
||||||
|
wlr_log(WLR_INFO(stderr, "override_redirect not handled\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
unmanaged_handle_request_activate(struct wl_listener *listener, void *data)
|
||||||
|
{
|
||||||
|
wlr_log(WLR_INFO(stderr, "request_activate not handled\n");
|
||||||
|
}
|
||||||
|
|
||||||
struct xwayland_unmanaged *
|
struct xwayland_unmanaged *
|
||||||
xwayland_unmanaged_create(struct server *server,
|
xwayland_unmanaged_create(struct server *server,
|
||||||
struct wlr_xwayland_surface *xsurface)
|
struct wlr_xwayland_surface *xsurface)
|
||||||
|
|
@ -112,5 +143,14 @@ xwayland_unmanaged_create(struct server *server,
|
||||||
unmanaged->unmap.notify = unmanaged_handle_unmap;
|
unmanaged->unmap.notify = unmanaged_handle_unmap;
|
||||||
wl_signal_add(&xsurface->events.destroy, &unmanaged->destroy);
|
wl_signal_add(&xsurface->events.destroy, &unmanaged->destroy);
|
||||||
unmanaged->destroy.notify = unmanaged_handle_destroy;
|
unmanaged->destroy.notify = unmanaged_handle_destroy;
|
||||||
|
|
||||||
|
wl_signal_add(&xsurface->events.set_override_redirect,
|
||||||
|
&unmanaged->override_redirect);
|
||||||
|
unmanaged->override_redirect.notify = unmanaged_handle_override_redirect;
|
||||||
|
|
||||||
|
wl_signal_add(&xsurface->events.request_activate,
|
||||||
|
&unmanaged->request_activate);
|
||||||
|
unmanaged->request_activate.notify = unmanaged_handle_request_activate;
|
||||||
|
|
||||||
return unmanaged;
|
return unmanaged;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue