aboutsummaryrefslogtreecommitdiff
path: root/rootston/desktop.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-11-21 11:13:18 -0500
committerGitHub <noreply@github.com>2017-11-21 11:13:18 -0500
commit1228d0da19edbfc1730b6918760aef444fac8887 (patch)
tree16643d4bf7029657eaf86656bd98c77b98961a0c /rootston/desktop.c
parent6bde8dd56beebc429445196d7d4a120677289317 (diff)
parent1d08d317096a80f96d03cd67303381bdedaaac2a (diff)
Merge pull request #387 from emersion/laggy-move-resize
Fix laggy move-resize
Diffstat (limited to 'rootston/desktop.c')
-rw-r--r--rootston/desktop.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/rootston/desktop.c b/rootston/desktop.c
index 65730807..608bd37d 100644
--- a/rootston/desktop.c
+++ b/rootston/desktop.c
@@ -80,12 +80,25 @@ void view_resize(struct roots_view *view, uint32_t width, uint32_t height) {
void view_move_resize(struct roots_view *view, double x, double y,
uint32_t width, uint32_t height) {
+ bool update_x = x != view->x;
+ bool update_y = y != view->y;
+ if (!update_x && !update_y) {
+ view_resize(view, width, height);
+ return;
+ }
+
if (view->move_resize) {
view->move_resize(view, x, y, width, height);
return;
}
- view_move(view, x, y);
+ view->pending_move_resize.update_x = update_x;
+ view->pending_move_resize.update_y = update_y;
+ view->pending_move_resize.x = x;
+ view->pending_move_resize.y = y;
+ view->pending_move_resize.width = width;
+ view->pending_move_resize.height = height;
+
view_resize(view, width, height);
}