- fixed build for NEW_CLIPPING define
- implemented RootLayer::SetActive(WinBorder*). - added support for BWindow::Activate(). I realize now that I only added support for Activate(true). :-D In the next days I will add support for Activate(false). - removed a few cases from ServerWindow as they are not needed. - addapted WinBorder::MouseDown() to work with the new RootLayer::SetActive() implementation. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14318 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -253,11 +253,11 @@ class Layer {
|
||||
|
||||
void CopyBits(BRect& src, BRect& dst,
|
||||
int32 xOffset, int32 yOffset);
|
||||
|
||||
#ifndef NEW_CLIPPING
|
||||
inline const BRegion& VisibleRegion() const { return fVisible; }
|
||||
inline const BRegion& FullVisible() const { return fFullVisible; }
|
||||
|
||||
#ifdef NEW_CLIPPING
|
||||
#else
|
||||
inline const BRegion& VisibleRegion() const { return fVisible2; }
|
||||
inline const BRegion& FullVisible() const { return fFullVisible2; }
|
||||
|
||||
|
||||
@@ -1222,8 +1222,43 @@ RootLayer::RevealNewWMState(Workspace::State &oldWMState)
|
||||
bool
|
||||
RootLayer::SetActive(WinBorder* newActive)
|
||||
{
|
||||
// TODO: properly implement
|
||||
return ActiveWorkspace()->AttemptToActivate(newActive);
|
||||
bool returnValue = false;
|
||||
uint32 workspaceIndex = newActive->Workspaces();
|
||||
if (workspaceIndex == 0)
|
||||
workspaceIndex = 0x00000001UL << fActiveWksIndex;
|
||||
|
||||
for (int32 i = 0; i < kMaxWorkspaceCount; i++) {
|
||||
if (fWorkspace[i] && (workspaceIndex & (0x00000001UL << i))) {
|
||||
if (i == fActiveWksIndex) {
|
||||
Workspace::State oldWMState;
|
||||
ActiveWorkspace()->GetState(&oldWMState);
|
||||
|
||||
returnValue = ActiveWorkspace()->AttemptToActivate(newActive);
|
||||
|
||||
RevealNewWMState(oldWMState);
|
||||
}
|
||||
else {
|
||||
fWorkspace[i]->AttemptToActivate(newActive);
|
||||
// NOTE: for multiple monitor support, if a workspaces is mapped to
|
||||
// a Screen, we must invalidate/redraw to see the change.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If this WinBorder does not appear in current workspace,
|
||||
// change to the first one who does.
|
||||
if (!(workspaceIndex & (0x00000001UL << fActiveWksIndex))) {
|
||||
// find an workspace index in which this Layer appears
|
||||
for (int32 i = 0; i < kMaxWorkspaceCount; i++) {
|
||||
if (workspaceIndex & (0x00000001UL << i)) {
|
||||
SetActiveWorkspace(i);
|
||||
returnValue = Active() == newActive;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
#endif
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
@@ -1415,22 +1415,13 @@ myRootLayer->Unlock();
|
||||
fLink.Flush();
|
||||
break;
|
||||
}
|
||||
case B_MINIMIZE:
|
||||
case AS_ACTIVATE_WINDOW:
|
||||
{
|
||||
// TODO: Implement B_MINIMIZE
|
||||
STRACE(("ServerWindow %s: Message Minimize unimplemented\n", Title()));
|
||||
break;
|
||||
}
|
||||
case B_WINDOW_ACTIVATED:
|
||||
{
|
||||
// TODO: Implement B_WINDOW_ACTIVATED
|
||||
STRACE(("ServerWindow %s: Message Window_Activated unimplemented\n", Title()));
|
||||
break;
|
||||
}
|
||||
case B_ZOOM:
|
||||
{
|
||||
// TODO: Implement B_ZOOM
|
||||
STRACE(("ServerWindow %s: Message Zoom unimplemented\n", Title()));
|
||||
DTRACE(("ServerWindow %s: Message AS_ACTIVATE_WINDOW: Layer: %s\n", Title(), fCurrentLayer->Name()));
|
||||
if (myRootLayer && myRootLayer->Lock()) {
|
||||
myRootLayer->SetActive(fWinBorder);
|
||||
myRootLayer->Unlock();
|
||||
}
|
||||
break;
|
||||
}
|
||||
// Some BView drawing messages, but which don't need clipping
|
||||
|
||||
@@ -450,9 +450,6 @@ void
|
||||
WinBorder::MouseDown(const PointerEvent& evt)
|
||||
{
|
||||
DesktopSettings desktopSettings(gDesktop);
|
||||
Workspace::State oldWMState;
|
||||
|
||||
GetRootLayer()->ActiveWorkspace()->GetState(&oldWMState);
|
||||
|
||||
// not in FFM mode?
|
||||
if (desktopSettings.MouseMode() == B_NORMAL_MOUSE) {
|
||||
@@ -527,7 +524,12 @@ WinBorder::MouseDown(const PointerEvent& evt)
|
||||
|
||||
// based on what the Decorator returned, properly place this window.
|
||||
if (action == DEC_MOVETOBACK) {
|
||||
Workspace::State oldWMState;
|
||||
GetRootLayer()->ActiveWorkspace()->GetState(&oldWMState);
|
||||
|
||||
GetRootLayer()->ActiveWorkspace()->MoveToBack(this);
|
||||
|
||||
GetRootLayer()->RevealNewWMState(oldWMState);
|
||||
}
|
||||
else {
|
||||
GetRootLayer()->SetNotifyLayer(this, B_POINTER_EVENTS, 0UL);
|
||||
@@ -535,8 +537,6 @@ WinBorder::MouseDown(const PointerEvent& evt)
|
||||
activateWindow:
|
||||
GetRootLayer()->SetActive(this);
|
||||
}
|
||||
|
||||
GetRootLayer()->RevealNewWMState(oldWMState);
|
||||
}
|
||||
}
|
||||
// in FFM mode
|
||||
|
||||
Reference in New Issue
Block a user