grabbed_client was too long a name

This commit is contained in:
Devin J. Pohly 2020-04-22 22:37:11 -05:00
parent 488929fef6
commit f88a98327e
1 changed files with 7 additions and 8 deletions

15
dwl.c
View File

@ -173,7 +173,7 @@ static struct wl_listener new_input;
static struct wl_listener request_cursor; static struct wl_listener request_cursor;
static struct wl_list keyboards; static struct wl_list keyboards;
static unsigned int cursor_mode; static unsigned int cursor_mode;
static Client *grabbed_client; static Client *grabc;
static double grabsx, grabsy; static double grabsx, grabsy;
static struct wlr_output_layout *output_layout; static struct wlr_output_layout *output_layout;
@ -555,8 +555,8 @@ motionnotify(uint32_t time)
/* If we are currently grabbing the mouse, handle and return */ /* If we are currently grabbing the mouse, handle and return */
if (cursor_mode == CurMove) { if (cursor_mode == CurMove) {
/* Move the grabbed client to the new position. */ /* Move the grabbed client to the new position. */
grabbed_client->x = cursor->x - grabsx; grabc->x = cursor->x - grabsx;
grabbed_client->y = cursor->y - grabsy; grabc->y = cursor->y - grabsy;
return; return;
} else if (cursor_mode == CurResize) { } else if (cursor_mode == CurResize) {
/* /*
@ -564,9 +564,8 @@ motionnotify(uint32_t time)
* compositor, you'd wait for the client to prepare a buffer at * compositor, you'd wait for the client to prepare a buffer at
* the new size, then commit any movement that was prepared. * the new size, then commit any movement that was prepared.
*/ */
wlr_xdg_toplevel_set_size(grabbed_client->xdg_surface, wlr_xdg_toplevel_set_size(grabc->xdg_surface,
cursor->x - grabbed_client->x, cursor->x - grabc->x, cursor->y - grabc->y);
cursor->y - grabbed_client->y);
return; return;
} }
@ -633,7 +632,7 @@ movemouse(const Arg *arg)
} }
/* Prepare for moving client in motionnotify */ /* Prepare for moving client in motionnotify */
grabbed_client = c; grabc = c;
cursor_mode = CurMove; cursor_mode = CurMove;
grabsx = cursor->x - c->x; grabsx = cursor->x - c->x;
grabsy = cursor->y - c->y; grabsy = cursor->y - c->y;
@ -790,7 +789,7 @@ resizemouse(const Arg *arg)
c->y + sbox.y + sbox.height); c->y + sbox.y + sbox.height);
/* Prepare for resizing client in motionnotify */ /* Prepare for resizing client in motionnotify */
grabbed_client = c; grabc = c;
cursor_mode = CurResize; cursor_mode = CurResize;
} }