mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
xwayland: assign view->surface earlier in map handler
...as it needs to be set before honouring xwayland_surface->fullscreen
because that calls desktop_update_top_layer_visiblity() which relies on
view->surface being set in view_is_focusable() since 13d0b14.
Fix bug introduced by PR #1237 which fails to hide the xfce4-panel (or
any other layer-shell client in the top layer) whilst gaming in
fullscreen. The bug can be observed with the following games:
- Alan Wake 2 (wine)
- Starfield (steam+proton)
- Cyberpunk (steam+proton)
- Quake 1 Remaster (steam-native)
Fixes: #661 (the last bit of it)
Reported-by: @ScarecrowDM
Helped-by: @Consolatis
This commit is contained in:
parent
1b8e404c9c
commit
49365b26d7
1 changed files with 21 additions and 21 deletions
|
|
@ -518,6 +518,27 @@ xwayland_view_map(struct view *view)
|
|||
ensure_initial_geometry_and_output(view);
|
||||
wlr_scene_node_set_enabled(&view->scene_tree->node, true);
|
||||
|
||||
if (view->surface != xwayland_surface->surface) {
|
||||
if (view->surface) {
|
||||
wl_list_remove(&view->surface_destroy.link);
|
||||
}
|
||||
view->surface = xwayland_surface->surface;
|
||||
|
||||
/* Required to set the surface to NULL when destroyed by the client */
|
||||
view->surface_destroy.notify = handle_surface_destroy;
|
||||
wl_signal_add(&view->surface->events.destroy, &view->surface_destroy);
|
||||
|
||||
/* Will be free'd automatically once the surface is being destroyed */
|
||||
struct wlr_scene_tree *tree = wlr_scene_subsurface_tree_create(
|
||||
view->scene_tree, view->surface);
|
||||
if (!tree) {
|
||||
/* TODO: might need further clean up */
|
||||
wl_resource_post_no_memory(view->surface->resource);
|
||||
return;
|
||||
}
|
||||
view->scene_node = &tree->node;
|
||||
}
|
||||
|
||||
/*
|
||||
* Per the Extended Window Manager Hints (EWMH) spec: "The Window
|
||||
* Manager SHOULD honor _NET_WM_STATE whenever a withdrawn window
|
||||
|
|
@ -542,27 +563,6 @@ xwayland_view_map(struct view *view)
|
|||
}
|
||||
view_maximize(view, axis, /*store_natural_geometry*/ true);
|
||||
|
||||
if (view->surface != xwayland_surface->surface) {
|
||||
if (view->surface) {
|
||||
wl_list_remove(&view->surface_destroy.link);
|
||||
}
|
||||
view->surface = xwayland_surface->surface;
|
||||
|
||||
/* Required to set the surface to NULL when destroyed by the client */
|
||||
view->surface_destroy.notify = handle_surface_destroy;
|
||||
wl_signal_add(&view->surface->events.destroy, &view->surface_destroy);
|
||||
|
||||
/* Will be free'd automatically once the surface is being destroyed */
|
||||
struct wlr_scene_tree *tree = wlr_scene_subsurface_tree_create(
|
||||
view->scene_tree, view->surface);
|
||||
if (!tree) {
|
||||
/* TODO: might need further clean up */
|
||||
wl_resource_post_no_memory(view->surface->resource);
|
||||
return;
|
||||
}
|
||||
view->scene_node = &tree->node;
|
||||
}
|
||||
|
||||
if (!view->toplevel.handle) {
|
||||
init_foreign_toplevel(view);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue