* Deskbar's Switcher had an explanation what the window_info::layer field is
about. ServerWindow::GetInfo() now fills in that value following this logic as well as further testing. * Whitespace cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26942 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2005, Haiku.
|
||||
* Copyright 2005-2008, Haiku.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
@@ -21,7 +21,7 @@ struct window_info {
|
||||
int32 client_port;
|
||||
uint32 workspaces;
|
||||
|
||||
int32 layer; // whatever this is...
|
||||
int32 layer; // see ServerWindow::GetInfo()
|
||||
uint32 feel;
|
||||
uint32 flags;
|
||||
int32 window_left;
|
||||
|
||||
@@ -467,7 +467,19 @@ ServerWindow::GetInfo(window_info& info)
|
||||
info.client_port = fClientLooperPort;
|
||||
info.workspaces = fWindow->Workspaces();
|
||||
|
||||
info.layer = 0; // ToDo: what is this???
|
||||
// logic taken from Switcher comments and experiments
|
||||
if (fWindow->IsHidden())
|
||||
info.layer = 0;
|
||||
else if (fWindow->IsVisible()) {
|
||||
if (fWindow->Feel() == kDesktopWindowFeel)
|
||||
info.layer = 2;
|
||||
else if (fWindow->IsFloating() || fWindow->IsModal())
|
||||
info.layer = 4;
|
||||
else
|
||||
info.layer = 3;
|
||||
} else
|
||||
info.layer = 1;
|
||||
|
||||
info.feel = fWindow->Feel();
|
||||
info.flags = fWindow->Flags();
|
||||
info.window_left = (int)floor(fWindow->Frame().left);
|
||||
|
||||
Reference in New Issue
Block a user