forked from mirror/dwl
inline moveresize
There were only two lines left in common
This commit is contained in:
parent
0a43197203
commit
1595256341
1 changed files with 8 additions and 15 deletions
19
dwl.c
19
dwl.c
|
@ -135,7 +135,6 @@ static void motionabsolute(struct wl_listener *listener, void *data);
|
|||
static void motionnotify(uint32_t time);
|
||||
static void motionrelative(struct wl_listener *listener, void *data);
|
||||
static void movemouse(const Arg *arg);
|
||||
static void moveresize(Client *c, unsigned int mode);
|
||||
static void quit(const Arg *arg);
|
||||
static void render(struct wlr_surface *surface, int sx, int sy, void *data);
|
||||
static void rendermon(struct wl_listener *listener, void *data);
|
||||
|
@ -632,22 +631,13 @@ movemouse(const Arg *arg)
|
|||
if (!c) {
|
||||
return;
|
||||
}
|
||||
moveresize(c, CurMove);
|
||||
}
|
||||
|
||||
void
|
||||
moveresize(Client *c, unsigned int mode)
|
||||
{
|
||||
/* This function sets up an interactive move or resize operation, where the
|
||||
* compositor stops propagating pointer events to clients and instead
|
||||
* consumes them itself, to move or resize windows. */
|
||||
/* Prepare for moving client in motionnotify */
|
||||
grabbed_client = c;
|
||||
cursor_mode = mode;
|
||||
if (mode == CurMove) {
|
||||
cursor_mode = CurMove;
|
||||
grabsx = cursor->x - c->x;
|
||||
grabsy = cursor->y - c->y;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
quit(const Arg *arg)
|
||||
|
@ -798,7 +788,10 @@ resizemouse(const Arg *arg)
|
|||
wlr_cursor_warp_closest(cursor, NULL,
|
||||
c->x + sbox.x + sbox.width,
|
||||
c->y + sbox.y + sbox.height);
|
||||
moveresize(c, CurResize);
|
||||
|
||||
/* Prepare for resizing client in motionnotify */
|
||||
grabbed_client = c;
|
||||
cursor_mode = CurResize;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue