dwl

My patch set and modifications to dwl
git clone git://git.ethandl.dev/dwl
Log | Files | Refs | README | LICENSE

commit 499a43db744227500a88ba541816d950424d87eb
parent ce5d116efd54ee82602a5768d7f50fa7888efdf9
Author: Devin J. Pohly <djpohly@gmail.com>
Date:   Sun, 26 Apr 2020 21:55:49 -0500

funnel isfloating changes through setfloating()

Diffstat:
Mdwl.c | 17++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/dwl.c b/dwl.c @@ -162,6 +162,7 @@ static void run(char *startup_cmd); static void scalebox(struct wlr_box *box, float scale); static Client *selclient(void); static void setcursor(struct wl_listener *listener, void *data); +static void setfloating(Client *c, int floating); static void setlayout(const Arg *arg); static void setmfact(const Arg *arg); static void setmon(Client *c, Monitor *m); @@ -736,8 +737,7 @@ movemouse(const Arg *arg) return; /* Float the window and tell motionnotify to grab it */ - if (!grabc->isfloating && selmon->lt[selmon->sellt]->arrange) - grabc->isfloating = 1; + setfloating(grabc, 1); cursor_mode = CurMove; wlr_xcursor_manager_set_cursor_image(cursor_mgr, "fleur", cursor); } @@ -957,8 +957,7 @@ resizemouse(const Arg *arg) grabc->x + grabc->w, grabc->y + grabc->h); /* Float the window and tell motionnotify to resize it */ - if (!grabc->isfloating && selmon->lt[selmon->sellt]->arrange) - grabc->isfloating = 1; + setfloating(grabc, 1); cursor_mode = CurResize; wlr_xcursor_manager_set_cursor_image(cursor_mgr, "bottom_right_corner", cursor); @@ -1064,6 +1063,14 @@ setcursor(struct wl_listener *listener, void *data) } void +setfloating(Client *c, int floating) +{ + if (c->isfloating == floating) + return; + c->isfloating = floating; +} + +void setlayout(const Arg *arg) { if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt]) @@ -1282,7 +1289,7 @@ togglefloating(const Arg *arg) if (!sel) return; /* return if fullscreen */ - sel->isfloating = !sel->isfloating /* || sel->isfixed */; + setfloating(sel, !sel->isfloating /* || sel->isfixed */); } void