diff options
| author | Devin J. Pohly <djpohly@gmail.com> | 2020-04-22 22:32:53 -0500 | 
|---|---|---|
| committer | Devin J. Pohly <djpohly@gmail.com> | 2020-04-22 22:34:11 -0500 | 
| commit | 15952563412b4c1da2f47e6b810296a9c86914aa (patch) | |
| tree | 9c3e62715b5df041dbfc5c88e4b52b4271c583f7 | |
| parent | 0a4319720380356f7fdd0c824d53cb9754f219e2 (diff) | |
inline moveresize
There were only two lines left in common
| -rw-r--r-- | dwl.c | 23 | 
1 files changed, 8 insertions, 15 deletions
| @@ -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,21 +631,12 @@ 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) { -		grabsx = cursor->x - c->x; -		grabsy = cursor->y - c->y; -	} +	cursor_mode = CurMove; +	grabsx = cursor->x - c->x; +	grabsy = cursor->y - c->y;  }  void @@ -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 | 
