fixed the wrong dragging
authorEleni Maria Stea <elene.mst@gmail.com>
Fri, 22 Feb 2013 23:32:41 +0000 (01:32 +0200)
committerEleni Maria Stea <elene.mst@gmail.com>
Fri, 22 Feb 2013 23:32:41 +0000 (01:32 +0200)
src/main.cc
src/wm.cc

index 8b36449..6697506 100644 (file)
@@ -30,11 +30,9 @@ static void display(Window *win)
 {
        if(wm->get_focused_window() != win) {
                fill_rect(win->get_rect(), 106, 106, 250);
-               printf("drawing unfocused\n");
        }
        else {
                fill_rect(win->get_rect(), 0, 0, 255);
-               printf("drawing FOCUSED\n");
        }
 }
 
index 89b709f..7aa112b 100644 (file)
--- a/src/wm.cc
+++ b/src/wm.cc
@@ -247,8 +247,8 @@ static void motion(Window *win, int x, int y)
        if(left_bn && prev_x != -1) {
                int dx = x - prev_x;
                int dy = y - prev_y;
-               prev_x = x;
-               prev_y = y;
+               prev_x = x - dx;
+               prev_y = y - dy;
 
                Rect rect = win->get_rect();
                win->move(rect.x + dx, rect.y + dy);