summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-11-10 23:25:48 -0600
committerLeonardo Hernández Hernández <leohdz172@protonmail.com>2022-11-10 23:25:48 -0600
commitfcb3fa4e907d1a7733ddaebc1774f61490b9b640 (patch)
tree2df9b78e37d3270a4dfcd1a4da3d6ce7b978f8f8
parent448a96de13042c76634c2a898c370889b33693d0 (diff)
parentb59c7f6a2e263a67983bed69cd733fe2e5ab0ee6 (diff)
Merge remote-tracking branch 'upstream/main' into wlroots-next
-rw-r--r--client.h4
-rw-r--r--config.def.h3
-rw-r--r--dwl.c28
3 files changed, 23 insertions, 12 deletions
diff --git a/client.h b/client.h
index 64d097f..3c81135 100644
--- a/client.h
+++ b/client.h
@@ -315,7 +315,9 @@ toplevel_from_popup(struct wlr_xdg_popup *popup)
while (1) {
switch (surface->role) {
case WLR_XDG_SURFACE_ROLE_POPUP:
- if (wlr_surface_is_layer_surface(surface->popup->parent))
+ if (!surface->popup->parent)
+ return NULL;
+ else if (wlr_surface_is_layer_surface(surface->popup->parent))
return wlr_layer_surface_v1_from_wlr_surface(surface->popup->parent)->data;
else if (!wlr_surface_is_xdg_surface(surface->popup->parent))
return NULL;
diff --git a/config.def.h b/config.def.h
index ec1f052..b3caab3 100644
--- a/config.def.h
+++ b/config.def.h
@@ -86,8 +86,9 @@ LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE
static const enum libinput_config_accel_profile accel_profile = LIBINPUT_CONFIG_ACCEL_PROFILE_ADAPTIVE;
static const double accel_speed = 0.0;
-/* If you want to use the windows key change this to WLR_MODIFIER_LOGO */
+/* If you want to use the windows key for MODKEY, use WLR_MODIFIER_LOGO */
#define MODKEY WLR_MODIFIER_ALT
+
#define TAGKEYS(KEY,SKEY,TAG) \
{ MODKEY, KEY, view, {.ui = 1 << TAG} }, \
{ MODKEY|WLR_MODIFIER_CTRL, KEY, toggleview, {.ui = 1 << TAG} }, \
diff --git a/dwl.c b/dwl.c
index fa59386..6d44c52 100644
--- a/dwl.c
+++ b/dwl.c
@@ -150,6 +150,7 @@ typedef struct {
struct wlr_box geom;
Monitor *mon;
struct wlr_scene_tree *scene;
+ struct wlr_scene_tree *popups;
struct wlr_scene_layer_surface_v1 *scene_layer;
struct wl_list link;
int mapped;
@@ -463,6 +464,8 @@ arrangelayer(Monitor *m, struct wl_list *list, struct wlr_box *usable_area, int
continue;
wlr_scene_layer_surface_v1_configure(layersurface->scene_layer, &full_area, usable_area);
+ wlr_scene_node_set_position(&layersurface->popups->node,
+ layersurface->scene->node.x, layersurface->scene->node.y);
}
}
@@ -700,10 +703,14 @@ commitlayersurfacenotify(struct wl_listener *listener, void *data)
if (layers[wlr_layer_surface->current.layer] != layersurface->scene->node.parent) {
wlr_scene_node_reparent(&layersurface->scene->node,
layers[wlr_layer_surface->current.layer]);
+ wlr_scene_node_reparent(&layersurface->popups->node,
+ layers[wlr_layer_surface->current.layer]);
wl_list_remove(&layersurface->link);
wl_list_insert(&layersurface->mon->layers[wlr_layer_surface->current.layer],
&layersurface->link);
}
+ if (wlr_layer_surface->current.layer < ZWLR_LAYER_SHELL_V1_LAYER_TOP)
+ wlr_scene_node_reparent(&layersurface->popups->node, layers[LyrTop]);
if (wlr_layer_surface->current.committed == 0
&& layersurface->mapped == wlr_layer_surface->mapped)
@@ -799,8 +806,9 @@ createlayersurface(struct wl_listener *listener, void *data)
layersurface->scene_layer = wlr_scene_layer_surface_v1_create(
layers[wlr_layer_surface->pending.layer], wlr_layer_surface);
- layersurface->scene = wlr_layer_surface->surface->data =
- &layersurface->scene_layer->tree->node;
+ layersurface->scene = layersurface->scene_layer->tree;
+ layersurface->popups = wlr_layer_surface->surface->data =
+ &wlr_scene_tree_create(layers[wlr_layer_surface->pending.layer])->node;
layersurface->scene->node.data = layersurface;
@@ -892,14 +900,10 @@ createnotify(struct wl_listener *listener, void *data)
if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_POPUP) {
struct wlr_box box;
LayerSurface *l = toplevel_from_popup(xdg_surface->popup);
+ if (!xdg_surface->popup->parent)
+ return;
xdg_surface->surface->data = wlr_scene_xdg_surface_create(
xdg_surface->popup->parent->data, xdg_surface);
- /* Raise to top layer if the inmediate parent of the popup is on
- * bottom/background layer, which will cause popups appear below the
- * x{dg,wayland} clients */
- if (wlr_surface_is_layer_surface(xdg_surface->popup->parent) && l
- && l->layer_surface->current.layer < ZWLR_LAYER_SHELL_V1_LAYER_TOP)
- wlr_scene_node_reparent(xdg_surface->surface->data, layers[LyrTop]);
/* Probably the check of `l` is useless, the only thing that can be NULL
* is its monitor */
if (!l || !l->mon)
@@ -1070,8 +1074,9 @@ focusclient(Client *c, int lift)
c->isurgent = 0;
client_restack_surface(c);
- /* Don't change border color if there is an exclusive focus */
- if (!exclusive_focus)
+ /* Don't change border color if there is an exclusive focus or we are
+ * handling a drag operation */
+ if (!exclusive_focus && !seat->drag)
for (i = 0; i < 4; i++)
wlr_scene_rect_set_color(c->border[i], focuscolor);
}
@@ -2134,6 +2139,9 @@ void
startdrag(struct wl_listener *listener, void *data)
{
struct wlr_drag *drag = data;
+ /* During drag the focus isn't sent to clients, this causes that
+ * we don't update border color acording the pointer coordinates */
+ focusclient(NULL, 0);
if (!drag->icon)
return;