Removed the problem with losing grip on the window while resizing

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2182 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
DarkWyrm 2002-12-08 15:16:25 +00:00
parent 09aa48996d
commit 8cca67e9c1

View File

@ -24,6 +24,10 @@
// Used for providing identifiers for views // Used for providing identifiers for views
int32 view_counter=0; int32 view_counter=0;
// defined in WindowBorder.cpp locking not necessary - the only
// thread which accesses them is the Poller thread
extern bool is_moving_window,is_resizing_window,is_sliding_tab;
// Used in window focus management // Used in window focus management
ServerWindow *active_serverwindow=NULL; ServerWindow *active_serverwindow=NULL;
@ -371,6 +375,9 @@ void ServerWindow::HandleMouseEvent(int32 code, int8 *buffer)
// Find the window which will receive our mouse event. // Find the window which will receive our mouse event.
Layer *root=GetRootLayer(); Layer *root=GetRootLayer();
WindowBorder *winborder; WindowBorder *winborder;
// activeborder is used to remember windows when resizing/moving windows
// or sliding a tab
ASSERT(root!=NULL); ASSERT(root!=NULL);
// Dispatch the mouse event to the proper window // Dispatch the mouse event to the proper window
@ -406,7 +413,6 @@ void ServerWindow::HandleMouseEvent(int32 code, int8 *buffer)
mousewin=winborder->Window(); mousewin=winborder->Window();
ASSERT(mousewin!=NULL); ASSERT(mousewin!=NULL);
winborder->MouseDown(pt,buttons,modifiers); winborder->MouseDown(pt,buttons,modifiers);
#ifdef DEBUG_SERVERWIN #ifdef DEBUG_SERVERWIN
printf("ServerWindow() %s: MouseDown(%.1f,%.1f)\n",mousewin->title->String(),x,y); printf("ServerWindow() %s: MouseDown(%.1f,%.1f)\n",mousewin->title->String(),x,y);
#endif #endif
@ -465,7 +471,14 @@ printf("ServerWindow() %s: MouseUp(%.1f,%.1f)\n",mousewin->title->String(),x,y);
uint32 buttons=*((uint32*)index); uint32 buttons=*((uint32*)index);
BPoint pt(x,y); BPoint pt(x,y);
if(!is_moving_window) if(is_moving_window || is_resizing_window || is_sliding_tab)
{
mousewin=active_serverwindow;
ASSERT(mousewin!=NULL);
mousewin->winborder->MouseMoved(pt,buttons,0);
}
else
{ {
winborder=(WindowBorder*)root->GetChildAt(pt); winborder=(WindowBorder*)root->GetChildAt(pt);
if(winborder) if(winborder)
@ -476,13 +489,6 @@ printf("ServerWindow() %s: MouseUp(%.1f,%.1f)\n",mousewin->title->String(),x,y);
winborder->MouseMoved(pt,buttons,0); winborder->MouseMoved(pt,buttons,0);
} }
} }
else
{
mousewin=active_serverwindow;
ASSERT(mousewin!=NULL);
mousewin->winborder->MouseMoved(pt,buttons,0);
}
break; break;
} }
default: default: