From a6fa47098910b1d6e8b04c22783eae3b2134e9c4 Mon Sep 17 00:00:00 2001 From: Adi Oanca Date: Thu, 10 Mar 2005 22:07:44 +0000 Subject: [PATCH] Window tab is highlighted/grayed when changing between windows git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11665 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/app/server/RootLayer.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/servers/app/server/RootLayer.cpp b/src/servers/app/server/RootLayer.cpp index f6e442803d..47525a98e6 100644 --- a/src/servers/app/server/RootLayer.cpp +++ b/src/servers/app/server/RootLayer.cpp @@ -890,6 +890,7 @@ void RootLayer::MouseEventHandler(int32 code, BPortLink& msg) click_type action; bool invalidate; bool sendMessage = true; + WinBorder *exFocus = FocusWinBorder(); action = target->TellWhat(evt); @@ -900,9 +901,23 @@ void RootLayer::MouseEventHandler(int32 code, BPortLink& msg) if (invalidate) { + WinBorder *focus = FocusWinBorder(); + if (exFocus && exFocus != focus && exFocus->fDecorator) + exFocus->fDecorator->SetFocus(false); + if (focus && exFocus != focus && focus->fDecorator) + focus->fDecorator->SetFocus(true); + BRegion reg(target->fFull); reg.Include(&target->fTopLayer->fFull); invalidate_layer(this, reg); + if (exFocus && FocusWinBorder() != exFocus) + { + reg.MakeEmpty(); + reg.Include(&exFocus->fVisible); + // TODO: this line is a hack, decorator is drawn twice. + reg.Include(&focus->fVisible); + redraw_layer(this, reg); + } if (!(target->Window()->Flags() & B_WILL_ACCEPT_FIRST_CLICK)) sendMessage = false;