}
/* - 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.
*/
}
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))) {
~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);
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;
}