Merge remote-tracking branch 'upstream/main' into wlroots-next

This commit is contained in:
Leonardo Hernández Hernández 2022-12-02 10:39:06 -06:00
commit 1b39bbf316
No known key found for this signature in database
GPG Key ID: E538897EE11B9624
5 changed files with 27 additions and 23 deletions

View File

@ -8,7 +8,7 @@ assignees: ''
--- ---
## Info ## Info
dwl's commit: dwl version:
wlroots version: wlroots version:
## Description ## Description
<!-- <!--

View File

@ -184,8 +184,7 @@ client_is_float_type(Client *c)
} }
#endif #endif
return ((min.width > 0 || min.height > 0 || max.width > 0 || max.height > 0) return ((min.width > 0 || min.height > 0 || max.width > 0 || max.height > 0)
&& (min.width == max.width || min.height == max.height)) && (min.width == max.width || min.height == max.height));
|| client_get_parent(c);
} }
static inline int static inline int

View File

@ -1,11 +1,12 @@
/* appearance */ /* appearance */
static const int sloppyfocus = 1; /* focus follows mouse */ static const int sloppyfocus = 1; /* focus follows mouse */
static const unsigned int borderpx = 1; /* border pixel of windows */ static const int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's surface isn't visible */
static const float rootcolor[] = {0.3, 0.3, 0.3, 1.0}; static const unsigned int borderpx = 1; /* border pixel of windows */
static const float bordercolor[] = {0.5, 0.5, 0.5, 1.0}; static const float rootcolor[] = {0.3, 0.3, 0.3, 1.0};
static const float focuscolor[] = {1.0, 0.0, 0.0, 1.0}; static const float bordercolor[] = {0.5, 0.5, 0.5, 1.0};
static const float focuscolor[] = {1.0, 0.0, 0.0, 1.0};
/* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */ /* To conform the xdg-protocol, set the alpha to zero to restore the old behavior */
static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0}; static const float fullscreen_bg[] = {0.1, 0.1, 0.1, 1.0};
/* tagging */ /* tagging */
static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" }; static const char *tags[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };

View File

@ -1,4 +1,4 @@
_VERSION = 0.3.1-dev _VERSION = 0.4-rc1
VERSION = `git describe --long --tags --dirty 2>/dev/null || echo $(_VERSION)` VERSION = `git describe --long --tags --dirty 2>/dev/null || echo $(_VERSION)`
PKG_CONFIG = pkg-config PKG_CONFIG = pkg-config

30
dwl.c
View File

