*work in progress*
authorEleni Maria Stea <elene.mst@gmail.com>
Sun, 17 Feb 2013 22:24:18 +0000 (00:24 +0200)
committerEleni Maria Stea <elene.mst@gmail.com>
Sun, 17 Feb 2013 22:24:18 +0000 (00:24 +0200)
fixed the stupid error :p

src/mouse.cc
src/window.cc
src/window.h
src/wm.cc

index 80d52be..db87be7 100644 (file)
@@ -67,7 +67,7 @@ void process_mouse_event()
        }
 
        /* - process each event and update the pointer and button state
-        * - send each pointer move and button press/release to the tompost window
+        * - send each pointer move and button press/release to the topmost window
         *   with the pointer on it.
         */
 }
index f3937f1..84d1004 100644 (file)
@@ -22,7 +22,7 @@ const Rect &Window::get_rect() const
        return rect;
 }
 
-bool Window::contains_ptr(int ptr_x, int ptr_y)
+bool Window::contains_point(int ptr_x, int ptr_y)
 {
        if((rect.x <= ptr_x) && ((rect.x + rect.width) >= ptr_x)) {
                if((rect.y <= ptr_y) && (ptr_y <= (rect.y + rect.height))) {
index dae3a42..3a9cab0 100644 (file)
@@ -17,7 +17,7 @@ public:
        ~Window();
 
        const Rect &get_rect() const;
-       bool contains_ptr(int ptr_x, int ptr_y);
+       bool contains_point(int ptr_x, int ptr_y);
 
        void move(int x, int y);
        void resize(int x, int y);
index 7fe5986..f65c9c2 100644 (file)
--- a/src/wm.cc
+++ b/src/wm.cc
@@ -77,10 +77,10 @@ Window *WindowManager::get_focused_window()
 
 Window *WindowManager::get_window_at_pos(int pointer_x, int pointer_y)
 {
-       Window *win = new Window;
+       Window *win = 0;
        std::list<Window*>::reverse_iterator rit = windows.rbegin();
        while(rit != windows.rend()) {
-               if((*rit)->contains_ptr(pointer_x, pointer_y)) {
+               if((*rit)->contains_point(pointer_x, pointer_y)) {
                        win = *rit;
                        break;
                }