From 5deac1a20d178aa7d2e8bb5cbc79b6584c6287f5 Mon Sep 17 00:00:00 2001 From: Eleni Maria Stea Date: Mon, 18 Feb 2013 00:24:18 +0200 Subject: [PATCH] *work in progress* fixed the stupid error :p --- src/mouse.cc | 2 +- src/window.cc | 2 +- src/window.h | 2 +- src/wm.cc | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mouse.cc b/src/mouse.cc index 80d52be..db87be7 100644 --- a/src/mouse.cc +++ b/src/mouse.cc @@ -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. */ } diff --git a/src/window.cc b/src/window.cc index f3937f1..84d1004 100644 --- a/src/window.cc +++ b/src/window.cc @@ -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))) { diff --git a/src/window.h b/src/window.h index dae3a42..3a9cab0 100644 --- a/src/window.h +++ b/src/window.h @@ -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); diff --git a/src/wm.cc b/src/wm.cc index 7fe5986..f65c9c2 100644 --- 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::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; } -- 1.7.10.4