mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-03-13 05:34:13 -04:00
scene: add knob to turn off Xwayland surface restacking
This is useful in these cases: - The same surface is added to two different scene-graphs. wlroots can't figure out on its own which scene-graph should drive the Xwayland stacking. - A compositor uses multiple Xwayland servers (e.g. one per app). wlroots will try to restack surfaces from different Xwayland instances and this will not go well.
This commit is contained in:
parent
b094f8aeb3
commit
2c64b30a67
2 changed files with 12 additions and 2 deletions
|
|
@ -105,6 +105,8 @@ struct wlr_scene {
|
||||||
struct wlr_gamma_control_manager_v1 *gamma_control_manager_v1;
|
struct wlr_gamma_control_manager_v1 *gamma_control_manager_v1;
|
||||||
struct wlr_color_manager_v1 *color_manager_v1;
|
struct wlr_color_manager_v1 *color_manager_v1;
|
||||||
|
|
||||||
|
bool restack_xwayland_surfaces;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
struct wl_listener linux_dmabuf_v1_destroy;
|
struct wl_listener linux_dmabuf_v1_destroy;
|
||||||
struct wl_listener gamma_control_manager_v1_destroy;
|
struct wl_listener gamma_control_manager_v1_destroy;
|
||||||
|
|
|
||||||
|
|
@ -185,6 +185,8 @@ struct wlr_scene *wlr_scene_create(void) {
|
||||||
wl_list_init(&scene->gamma_control_manager_v1_destroy.link);
|
wl_list_init(&scene->gamma_control_manager_v1_destroy.link);
|
||||||
wl_list_init(&scene->gamma_control_manager_v1_set_gamma.link);
|
wl_list_init(&scene->gamma_control_manager_v1_set_gamma.link);
|
||||||
|
|
||||||
|
scene->restack_xwayland_surfaces = true;
|
||||||
|
|
||||||
const char *debug_damage_options[] = {
|
const char *debug_damage_options[] = {
|
||||||
"none",
|
"none",
|
||||||
"rerender",
|
"rerender",
|
||||||
|
|
@ -293,6 +295,7 @@ struct scene_update_data {
|
||||||
struct wlr_box update_box;
|
struct wlr_box update_box;
|
||||||
struct wl_list *outputs;
|
struct wl_list *outputs;
|
||||||
bool calculate_visibility;
|
bool calculate_visibility;
|
||||||
|
bool restack_xwayland_surfaces;
|
||||||
|
|
||||||
#if WLR_HAS_XWAYLAND
|
#if WLR_HAS_XWAYLAND
|
||||||
struct wlr_xwayland_surface *restack_above;
|
struct wlr_xwayland_surface *restack_above;
|
||||||
|
|
@ -609,7 +612,9 @@ static bool scene_node_update_iterator(struct wlr_scene_node *node,
|
||||||
|
|
||||||
update_node_update_outputs(node, data->outputs, NULL, NULL);
|
update_node_update_outputs(node, data->outputs, NULL, NULL);
|
||||||
#if WLR_HAS_XWAYLAND
|
#if WLR_HAS_XWAYLAND
|
||||||
restack_xwayland_surface(node, &box, data);
|
if (data->restack_xwayland_surfaces) {
|
||||||
|
restack_xwayland_surface(node, &box, data);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -671,6 +676,7 @@ static void scene_update_region(struct wlr_scene *scene,
|
||||||
},
|
},
|
||||||
.outputs = &scene->outputs,
|
.outputs = &scene->outputs,
|
||||||
.calculate_visibility = scene->calculate_visibility,
|
.calculate_visibility = scene->calculate_visibility,
|
||||||
|
.restack_xwayland_surfaces = scene->restack_xwayland_surfaces,
|
||||||
};
|
};
|
||||||
|
|
||||||
// update node visibility and output enter/leave events
|
// update node visibility and output enter/leave events
|
||||||
|
|
@ -686,7 +692,9 @@ static void scene_node_update(struct wlr_scene_node *node,
|
||||||
int x, y;
|
int x, y;
|
||||||
if (!wlr_scene_node_coords(node, &x, &y)) {
|
if (!wlr_scene_node_coords(node, &x, &y)) {
|
||||||
#if WLR_HAS_XWAYLAND
|
#if WLR_HAS_XWAYLAND
|
||||||
restack_xwayland_surface_below(node);
|
if (scene->restack_xwayland_surfaces) {
|
||||||
|
restack_xwayland_surface_below(node);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
if (damage) {
|
if (damage) {
|
||||||
scene_update_region(scene, damage);
|
scene_update_region(scene, damage);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue