From 19ec74b048ca66719dd35b23f2edd39981398b56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Mon, 17 May 2010 12:13:36 +0000 Subject: [PATCH] Patch by Wim van der Meer: Use the new get_mouse() function instead of the previous hack. Thanks a bunch! Closes #6019. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36841 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/tracker/mark_as/MarkAs.cpp | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/src/add-ons/tracker/mark_as/MarkAs.cpp b/src/add-ons/tracker/mark_as/MarkAs.cpp index 54819f74cd..a81c7af3ba 100644 --- a/src/add-ons/tracker/mark_as/MarkAs.cpp +++ b/src/add-ons/tracker/mark_as/MarkAs.cpp @@ -9,39 +9,21 @@ #include #include #include +#include #include #include #include #include #include #include -#include -#include -/*! Returns the current mouse position in screen coordinates. - Since there is no method to retrieve this in the Be API without a view, - this looks a bit more complicated. -*/ static BPoint mouse_position() { - BWindow* window = new BWindow(BRect(-1000, -1000, -900, -900), "mouse", - B_NO_BORDER_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, - B_AVOID_FRONT | B_AVOID_FOCUS); - BView* view = new BView(window->Bounds(), "mouse", B_FOLLOW_ALL, 0); - window->AddChild(view); - window->Run(); - - window->Lock(); - + // Returns the mouse position in screen coordinates BPoint position; - uint32 buttons; - view->GetMouse(&position, &buttons); - view->ConvertToScreen(&position); - - window->Quit(); - + get_mouse(&position, NULL); return position; }