RootLayer.h: introduced a method for highlighting window tab when focus
changes. RootLayer.cpp: window tab was properly lit only when changing focus with the mouse. Now the same happens when showing or hidding windows. Desktop.cpp: normal windows created after floating windows did not had B_FLOATING_APP_WINDOW_FEEL windows in their internal list, thus when such a window was selected to become the front most it did not show floating app windows in front of it. Fixed that now. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11710 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -257,19 +257,24 @@ void Desktop::AddWinBorder(WinBorder *winBorder)
|
|||||||
// add FLOATING_APP windows to the local list of all normal windows.
|
// add FLOATING_APP windows to the local list of all normal windows.
|
||||||
// This is to keep the order all floating windows (app or subset) when we go from
|
// This is to keep the order all floating windows (app or subset) when we go from
|
||||||
// one normal window to another.
|
// one normal window to another.
|
||||||
if (feel == B_FLOATING_APP_WINDOW_FEEL)
|
if (feel == B_FLOATING_APP_WINDOW_FEEL || feel == B_NORMAL_WINDOW_FEEL)
|
||||||
{
|
{
|
||||||
WinBorder *wb = NULL;
|
WinBorder *wb = NULL;
|
||||||
int32 count = fWinBorderList.CountItems();
|
int32 count = fWinBorderList.CountItems();
|
||||||
|
int32 feelToLookFor = (feel == B_NORMAL_WINDOW_FEEL ?
|
||||||
|
B_FLOATING_APP_WINDOW_FEEL :
|
||||||
|
B_NORMAL_WINDOW_FEEL);
|
||||||
|
|
||||||
for(int32 i = 0; i < count; i++)
|
for(int32 i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
wb = (WinBorder*)fWinBorderList.ItemAt(i);
|
wb = (WinBorder*)fWinBorderList.ItemAt(i);
|
||||||
if (wb->App()->ClientTeamID() == winBorder->App()->ClientTeamID()
|
if (wb->App()->ClientTeamID() == winBorder->App()->ClientTeamID()
|
||||||
&& wb->Window()->Feel() == B_NORMAL_WINDOW_FEEL)
|
&& wb->Window()->Feel() == feelToLookFor)
|
||||||
// R2: RootLayer comparison is needed.
|
// R2: RootLayer comparison is needed.
|
||||||
{
|
{
|
||||||
wb->fFMWList.AddWinBorder(winBorder);
|
feel == B_NORMAL_WINDOW_FEEL ?
|
||||||
|
winBorder->fFMWList.AddWinBorder(wb) :
|
||||||
|
wb->fFMWList.AddWinBorder(winBorder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -916,24 +916,7 @@ void RootLayer::MouseEventHandler(int32 code, BPortLink& msg)
|
|||||||
invalidate_layer(this, fFull);
|
invalidate_layer(this, fFull);
|
||||||
}
|
}
|
||||||
|
|
||||||
WinBorder *focus = FocusWinBorder();
|
draw_window_tab(exFocus, FocusWinBorder());
|
||||||
if (exFocus || focus)
|
|
||||||
{
|
|
||||||
if (exFocus && exFocus != focus && exFocus->fDecorator)
|
|
||||||
exFocus->fDecorator->SetFocus(false);
|
|
||||||
if (focus && exFocus != focus && focus->fDecorator)
|
|
||||||
focus->fDecorator->SetFocus(true);
|
|
||||||
|
|
||||||
if (exFocus && focus != exFocus)
|
|
||||||
{
|
|
||||||
// TODO: this line is a hack, decorator is drawn twice.
|
|
||||||
BRegion reg(exFocus->fVisible);
|
|
||||||
if (focus)
|
|
||||||
reg.Include(&focus->fVisible);
|
|
||||||
|
|
||||||
redraw_layer(this, reg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (action == DEC_DRAG)
|
if (action == DEC_DRAG)
|
||||||
{
|
{
|
||||||
@@ -1555,6 +1538,7 @@ void RootLayer::show_winBorder(WinBorder *winBorder)
|
|||||||
{
|
{
|
||||||
bool invalidate = false;
|
bool invalidate = false;
|
||||||
bool invalid;
|
bool invalid;
|
||||||
|
WinBorder *exFocus = FocusWinBorder();
|
||||||
|
|
||||||
winBorder->Show(false);
|
winBorder->Show(false);
|
||||||
|
|
||||||
@@ -1576,18 +1560,22 @@ void RootLayer::show_winBorder(WinBorder *winBorder)
|
|||||||
}
|
}
|
||||||
|
|
||||||
get_workspace_windows();
|
get_workspace_windows();
|
||||||
|
|
||||||
if (invalidate)
|
if (invalidate)
|
||||||
{
|
{
|
||||||
// TODO: should it be improved by calling with region of hidden windows
|
// TODO: should it be improved by calling with region of hidden windows
|
||||||
// plus the full regions of new windows???
|
// plus the full regions of new windows???
|
||||||
invalidate_layer(this, fFull);
|
invalidate_layer(this, fFull);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
draw_window_tab(exFocus, FocusWinBorder());
|
||||||
}
|
}
|
||||||
|
|
||||||
void RootLayer::hide_winBorder(WinBorder *winBorder)
|
void RootLayer::hide_winBorder(WinBorder *winBorder)
|
||||||
{
|
{
|
||||||
bool invalidate = false;
|
bool invalidate = false;
|
||||||
bool invalid;
|
bool invalid;
|
||||||
|
WinBorder *exFocus = FocusWinBorder();
|
||||||
|
|
||||||
winBorder->Hide(false);
|
winBorder->Hide(false);
|
||||||
|
|
||||||
@@ -1610,6 +1598,8 @@ void RootLayer::hide_winBorder(WinBorder *winBorder)
|
|||||||
// plus the full regions of new windows???
|
// plus the full regions of new windows???
|
||||||
invalidate_layer(this, fFull);
|
invalidate_layer(this, fFull);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
draw_window_tab(exFocus, FocusWinBorder());
|
||||||
}
|
}
|
||||||
|
|
||||||
void RootLayer::get_workspace_windows()
|
void RootLayer::get_workspace_windows()
|
||||||
@@ -1636,3 +1626,22 @@ void RootLayer::get_workspace_windows()
|
|||||||
//printf("Adi: get_workspace_windows DONE\n");
|
//printf("Adi: get_workspace_windows DONE\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RootLayer::draw_window_tab(WinBorder *exFocus, WinBorder *focus)
|
||||||
|
{
|
||||||
|
if (exFocus || focus)
|
||||||
|
{
|
||||||
|
if (exFocus && exFocus != focus && exFocus->fDecorator)
|
||||||
|
exFocus->fDecorator->SetFocus(false);
|
||||||
|
if (focus && exFocus != focus && focus->fDecorator)
|
||||||
|
focus->fDecorator->SetFocus(true);
|
||||||
|
|
||||||
|
if (exFocus && focus != exFocus)
|
||||||
|
{
|
||||||
|
// TODO: this line is a hack, decorator is drawn twice.
|
||||||
|
BRegion reg(exFocus->fVisible);
|
||||||
|
if (focus)
|
||||||
|
reg.Include(&focus->fVisible);
|
||||||
|
redraw_layer(this, reg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -137,6 +137,7 @@ friend class Desktop;
|
|||||||
void hide_winBorder(WinBorder* winBorder);
|
void hide_winBorder(WinBorder* winBorder);
|
||||||
|
|
||||||
void get_workspace_windows();
|
void get_workspace_windows();
|
||||||
|
void draw_window_tab(WinBorder *exFocus, WinBorder *focus);
|
||||||
|
|
||||||
void invalidate_layer(Layer *layer, const BRegion ®ion);
|
void invalidate_layer(Layer *layer, const BRegion ®ion);
|
||||||
void redraw_layer(Layer *layer, const BRegion ®ion);
|
void redraw_layer(Layer *layer, const BRegion ®ion);
|
||||||
|
|||||||
Reference in New Issue
Block a user