@ -390,8 +390,8 @@ applybounds(Client *c, struct wlr_box *bbox)
struct wlr_box min = {0}, max = {0}; struct wlr_box min = {0}, max = {0};
client_get_size_hints(c, &max, &min); client_get_size_hints(c, &max, &min);
/* try to set size hints */ /* try to set size hints */
c->geom.width = MAX(min.width + (2 * c->bw), c->geom.width); c->geom.width = MAX(min.width + (2 * (int)c->bw), c->geom.width);
c->geom.height = MAX(min.height + (2 * c->bw), c->geom.height); c->geom.height = MAX(min.height + (2 * (int)c->bw), c->geom.height);
/* Some clients set them max size to INT_MAX, which does not violates /* Some clients set them max size to INT_MAX, which does not violates
* the protocol but its innecesary, they can set them max size to zero. */ * the protocol but its innecesary, they can set them max size to zero. */
if (max.width > 0 && !(2 * c->bw > INT_MAX - max.width)) /* Checks for overflow */ if (max.width > 0 && !(2 * c->bw > INT_MAX - max.width)) /* Checks for overflow */
@ -598,11 +598,11 @@ void
checkidleinhibitor(struct wlr_surface *exclude) checkidleinhibitor(struct wlr_surface *exclude)
{ {
int inhibited = 0; int inhibited = 0;
struct wlr_scene_tree *tree;
struct wlr_idle_inhibitor_v1 *inhibitor; struct wlr_idle_inhibitor_v1 *inhibitor;
wl_list_for_each(inhibitor, &idle_inhibit_mgr->inhibitors, link) { wl_list_for_each(inhibitor, &idle_inhibit_mgr->inhibitors, link) {
if (exclude != inhibitor->surface && (tree = inhibitor->surface->data) struct wlr_scene_tree *tree = inhibitor->surface->data;
&& tree->node.enabled) { if (bypass_surface_visibility || (exclude != inhibitor->surface
&& tree->node.enabled)) {
inhibited = 1; inhibited = 1;
break; break;
} }
@ -1332,7 +1332,8 @@ void
mapnotify(struct wl_listener *listener, void *data) mapnotify(struct wl_listener *listener, void *data)
{ {
/* Called when the surface is mapped, or ready to display on-screen. */ /* Called when the surface is mapped, or ready to display on-screen. */
Client *p, *c = wl_container_of(listener, c, map); Client *p, *w, *c = wl_container_of(listener, c, map);
Monitor *m;
int i; int i;
/* Create scene tree for this client and its border */ /* Create scene tree for this client and its border */
@ -1360,7 +1361,7 @@ mapnotify(struct wl_listener *listener, void *data)
focusclient(c, 1); focusclient(c, 1);
exclusive_focus = c; exclusive_focus = c;
} }
return; goto unset_fullscreen;
} }
#endif #endif
@ -1384,7 +1385,8 @@ mapnotify(struct wl_listener *listener, void *data)
* we always consider floating, clients that have parent and thus * we always consider floating, clients that have parent and thus
* we set the same tags and monitor than its parent, if not * we set the same tags and monitor than its parent, if not
* try to apply rules for them */ * try to apply rules for them */
if ((p = client_get_parent(c))) { /* TODO: https://github.com/djpohly/dwl/pull/334#issuecomment-1330166324 */
if (c->type == XDGShell && (p = client_get_parent(c))) {
c->isfloating = 1; c->isfloating = 1;
wlr_scene_node_reparent(&c->scene->node, layers[LyrFloat]); wlr_scene_node_reparent(&c->scene->node, layers[LyrFloat]);
setmon(c, p->mon, p->tags); setmon(c, p->mon, p->tags);
@ -1394,6 +1396,12 @@ mapnotify(struct wl_listener *listener, void *data)
printstatus(); printstatus();
c->mon->un_map = 1; c->mon->un_map = 1;
unset_fullscreen:
m = c->mon ? c->mon : xytomon(c->geom.x, c->geom.y);
wl_list_for_each(w, &clients, link)
if (w != c && w->isfullscreen && VISIBLEON(w, m))
setfullscreen(w, 0);
} }
void void
@ -1512,7 +1520,7 @@ moveresize(const Arg *arg)
if (cursor_mode != CurNormal && cursor_mode != CurPressed) if (cursor_mode != CurNormal && cursor_mode != CurPressed)
return; return;
xytonode(cursor->x, cursor->y, NULL, &grabc, NULL, NULL, NULL); xytonode(cursor->x, cursor->y, NULL, &grabc, NULL, NULL, NULL);
if (!grabc || client_is_unmanaged(grabc)) if (!grabc || client_is_unmanaged(grabc) || grabc->isfullscreen)
return; return;
/* Float the window and tell motionnotify to grab it */ /* Float the window and tell motionnotify to grab it */
@ -2510,10 +2518,6 @@ createnotifyx11(struct wl_listener *listener, void *data)
{ {
struct wlr_xwayland_surface *xsurface = data; struct wlr_xwayland_surface *xsurface = data;
Client *c; Client *c;
/* TODO: why we unset fullscreen when a xwayland client is created? */
wl_list_for_each(c, &clients, link)
if (c->isfullscreen && VISIBLEON(c, c->mon))
setfullscreen(c, 0);
/* Allocate a Client for this surface */ /* Allocate a Client for this surface */
c = xsurface->data = ecalloc(1, sizeof(*c)); c = xsurface->data = ecalloc(1, sizeof(*c));