mirror of
https://github.com/labwc/labwc.git
synced 2025-11-08 13:30:00 -05:00
desktop: don't use LAB_NODE_LAYER_SUBSURFACE node type
Instead, set ctx.type = LAB_NODE_LAYER_SURFACE for both layer-surfaces and layer-subsurfaces. This patch preserves the existing behaviors: - Pressing a subsurface of an on-demand layer-surface gives pointer focus to the subsurface, but gives keyboard focus to the parent layer-surface (related:a5fcbfaf). - Pressing a subsurface of a layer-surface doesn't close a popup (related:a89bcc3c).
This commit is contained in:
parent
574b20fbff
commit
3d670b772d
6 changed files with 23 additions and 83 deletions
|
|
@ -17,7 +17,6 @@ labwc_sources += files(
|
|||
'parse-double.c',
|
||||
'scene-helpers.c',
|
||||
'set.c',
|
||||
'surface-helpers.c',
|
||||
'spawn.c',
|
||||
'string-helpers.c',
|
||||
'xml.c',
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
#include "common/surface-helpers.h"
|
||||
#include <wlr/types/wlr_layer_shell_v1.h>
|
||||
#include <wlr/types/wlr_subcompositor.h>
|
||||
#include <wlr/util/log.h>
|
||||
|
||||
struct wlr_layer_surface_v1 *
|
||||
subsurface_parent_layer(struct wlr_surface *wlr_surface)
|
||||
{
|
||||
struct wlr_subsurface *subsurface =
|
||||
wlr_subsurface_try_from_wlr_surface(wlr_surface);
|
||||
if (!subsurface) {
|
||||
return NULL;
|
||||
}
|
||||
struct wlr_surface *parent = subsurface->parent;
|
||||
if (!parent) {
|
||||
wlr_log(WLR_DEBUG, "subsurface %p has no parent", subsurface);
|
||||
return NULL;
|
||||
}
|
||||
struct wlr_layer_surface_v1 *wlr_layer_surface =
|
||||
wlr_layer_surface_v1_try_from_wlr_surface(parent);
|
||||
if (wlr_layer_surface) {
|
||||
return wlr_layer_surface;
|
||||
}
|
||||
/* Recurse in case there are nested sub-surfaces */
|
||||
return subsurface_parent_layer(parent);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue