From 8cca67e9c190ac9d05ef5b6a869ac48a0f0eee52 Mon Sep 17 00:00:00 2001 From: DarkWyrm Date: Sun, 8 Dec 2002 15:16:25 +0000 Subject: [PATCH] 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 --- src/servers/app/proto7/ServerWindow.cpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/servers/app/proto7/ServerWindow.cpp b/src/servers/app/proto7/ServerWindow.cpp index d47ede4a71..991adf9cd5 100644 --- a/src/servers/app/proto7/ServerWindow.cpp +++ b/src/servers/app/proto7/ServerWindow.cpp @@ -24,6 +24,10 @@ // Used for providing identifiers for views 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 ServerWindow *active_serverwindow=NULL; @@ -371,6 +375,9 @@ void ServerWindow::HandleMouseEvent(int32 code, int8 *buffer) // Find the window which will receive our mouse event. Layer *root=GetRootLayer(); WindowBorder *winborder; + + // activeborder is used to remember windows when resizing/moving windows + // or sliding a tab ASSERT(root!=NULL); // Dispatch the mouse event to the proper window @@ -406,7 +413,6 @@ void ServerWindow::HandleMouseEvent(int32 code, int8 *buffer) mousewin=winborder->Window(); ASSERT(mousewin!=NULL); winborder->MouseDown(pt,buttons,modifiers); - #ifdef DEBUG_SERVERWIN printf("ServerWindow() %s: MouseDown(%.1f,%.1f)\n",mousewin->title->String(),x,y); #endif @@ -465,7 +471,14 @@ printf("ServerWindow() %s: MouseUp(%.1f,%.1f)\n",mousewin->title->String(),x,y); uint32 buttons=*((uint32*)index); 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); if(winborder) @@ -476,13 +489,6 @@ printf("ServerWindow() %s: MouseUp(%.1f,%.1f)\n",mousewin->title->String(),x,y); winborder->MouseMoved(pt,buttons,0); } } - else - { - mousewin=active_serverwindow; - ASSERT(mousewin!=NULL); - - mousewin->winborder->MouseMoved(pt,buttons,0); - } break; } default: