mirror of
https://codeberg.org/dwl/dwl.git
synced 2025-11-14 06:59:48 -05:00
setfloating
This commit is contained in:
parent
aac620c768
commit
5ce5d11c2d
1 changed files with 15 additions and 5 deletions
20
dwl.c
20
dwl.c
|
|
@ -167,6 +167,7 @@ static void scalebox(struct wlr_box *box, float scale);
|
||||||
static Client *selclient(void);
|
static Client *selclient(void);
|
||||||
static void sendmon(Client *c, Monitor *m);
|
static void sendmon(Client *c, Monitor *m);
|
||||||
static void setcursor(struct wl_listener *listener, void *data);
|
static void setcursor(struct wl_listener *listener, void *data);
|
||||||
|
static void setfloating(Client *c, int floating);
|
||||||
static void setlayout(const Arg *arg);
|
static void setlayout(const Arg *arg);
|
||||||
static void setmfact(const Arg *arg);
|
static void setmfact(const Arg *arg);
|
||||||
static void setup(void);
|
static void setup(void);
|
||||||
|
|
@ -728,7 +729,7 @@ movemouse(const Arg *arg)
|
||||||
|
|
||||||
/* Float the window and tell motionnotify to grab it */
|
/* Float the window and tell motionnotify to grab it */
|
||||||
if (!grabc->isfloating && selmon->lt[selmon->sellt]->arrange)
|
if (!grabc->isfloating && selmon->lt[selmon->sellt]->arrange)
|
||||||
grabc->isfloating = 1;
|
setfloating(grabc, 1);
|
||||||
cursor_mode = CurMove;
|
cursor_mode = CurMove;
|
||||||
wlr_xcursor_manager_set_cursor_image(cursor_mgr, "fleur", cursor);
|
wlr_xcursor_manager_set_cursor_image(cursor_mgr, "fleur", cursor);
|
||||||
}
|
}
|
||||||
|
|
@ -961,7 +962,7 @@ resizemouse(const Arg *arg)
|
||||||
|
|
||||||
/* Float the window and tell motionnotify to resize it */
|
/* Float the window and tell motionnotify to resize it */
|
||||||
if (!grabc->isfloating && selmon->lt[selmon->sellt]->arrange)
|
if (!grabc->isfloating && selmon->lt[selmon->sellt]->arrange)
|
||||||
grabc->isfloating = 1;
|
setfloating(grabc, 1);
|
||||||
cursor_mode = CurResize;
|
cursor_mode = CurResize;
|
||||||
wlr_xcursor_manager_set_cursor_image(cursor_mgr,
|
wlr_xcursor_manager_set_cursor_image(cursor_mgr,
|
||||||
"bottom_right_corner", cursor);
|
"bottom_right_corner", cursor);
|
||||||
|
|
@ -1290,14 +1291,23 @@ tile(Monitor *m)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
setfloating(Client *c, int floating)
|
||||||
|
{
|
||||||
|
if (c->isfloating == floating)
|
||||||
|
return;
|
||||||
|
c->isfloating = floating;
|
||||||
|
arrange(c->mon);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
togglefloating(const Arg *arg)
|
togglefloating(const Arg *arg)
|
||||||
{
|
{
|
||||||
Client *sel = selclient();
|
Client *c = selclient();
|
||||||
if (!sel)
|
if (!c)
|
||||||
return;
|
return;
|
||||||
/* return if fullscreen */
|
/* return if fullscreen */
|
||||||
sel->isfloating = !sel->isfloating /* || sel->isfixed */;
|
setfloating(c, !c->isfloating /* || c->isfixed */);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue