*in progress*
authorEleni Maria Stea <elene.mst@gmail.com>
Fri, 22 Feb 2013 18:14:28 +0000 (20:14 +0200)
committerEleni Maria Stea <elene.mst@gmail.com>
Fri, 22 Feb 2013 18:14:28 +0000 (20:14 +0200)
some minor fixes

src/geom.h
src/gfx.cc
src/wm.cc
src/wm.h

index 8b596ce..9c00b41 100644 (file)
@@ -2,7 +2,7 @@
 #define GEOM_H_
 
 struct Rect {
-       mutable int x, y;
+       int x, y;
        int width, height;
 };
 
index 45c918b..7d3595c 100644 (file)
@@ -92,17 +92,19 @@ void clear_screen(int r, int g, int b)
 
 void fill_rect(const Rect &rect, int r, int g, int b)
 {
-       if(rect.x < 0) {
-               rect.x = 0;
+       Rect drect = rect;
+
+       if(drect.x < 0) {
+               drect.x = 0;
        }
 
-       if(rect.y < 0) {
-               rect.y = 0;
+       if(drect.y < 0) {
+               drect.y = 0;
        }
 
-       unsigned char *fb = framebuffer + (rect.x + screen_rect.width * rect.y) * 4;
-       for(int i=0; i<rect.height; i++) {
-               for(int j=0; j<rect.width; j++) {
+       unsigned char *fb = framebuffer + (drect.x + screen_rect.width * drect.y) * 4;
+       for(int i=0; i<drect.height; i++) {
+               for(int j=0; j<drect.width; j++) {
                        fb[j * 4] = b;
                        fb[j * 4 + 1] = g;
                        fb[j * 4 + 2] = r;
index ec73a5b..6577a67 100644 (file)
--- a/src/wm.cc
+++ b/src/wm.cc
@@ -221,7 +221,6 @@ static int prev_x = -1, prev_y;
 
 static void mouse(Window *win, int bn, bool pressed)
 {
-       printf("mouse callback (%d, %s)\n", bn, pressed ? "pressed" : "released");
        if(bn == 0) {
                if(pressed) {
                        get_pointer_pos(&prev_x, &prev_y);
index 15c197b..162121b 100644 (file)
--- a/src/wm.h
+++ b/src/wm.h
@@ -11,7 +11,6 @@ class Window;
 class WindowManager {
 private:
        std::list<Window*> windows;
-       std::list<Window*> frames;
 
        std::list<Rect> dirty_rects;