mirror of
https://github.com/swaywm/sway.git
synced 2026-04-22 06:46:27 -04:00
xwayland: restack unmanaged children upon surface activation
Unmanaged surfaces are always rendered on top, but when restacking their owner, they end up behind it, preventing them from receiving input even though they are visible.
This commit is contained in:
parent
51c9376c07
commit
3bc164216f
1 changed files with 22 additions and 5 deletions
|
|
@ -263,6 +263,9 @@ static uint32_t configure(struct sway_view *view, double lx, double ly, int widt
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool is_surface_transient_for(struct wlr_xwayland_surface *surface,
|
||||||
|
struct sway_view *ancestor);
|
||||||
|
|
||||||
static void set_activated(struct sway_view *view, bool activated) {
|
static void set_activated(struct sway_view *view, bool activated) {
|
||||||
if (xwayland_view_from_view(view) == NULL) {
|
if (xwayland_view_from_view(view) == NULL) {
|
||||||
return;
|
return;
|
||||||
|
|
@ -275,6 +278,15 @@ static void set_activated(struct sway_view *view, bool activated) {
|
||||||
|
|
||||||
wlr_xwayland_surface_activate(surface, activated);
|
wlr_xwayland_surface_activate(surface, activated);
|
||||||
wlr_xwayland_surface_restack(surface, NULL, XCB_STACK_MODE_ABOVE);
|
wlr_xwayland_surface_restack(surface, NULL, XCB_STACK_MODE_ABOVE);
|
||||||
|
|
||||||
|
struct sway_xwayland_unmanaged *unmanaged;
|
||||||
|
wl_list_for_each(unmanaged, &root->xwayland_unmanaged, link) {
|
||||||
|
struct wlr_xwayland_surface *unmanaged_surface = unmanaged->wlr_xwayland_surface;
|
||||||
|
if (!is_surface_transient_for(unmanaged_surface, view)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
wlr_xwayland_surface_restack(unmanaged_surface, NULL, XCB_STACK_MODE_ABOVE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_tiled(struct sway_view *view, bool tiled) {
|
static void set_tiled(struct sway_view *view, bool tiled) {
|
||||||
|
|
@ -335,12 +347,8 @@ static void handle_set_decorations(struct wl_listener *listener, void *data) {
|
||||||
view_update_csd_from_client(view, csd);
|
view_update_csd_from_client(view, csd);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool is_transient_for(struct sway_view *child,
|
static bool is_surface_transient_for(struct wlr_xwayland_surface *surface,
|
||||||
struct sway_view *ancestor) {
|
struct sway_view *ancestor) {
|
||||||
if (xwayland_view_from_view(child) == NULL) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
struct wlr_xwayland_surface *surface = child->wlr_xwayland_surface;
|
|
||||||
while (surface) {
|
while (surface) {
|
||||||
if (surface->parent == ancestor->wlr_xwayland_surface) {
|
if (surface->parent == ancestor->wlr_xwayland_surface) {
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -350,6 +358,15 @@ static bool is_transient_for(struct sway_view *child,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool is_transient_for(struct sway_view *child,
|
||||||
|
struct sway_view *ancestor) {
|
||||||
|
if (xwayland_view_from_view(child) == NULL) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
struct wlr_xwayland_surface *surface = child->wlr_xwayland_surface;
|
||||||
|
return is_surface_transient_for(surface, ancestor);
|
||||||
|
}
|
||||||
|
|
||||||
static void _close(struct sway_view *view) {
|
static void _close(struct sway_view *view) {
|
||||||
if (xwayland_view_from_view(view) == NULL) {
|
if (xwayland_view_from_view(view) == NULL) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue