* added a fOriginalFlags that contains the unaltered flags as set by the client
* when changing feel, the original flags are now restored. * added B_SAME_POSITION_IN_ALL_WORKSPACES to valid flags, so that they can be set by the user. * fixed masking out invalid flags (actually all but the valid flags were kept...) * everytime B_SAME_POSITION_IN_ALL_WORKSPACES can be set (either in SetFlags() or in SetFeel() the position is propagated to all window lists. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15441 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -109,7 +109,6 @@ WindowLayer::WindowLayer(const BRect& frame, const char *name,
|
|||||||
|
|
||||||
fLook(look),
|
fLook(look),
|
||||||
fFeel(feel),
|
fFeel(feel),
|
||||||
fFlags(flags),
|
|
||||||
fWorkspaces(workspaces),
|
fWorkspaces(workspaces),
|
||||||
fCurrentWorkspace(-1),
|
fCurrentWorkspace(-1),
|
||||||
|
|
||||||
@@ -125,7 +124,8 @@ WindowLayer::WindowLayer(const BRect& frame, const char *name,
|
|||||||
fLook = B_TITLED_WINDOW_LOOK;
|
fLook = B_TITLED_WINDOW_LOOK;
|
||||||
if (!IsValidFeel(fFeel))
|
if (!IsValidFeel(fFeel))
|
||||||
fFeel = B_NORMAL_WINDOW_FEEL;
|
fFeel = B_NORMAL_WINDOW_FEEL;
|
||||||
fFlags &= ValidWindowFlags();
|
|
||||||
|
SetFlags(flags, NULL);
|
||||||
|
|
||||||
if (fLook != B_NO_BORDER_WINDOW_LOOK) {
|
if (fLook != B_NO_BORDER_WINDOW_LOOK) {
|
||||||
fDecorator = gDecorManager.AllocateDecorator(fDesktop, frame, name, fLook, fFlags);
|
fDecorator = gDecorManager.AllocateDecorator(fDesktop, frame, name, fLook, fFlags);
|
||||||
@@ -371,6 +371,18 @@ WindowLayer::VisibleContentRegion()
|
|||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
WindowLayer::_PropagatePosition()
|
||||||
|
{
|
||||||
|
if ((fFlags & B_SAME_POSITION_IN_ALL_WORKSPACES) == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (int32 i = 0; i < kListCount; i++) {
|
||||||
|
Anchor(i).position = fFrame.LeftTop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
WindowLayer::MoveBy(int32 x, int32 y)
|
WindowLayer::MoveBy(int32 x, int32 y)
|
||||||
{
|
{
|
||||||
@@ -382,13 +394,7 @@ WindowLayer::MoveBy(int32 x, int32 y)
|
|||||||
fWindow->HandleDirectConnection(B_DIRECT_STOP);
|
fWindow->HandleDirectConnection(B_DIRECT_STOP);
|
||||||
|
|
||||||
fFrame.OffsetBy(x, y);
|
fFrame.OffsetBy(x, y);
|
||||||
|
_PropagatePosition();
|
||||||
// propagate position if asked for
|
|
||||||
if (fFlags & B_SAME_POSITION_IN_ALL_WORKSPACES) {
|
|
||||||
for (int32 i = 0; i <= kWorkingList; i++) {
|
|
||||||
Anchor(i).position = fFrame.LeftTop();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fWindow->HandleDirectConnection(B_DIRECT_START | B_BUFFER_MOVED);
|
fWindow->HandleDirectConnection(B_DIRECT_START | B_BUFFER_MOVED);
|
||||||
|
|
||||||
@@ -1222,17 +1228,26 @@ WindowLayer::SetFeel(window_feel feel)
|
|||||||
|
|
||||||
// having modal windows with B_AVOID_FRONT or B_AVOID_FOCUS doesn't
|
// having modal windows with B_AVOID_FRONT or B_AVOID_FOCUS doesn't
|
||||||
// make that much sense, so we filter those flags out on demand
|
// make that much sense, so we filter those flags out on demand
|
||||||
fFlags &= ~ValidWindowFlags(fFeel);
|
fFlags = fOriginalFlags;
|
||||||
|
fFlags &= ValidWindowFlags(fFeel);
|
||||||
|
|
||||||
if (!IsNormal())
|
if (!IsNormal()) {
|
||||||
fFlags |= B_SAME_POSITION_IN_ALL_WORKSPACES;
|
fFlags |= B_SAME_POSITION_IN_ALL_WORKSPACES;
|
||||||
|
_PropagatePosition();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
WindowLayer::SetFlags(uint32 flags, BRegion* updateRegion)
|
WindowLayer::SetFlags(uint32 flags, BRegion* updateRegion)
|
||||||
{
|
{
|
||||||
fFlags = flags & ~ValidWindowFlags(fFeel);
|
fOriginalFlags = flags;
|
||||||
|
fFlags = flags & ValidWindowFlags(fFeel);
|
||||||
|
if (!IsNormal())
|
||||||
|
fFlags |= B_SAME_POSITION_IN_ALL_WORKSPACES;
|
||||||
|
|
||||||
|
if ((fFlags & B_SAME_POSITION_IN_ALL_WORKSPACES) != 0)
|
||||||
|
_PropagatePosition();
|
||||||
|
|
||||||
if (fDecorator == NULL)
|
if (fDecorator == NULL)
|
||||||
return;
|
return;
|
||||||
@@ -1540,6 +1555,7 @@ WindowLayer::ValidWindowFlags()
|
|||||||
| B_NOT_ANCHORED_ON_ACTIVATE
|
| B_NOT_ANCHORED_ON_ACTIVATE
|
||||||
| B_ASYNCHRONOUS_CONTROLS
|
| B_ASYNCHRONOUS_CONTROLS
|
||||||
| B_QUIT_ON_WINDOW_CLOSE
|
| B_QUIT_ON_WINDOW_CLOSE
|
||||||
|
| B_SAME_POSITION_IN_ALL_WORKSPACES
|
||||||
| kWorkspacesWindowFlag
|
| kWorkspacesWindowFlag
|
||||||
| kWindowScreenFlag;
|
| kWindowScreenFlag;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -205,13 +205,13 @@ class WindowLayer {
|
|||||||
click_type _ActionFor(const BMessage* msg) const;
|
click_type _ActionFor(const BMessage* msg) const;
|
||||||
|
|
||||||
void _ObeySizeLimits();
|
void _ObeySizeLimits();
|
||||||
|
void _PropagatePosition();
|
||||||
|
|
||||||
BString fTitle;
|
BString fTitle;
|
||||||
// TODO: no fp rects anywhere
|
// TODO: no fp rects anywhere
|
||||||
BRect fFrame;
|
BRect fFrame;
|
||||||
|
|
||||||
window_anchor fAnchor[kWorkingList + 1];
|
window_anchor fAnchor[kListCount];
|
||||||
// one for each desktop, and one working anchor
|
|
||||||
|
|
||||||
// the visible region is only recalculated from the
|
// the visible region is only recalculated from the
|
||||||
// Desktop thread, when using it, Desktop::ReadLockClipping()
|
// Desktop thread, when using it, Desktop::ReadLockClipping()
|
||||||
@@ -301,6 +301,7 @@ class WindowLayer {
|
|||||||
|
|
||||||
window_look fLook;
|
window_look fLook;
|
||||||
window_feel fFeel;
|
window_feel fFeel;
|
||||||
|
uint32 fOriginalFlags;
|
||||||
uint32 fFlags;
|
uint32 fFlags;
|
||||||
uint32 fWorkspaces;
|
uint32 fWorkspaces;
|
||||||
int32 fCurrentWorkspace;
|
int32 fCurrentWorkspace;
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ enum window_lists {
|
|||||||
kAllWindowList = 32,
|
kAllWindowList = 32,
|
||||||
kSubsetList,
|
kSubsetList,
|
||||||
kWorkingList,
|
kWorkingList,
|
||||||
|
|
||||||
|
kListCount
|
||||||
};
|
};
|
||||||
|
|
||||||
struct window_anchor {
|
struct window_anchor {
|
||||||
|
|||||||
Reference in New Issue
Block a user