* Fixed millions of coding style violations introduced by the stack & tile

patch. Grmbl.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33824 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2009-10-29 10:11:24 +00:00
parent 8cd9a52477
commit 23e00a25e2
9 changed files with 338 additions and 361 deletions
-1
View File
@@ -45,7 +45,6 @@ enum click_type {
CLICK_RESIZE_RB CLICK_RESIZE_RB
}; };
#include "Window.h"
class Decorator { class Decorator {
public: public:
+54 -75
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2001-2008, Haiku. * Copyright 2001-2009, Haiku.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
@@ -8,6 +8,7 @@
* Philippe Saint-Pierre, [email protected] * Philippe Saint-Pierre, [email protected]
*/ */
/*! Default and fallback decorator for the app_server - the yellow tabs */ /*! Default and fallback decorator for the app_server - the yellow tabs */
@@ -475,22 +476,21 @@ DefaultDecorator::SetSettings(const BMessage& settings, BRegion* updateRegion)
Window* window = fWindow->Desktop()->FindWindow(id); Window* window = fWindow->Desktop()->FindWindow(id);
if (window && window != fWindow && window->StackedWindowIds()) { if (window && window != fWindow && window->StackedWindowIds()) {
bool idExists = false; bool idExists = false;
for (int j = 0; !idExists && for (int j = 0; !idExists
j < window->StackedWindowIds()->CountItems(); j++) { && j < window->StackedWindowIds()->CountItems(); j++) {
int32* stackedId = int32* stackedId = static_cast<int32*>(
static_cast<int32*>(window->StackedWindowIds()->ItemAt(j)); window->StackedWindowIds()->ItemAt(j));
idExists = windowId == *stackedId; idExists = windowId == *stackedId;
} }
if (idExists) { if (idExists) {
if (!windowToStackUnder) { if (!windowToStackUnder) {
//note this will execute only once during loop //note this will execute only once during loop
windowToStackUnder = window; windowToStackUnder = window;
} }
} } else
else {
persist = false; persist = false;
} }
}
if (persist) { if (persist) {
int32* idRef = static_cast<int32*>(malloc(sizeof(int32))); int32* idRef = static_cast<int32*>(malloc(sizeof(int32)));
@@ -502,27 +502,26 @@ DefaultDecorator::SetSettings(const BMessage& settings, BRegion* updateRegion)
if (windowToStackUnder) { if (windowToStackUnder) {
fWindow->StackWindowBefore(windowToStackUnder); fWindow->StackWindowBefore(windowToStackUnder);
windowToStackUnder->StackAndTile(); windowToStackUnder->StackAndTile();
} } else
else {
fWindow->InitStackedWindowIds(); fWindow->InitStackedWindowIds();
}
#ifdef DEBUG_STACK_AND_TILE
for (int i = 0; i < fWindow->StackedWindowIds()->CountItems(); i++) { for (int i = 0; i < fWindow->StackedWindowIds()->CountItems(); i++) {
int32* stackedId = int32* stackedId
static_cast<int32*>(fWindow->StackedWindowIds()->ItemAt(i)); = static_cast<int32*>(fWindow->StackedWindowIds()->ItemAt(i));
STRACE_SAT(("\tstackedWindowIds[%d]=%x\n", i, *stackedId)); STRACE_SAT(("\tstackedWindowIds[%d]=%x\n", i, *stackedId));
} }
#endif
// Add the remaining window id's to the persistent stacking list // Add the remaining window id's to the persistent stacking list
// These are the ones that belong to currently unopened windows // These are the ones that belong to currently unopened windows
for (int i = 0; i < persistentIdsToAdd->CountItems(); i++) { for (int i = 0; i < persistentIdsToAdd->CountItems(); i++) {
int32* idRef = int32* idRef = static_cast<int32*>(persistentIdsToAdd->ItemAt(i));
static_cast<int32*>(persistentIdsToAdd->ItemAt(i));
bool idExists = false; bool idExists = false;
for (int j = 0; !idExists && for (int j = 0; !idExists
j < fWindow->StackedWindowIds()->CountItems(); j++) { && j < fWindow->StackedWindowIds()->CountItems(); j++) {
int32* stackedId = int32* stackedId = static_cast<int32*>(
static_cast<int32*>(fWindow->StackedWindowIds()->ItemAt(j)); fWindow->StackedWindowIds()->ItemAt(j));
idExists = *idRef == *stackedId; idExists = *idRef == *stackedId;
} }
if (!idExists) { if (!idExists) {
@@ -533,8 +532,7 @@ DefaultDecorator::SetSettings(const BMessage& settings, BRegion* updateRegion)
} }
} }
_SnapWindowFromSettings("snap left2left", SNAP_LEFT, SNAP_LEFT, _SnapWindowFromSettings("snap left2left", SNAP_LEFT, SNAP_LEFT, &settings);
&settings);
_SnapWindowFromSettings("snap left2right", SNAP_LEFT, SNAP_RIGHT, _SnapWindowFromSettings("snap left2right", SNAP_LEFT, SNAP_RIGHT,
&settings); &settings);
_SnapWindowFromSettings("snap right2left", SNAP_RIGHT, SNAP_LEFT, _SnapWindowFromSettings("snap right2left", SNAP_RIGHT, SNAP_LEFT,
@@ -559,8 +557,7 @@ DefaultDecorator::SetSettings(const BMessage& settings, BRegion* updateRegion)
void void
DefaultDecorator::_SnapWindowFromSettings(const char* label, DefaultDecorator::_SnapWindowFromSettings(const char* label,
SnapOrientation thisSnapOrientation, SnapOrientation thisSnapOrientation, SnapOrientation otherSnapOrientation,
SnapOrientation otherSnapOrientation,
const BMessage* settings) const BMessage* settings)
{ {
type_code typeFound; type_code typeFound;
@@ -572,13 +569,12 @@ DefaultDecorator::_SnapWindowFromSettings(const char* label,
settings->FindInt32(label, i, &id); settings->FindInt32(label, i, &id);
Window* window = fWindow->Desktop()->FindWindow(id); Window* window = fWindow->Desktop()->FindWindow(id);
if (window == fWindow) { if (window == fWindow)
continue; continue;
}
char* debug_suffix = "... NOT!"; char* debugSuffix = "... NOT!";
if (window) { if (window != NULL) {
// There can be cases where the other window to which this // There can be cases where the other window to which this
// window's snapped doesn't contain a reference to this window // window's snapped doesn't contain a reference to this window
// in its snapping list. This would happen when the other window // in its snapping list. This would happen when the other window
@@ -588,27 +584,28 @@ DefaultDecorator::_SnapWindowFromSettings(const char* label,
BList* otherList = window->GetSnappingList(otherSnapOrientation, BList* otherList = window->GetSnappingList(otherSnapOrientation,
thisSnapOrientation, false); thisSnapOrientation, false);
if (!otherList) { if (!otherList) {
debug_suffix = "\n"; debugSuffix = "\n";
continue; continue;
} }
for (int i = 0; i < otherList->CountItems(); i++) { for (int i = 0; i < otherList->CountItems(); i++) {
int32* snappedId = static_cast<int32*>(otherList->ItemAt(i)); int32* snappedId
= static_cast<int32*>(otherList->ItemAt(i));
if (*snappedId == fWindow->WindowId()) { if (*snappedId == fWindow->WindowId()) {
fWindow->SnapToWindow(window, thisSnapOrientation, fWindow->SnapToWindow(window, thisSnapOrientation,
otherSnapOrientation); otherSnapOrientation);
debug_suffix = ""; debugSuffix = "";
break; break;
} }
} }
} } else { //window isn't open - still retain snap id
else { //window isn't open - still retain snap id
fWindow->AddToSnappingList(id, thisSnapOrientation, fWindow->AddToSnappingList(id, thisSnapOrientation,
otherSnapOrientation); otherSnapOrientation);
debug_suffix = "... ?"; debugSuffix = "... ?";
} }
STRACE_SAT(("\t%s[%d]=%x", label, i, id)); STRACE_SAT(("\t%s[%d]=%x", label, i, id));
STRACE_SAT(("%s\n", debug_suffix)); STRACE_SAT(("%s\n", debugSuffix));
} }
} }
} }
@@ -619,19 +616,11 @@ DefaultDecorator::GetSettings(BMessage* settings) const
{ {
STRACE_SAT(("DefaultDecorator::GetSettings() on %s\n", fWindow->Title())); STRACE_SAT(("DefaultDecorator::GetSettings() on %s\n", fWindow->Title()));
if (!fTabRect.IsValid()) if (!fTabRect.IsValid()
return false; || settings->AddRect("tab frame", fTabRect) != B_OK
|| settings->AddFloat("border width", fBorderWidth) != B_OK
if (settings->AddRect("tab frame", fTabRect) != B_OK) || settings->AddFloat("tab location", (float)fTabOffset) != B_OK
return false; || settings->AddInt32("window id", fWindow->WindowId()) != B_OK)
if (settings->AddFloat("border width", fBorderWidth) != B_OK)
return false;
if (settings->AddFloat("tab location", (float)fTabOffset) != B_OK)
return false;
if (settings->AddInt32("window id", fWindow->WindowId()) != B_OK)
return false; return false;
// store id's of stacked windows // store id's of stacked windows
@@ -641,27 +630,20 @@ DefaultDecorator::GetSettings(BMessage* settings) const
// store id's of snapped windows // store id's of snapped windows
if (!_StoreIntsInSettings("snap left2left", if (!_StoreIntsInSettings("snap left2left",
fWindow->Left2LeftSnappingWindowIds(), settings)) fWindow->Left2LeftSnappingWindowIds(), settings)
return false; || !_StoreIntsInSettings("snap left2right",
if (!_StoreIntsInSettings("snap left2right", fWindow->Left2RightSnappingWindowIds(), settings)
fWindow->Left2RightSnappingWindowIds(), settings)) || !_StoreIntsInSettings("snap right2right",
return false; fWindow->Right2RightSnappingWindowIds(), settings)
if (!_StoreIntsInSettings("snap right2right", || !_StoreIntsInSettings("snap right2left",
fWindow->Right2RightSnappingWindowIds(), settings)) fWindow->Right2LeftSnappingWindowIds(), settings)
return false; || !_StoreIntsInSettings("snap top2top",
if (!_StoreIntsInSettings("snap right2left", fWindow->Top2TopSnappingWindowIds(), settings)
fWindow->Right2LeftSnappingWindowIds(), settings)) || !_StoreIntsInSettings("snap top2bottom",
return false; fWindow->Top2BottomSnappingWindowIds(), settings)
if (!_StoreIntsInSettings("snap top2top", || !_StoreIntsInSettings("snap bottom2top",
fWindow->Top2TopSnappingWindowIds(), settings)) fWindow->Bottom2TopSnappingWindowIds(), settings)
return false; || !_StoreIntsInSettings("snap bottom2bottom",
if (!_StoreIntsInSettings("snap top2bottom",
fWindow->Top2BottomSnappingWindowIds(), settings))
return false;
if (!_StoreIntsInSettings("snap bottom2top",
fWindow->Bottom2TopSnappingWindowIds(), settings))
return false;
if (!_StoreIntsInSettings("snap bottom2bottom",
fWindow->Bottom2BottomSnappingWindowIds(), settings)) fWindow->Bottom2BottomSnappingWindowIds(), settings))
return false; return false;
@@ -675,7 +657,7 @@ bool
DefaultDecorator::_StoreIntsInSettings(const char* label, DefaultDecorator::_StoreIntsInSettings(const char* label,
BList* ids, BMessage* settings) const BList* ids, BMessage* settings) const
{ {
if (ids) { if (ids != NULL) {
for (int i = 0; i < ids->CountItems(); i++) { for (int i = 0; i < ids->CountItems(); i++) {
int32* id = static_cast<int32*>(ids->ItemAt(i)); int32* id = static_cast<int32*>(ids->ItemAt(i));
if (settings->AddInt32(label, *id) != B_OK) if (settings->AddInt32(label, *id) != B_OK)
@@ -689,6 +671,7 @@ DefaultDecorator::_StoreIntsInSettings(const char* label,
// #pragma mark - // #pragma mark -
void void
DefaultDecorator::Draw(BRect update) DefaultDecorator::Draw(BRect update)
{ {
@@ -1632,6 +1615,7 @@ DefaultDecorator::HighlightTab(bool active, BRegion* dirty)
fTabColor = fFocusTabColor; fTabColor = fFocusTabColor;
else else
fTabColor = fNonFocusTabColor; fTabColor = fNonFocusTabColor;
dirty->Include(fTabRect); dirty->Include(fTabRect);
fTabHighlighted = active; fTabHighlighted = active;
} }
@@ -1641,12 +1625,7 @@ void
DefaultDecorator::HighlightBorders(bool active, BRegion* dirty) DefaultDecorator::HighlightBorders(bool active, BRegion* dirty)
{ {
if (active) { if (active) {
fFrameColors[0] = fHighlightFrameColors[0]; fFrameColors = fHighlightFrameColors;
fFrameColors[1] = fHighlightFrameColors[1];
fFrameColors[2] = fHighlightFrameColors[2];
fFrameColors[3] = fHighlightFrameColors[3];
fFrameColors[4] = fHighlightFrameColors[4];
fFrameColors[5] = fHighlightFrameColors[5];
} else if (IsFocus()) { } else if (IsFocus()) {
fFrameColors[0] = fNonHighlightFrameColors[0]; fFrameColors[0] = fNonHighlightFrameColors[0];
fFrameColors[1] = fNonHighlightFrameColors[1]; fFrameColors[1] = fNonHighlightFrameColors[1];
+13 -8
View File
@@ -12,11 +12,15 @@
#include "Decorator.h" #include "Decorator.h"
#include "Desktop.h" #include "Desktop.h"
#include "Window.h"
#include <Region.h> #include <Region.h>
class Desktop; class Desktop;
class ServerBitmap; class ServerBitmap;
class DefaultDecorator: public Decorator { class DefaultDecorator: public Decorator {
public: public:
DefaultDecorator(DesktopSettings& settings, DefaultDecorator(DesktopSettings& settings,
@@ -89,6 +93,15 @@ private:
bool focus, int32 width, int32 height, bool focus, int32 width, int32 height,
DefaultDecorator* object); DefaultDecorator* object);
// Stack & Tile specific private methods
bool _StoreIntsInSettings(const char* label,
BList* ids, BMessage* settings) const;
void _SnapWindowFromSettings(const char* label,
SnapOrientation thisSnapOrientation,
SnapOrientation otherSnapOrientation,
const BMessage* settings);
private:
rgb_color fButtonHighColor; rgb_color fButtonHighColor;
rgb_color fButtonLowColor; rgb_color fButtonLowColor;
rgb_color fTabColor; rgb_color fTabColor;
@@ -133,14 +146,6 @@ private:
bigtime_t fLastClicked; bigtime_t fLastClicked;
bool fWasDoubleClick; bool fWasDoubleClick;
//Stack & Tile specific private methods
bool _StoreIntsInSettings(const char* label,
BList* ids, BMessage* settings) const;
void _SnapWindowFromSettings(const char* label,
SnapOrientation thisSnapOrientation,
SnapOrientation otherSnapOrientation,
const BMessage* settings);
}; };
#endif // DEFAULT_DECORATOR_H #endif // DEFAULT_DECORATOR_H
+21 -34
View File
@@ -50,22 +50,6 @@
#include "Workspace.h" #include "Workspace.h"
#include "WorkspacesView.h" #include "WorkspacesView.h"
#include <ViewPrivate.h>
#include <WindowInfo.h>
#include <ServerProtocol.h>
#include <Debug.h>
#include <DirectWindow.h>
#include <Entry.h>
#include <Message.h>
#include <MessageFilter.h>
#include <Region.h>
#include <Roster.h>
#include <stdio.h>
#include <string.h>
#include <syslog.h>
#if TEST_MODE #if TEST_MODE
# include "EventStream.h" # include "EventStream.h"
#endif #endif
@@ -82,6 +66,7 @@
# define AutoWriteLocker BAutolock # define AutoWriteLocker BAutolock
#endif #endif
class KeyboardFilter : public EventFilter { class KeyboardFilter : public EventFilter {
public: public:
KeyboardFilter(Desktop* desktop); KeyboardFilter(Desktop* desktop);
@@ -204,23 +189,23 @@ KeyboardFilter::Filter(BMessage* message, EventTarget** _target,
} }
// switch between stacked windows // switch between stacked windows
if (modifiers & B_OPTION_KEY) { if ((modifiers & B_OPTION_KEY) != 0) {
BList* stackedWindows = fDesktop->FocusWindow()->StackedWindows(); BList* stackedWindows = fDesktop->FocusWindow()->StackedWindows();
if (key == 0x61 && stackedWindows) { if (key == 0x61 && stackedWindows) {
int32 oldIndex = // option key + cursor left
stackedWindows->IndexOf(fDesktop->FocusWindow()); int32 oldIndex
int32 newIndex = = stackedWindows->IndexOf(fDesktop->FocusWindow());
(oldIndex - 1 >= 0)? int32 newIndex = (oldIndex - 1 >= 0)
oldIndex - 1 : stackedWindows->CountItems() - 1; ? oldIndex - 1 : stackedWindows->CountItems() - 1;
fDesktop->ActivateWindow( fDesktop->ActivateWindow(
static_cast<Window*>(stackedWindows->ItemAt(newIndex))); static_cast<Window*>(stackedWindows->ItemAt(newIndex)));
return B_SKIP_MESSAGE; return B_SKIP_MESSAGE;
} else if (key == 0x63 && stackedWindows) { } else if (key == 0x63 && stackedWindows) {
int32 oldIndex = // option key + cursor right
stackedWindows->IndexOf(fDesktop->FocusWindow()); int32 oldIndex
int32 newIndex = = stackedWindows->IndexOf(fDesktop->FocusWindow());
(oldIndex + 1 < stackedWindows->CountItems())? int32 newIndex = (oldIndex + 1 < stackedWindows->CountItems())
oldIndex + 1 : 0; ? oldIndex + 1 : 0;
fDesktop->ActivateWindow( fDesktop->ActivateWindow(
static_cast<Window*>(stackedWindows->ItemAt(newIndex))); static_cast<Window*>(stackedWindows->ItemAt(newIndex)));
return B_SKIP_MESSAGE; return B_SKIP_MESSAGE;
@@ -240,7 +225,7 @@ KeyboardFilter::Filter(BMessage* message, EventTarget** _target,
// disable highlights if the stacking and snapping mode was just left // disable highlights if the stacking and snapping mode was just left
if (fDesktop->fIsStackingAndSnapping && !(modifiers & B_OPTION_KEY)) if (fDesktop->fIsStackingAndSnapping && !(modifiers & B_OPTION_KEY))
fDesktop->FinishStackingAndSnapping(); fDesktop->FinishStackingAndSnapping();
fDesktop->fIsStackingAndSnapping = modifiers & B_OPTION_KEY; fDesktop->fIsStackingAndSnapping = (modifiers & B_OPTION_KEY) != 0;
} }
return B_DISPATCH_MESSAGE; return B_DISPATCH_MESSAGE;
@@ -1038,10 +1023,10 @@ Desktop::ActivateWindow(Window* window)
// And then prepare to move stacked windows to the front // And then prepare to move stacked windows to the front
BList* stackedWindows = window->StackedWindows(); BList* stackedWindows = window->StackedWindows();
if (stackedWindows) { if (stackedWindows != NULL) {
for (int i = 0; i < stackedWindows->CountItems(); i++) { for (int i = 0; i < stackedWindows->CountItems(); i++) {
Window* stackedWindow = Window* stackedWindow
static_cast<Window*>(stackedWindows->ItemAt(i)); = static_cast<Window*>(stackedWindows->ItemAt(i));
if (stackedWindow != window if (stackedWindow != window
&& !stackedAndTiledWindows->HasItem(stackedWindow)) { && !stackedAndTiledWindows->HasItem(stackedWindow)) {
stackedAndTiledWindows->AddItem(stackedWindow); stackedAndTiledWindows->AddItem(stackedWindow);
@@ -1056,9 +1041,10 @@ Desktop::ActivateWindow(Window* window)
// Do the actual moving here // Do the actual moving here
for (int i = 0; i < stackedAndTiledWindows->CountItems(); i ++) { for (int i = 0; i < stackedAndTiledWindows->CountItems(); i ++) {
Window* win = static_cast<Window*>(stackedAndTiledWindows->ItemAt(i)); Window* window
_CurrentWindows().RemoveWindow(win); = static_cast<Window*>(stackedAndTiledWindows->ItemAt(i));
windows.AddWindow(win); _CurrentWindows().RemoveWindow(window);
windows.AddWindow(window);
} }
delete stackedAndTiledWindows; delete stackedAndTiledWindows;
@@ -1098,6 +1084,7 @@ Desktop::_AddWindowsByIdsToList(BList* windowIdsToAdd, BList* windows)
{ {
if (!windowIdsToAdd || !windows) if (!windowIdsToAdd || !windows)
return false; return false;
bool added = false; bool added = false;
for (int i = 0; i < windowIdsToAdd->CountItems(); i++) { for (int i = 0; i < windowIdsToAdd->CountItems(); i++) {
int32* id = static_cast<int32*>(windowIdsToAdd->ItemAt(i)); int32* id = static_cast<int32*>(windowIdsToAdd->ItemAt(i));
+1
View File
@@ -36,6 +36,7 @@
#include "LinearSpec.h" #include "LinearSpec.h"
#define USE_MULTI_LOCKER 1 #define USE_MULTI_LOCKER 1
#if USE_MULTI_LOCKER #if USE_MULTI_LOCKER
+4 -2
View File
@@ -896,7 +896,8 @@ ServerWindow::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
xResizeTo - fWindow->Frame().Width(), xResizeTo - fWindow->Frame().Width(),
yResizeTo - fWindow->Frame().Height()); yResizeTo - fWindow->Frame().Height());
// Re-apply stack & tile constraints so that any other windows // Re-apply stack & tile constraints so that any other windows
//that are stacked/snapped against this window can be re-adjusted // that are stacked/snapped against this window can be
// re-adjusted
fWindow->StackAndTile(); fWindow->StackAndTile();
fLink.StartMessage(B_OK); fLink.StartMessage(B_OK);
// } // }
@@ -923,7 +924,8 @@ ServerWindow::_DispatchMessage(int32 code, BPrivate::LinkReceiver &link)
fDesktop->MoveWindowBy(fWindow, xMoveTo - fWindow->Frame().left, fDesktop->MoveWindowBy(fWindow, xMoveTo - fWindow->Frame().left,
yMoveTo - fWindow->Frame().top); yMoveTo - fWindow->Frame().top);
// Re-apply stack & tile constraints so that any other windows // Re-apply stack & tile constraints so that any other windows
//that are stacked/snapped against this window can be re-adjusted // that are stacked/snapped against this window can be
// re-adjusted
fWindow->StackAndTile(); fWindow->StackAndTile();
fLink.StartMessage(B_OK); fLink.StartMessage(B_OK);
} }
+82 -80
View File
@@ -2467,6 +2467,9 @@ Window::UpdateSession::Exclude(BRegion* dirtyInNextSession)
} }
// #pragma mark - Stack & Tile
bool bool
Window::HighlightTab(bool active, BRegion& dirty) Window::HighlightTab(bool active, BRegion& dirty)
{ {
@@ -2610,11 +2613,11 @@ Window::_InitStackingAndSnapping()
fRightVar->SetRange(-DBL_MAX, DBL_MAX); fRightVar->SetRange(-DBL_MAX, DBL_MAX);
fBottomVar->SetRange(-DBL_MAX, DBL_MAX); fBottomVar->SetRange(-DBL_MAX, DBL_MAX);
fLeftConstraint = fDesktop->fStackAndTileSpec fLeftConstraint
->AddConstraint(1.0, fLeftVar, = fDesktop->fStackAndTileSpec->AddConstraint(1.0, fLeftVar,
OperatorType(EQ), fFrame.left, 1, 1); OperatorType(EQ), fFrame.left, 1, 1);
fTopConstraint = fDesktop->fStackAndTileSpec fTopConstraint
->AddConstraint(1.0, fTopVar, = fDesktop->fStackAndTileSpec->AddConstraint(1.0, fTopVar,
OperatorType(EQ), fFrame.top, 1, 1); OperatorType(EQ), fFrame.top, 1, 1);
label = Title(); label = Title();
label << ".fLeftConstraint"; label << ".fLeftConstraint";
@@ -2625,12 +2628,12 @@ Window::_InitStackingAndSnapping()
int32 minWidth, maxWidth, minHeight, maxHeight; int32 minWidth, maxWidth, minHeight, maxHeight;
GetSizeLimits(&minWidth, &maxWidth, &minHeight, &maxHeight); GetSizeLimits(&minWidth, &maxWidth, &minHeight, &maxHeight);
fMinWidthConstraint = fDesktop->fStackAndTileSpec fMinWidthConstraint
->AddConstraint(1.0, fLeftVar, -1.0, fRightVar, = fDesktop->fStackAndTileSpec->AddConstraint(1.0, fLeftVar, -1.0,
OperatorType(LE), -minWidth); fRightVar, OperatorType(LE), -minWidth);
fMinHeightConstraint = fDesktop->fStackAndTileSpec fMinHeightConstraint
->AddConstraint(1.0, fTopVar, -1.0, fBottomVar, = fDesktop->fStackAndTileSpec->AddConstraint(1.0, fTopVar, -1.0,
OperatorType(LE), -minHeight); fBottomVar, OperatorType(LE), -minHeight);
label = Title(); label = Title();
label << ".fMinWidthConstraint"; label << ".fMinWidthConstraint";
fMinWidthConstraint->SetLabel(label.String()); fMinWidthConstraint->SetLabel(label.String());
@@ -2641,12 +2644,12 @@ Window::_InitStackingAndSnapping()
// The width and height constraints have higher penalties than the // The width and height constraints have higher penalties than the
// position constraints (left, top), so a window will keep its size // position constraints (left, top), so a window will keep its size
// unless explicitly resized. // unless explicitly resized.
fWidthConstraint = fDesktop->fStackAndTileSpec fWidthConstraint
->AddConstraint(-1.0, fLeftVar, 1.0, fRightVar, = fDesktop->fStackAndTileSpec->AddConstraint(-1.0, fLeftVar, 1.0,
OperatorType(EQ), fFrame.Width(), 10, 10); fRightVar, OperatorType(EQ), fFrame.Width(), 10, 10);
fHeightConstraint = fDesktop->fStackAndTileSpec fHeightConstraint
->AddConstraint(-1.0, fTopVar, 1.0, fBottomVar, = fDesktop->fStackAndTileSpec->AddConstraint(-1.0, fTopVar, 1.0,
OperatorType(EQ), fFrame.Height(), 10, 10); fBottomVar, OperatorType(EQ), fFrame.Height(), 10, 10);
label = Title(); label = Title();
label << ".fWidthConstraint"; label << ".fWidthConstraint";
fWidthConstraint->SetLabel(label.String()); fWidthConstraint->SetLabel(label.String());
@@ -2872,13 +2875,16 @@ Window::_CheckIfReadyToStack()
// if the stacking candidate has changed, change tab highlights // if the stacking candidate has changed, change tab highlights
if (prevWindowUnder != fWindowUnder) { if (prevWindowUnder != fWindowUnder) {
if(!prevWindowUnder) { // candidate found for the first time if (!prevWindowUnder) {
// candidate found for the first time
fDesktop->HighlightTab(this, true); fDesktop->HighlightTab(this, true);
fDesktop->HighlightTab(fWindowUnder, true); fDesktop->HighlightTab(fWindowUnder, true);
} else if(!fWindowUnder) { // no candidate after there was one } else if (!fWindowUnder) {
// no candidate after there was one
fDesktop->HighlightTab(this, false); fDesktop->HighlightTab(this, false);
fDesktop->HighlightTab(prevWindowUnder, false); fDesktop->HighlightTab(prevWindowUnder, false);
} else { // changing from one to another candidate } else {
// changing from one to another candidate
fDesktop->HighlightTab(prevWindowUnder, false); fDesktop->HighlightTab(prevWindowUnder, false);
fDesktop->HighlightTab(fWindowUnder, true); fDesktop->HighlightTab(fWindowUnder, true);
} }
@@ -3181,7 +3187,8 @@ Window::_CheckIfReadyToSnap()
/*! \brief Snaps this window to the current candidate windows for snapping /*! \brief Snaps this window to the current candidate windows for snapping
on each side. Afterwards snapping candidates are cleared. on each side. Afterwards snapping candidates are cleared.
*/ */
void Window::_SnapWindow() void
Window::_SnapWindow()
{ {
BRect bounds; BRect bounds;
Window* leftmostWindow; Window* leftmostWindow;
@@ -3258,8 +3265,7 @@ void Window::_SnapWindow()
window->AddToSnappingList(this, SNAP_RIGHT, SNAP_LEFT); window->AddToSnappingList(this, SNAP_RIGHT, SNAP_LEFT);
STRACE_SAT(("Adding %s[%d] to %s[%d]'s L2R list\n", STRACE_SAT(("Adding %s[%d] to %s[%d]'s L2R list\n",
window->Title(), window->WindowId(), Title(), window->Title(), window->WindowId(), Title(), WindowId()));
WindowId()));
} }
} }
@@ -3320,10 +3326,9 @@ void Window::_SnapWindow()
Window* window = static_cast<Window*>( Window* window = static_cast<Window*>(
fTopAdjacentWindows->ItemAt(i)); fTopAdjacentWindows->ItemAt(i));
window->_InitStackingAndSnapping(); window->_InitStackingAndSnapping();
Constraint* topSnapping = Constraint* topSnapping
fDesktop->fStackAndTileSpec->AddConstraint( = fDesktop->fStackAndTileSpec->AddConstraint(
-1, window->fBottomVar, 1, fTopVar, -1, window->fBottomVar, 1, fTopVar, OperatorType(EQ), 32);
OperatorType(EQ), 32);
BString label("topSnapping of "); BString label("topSnapping of ");
label << Title(); label << Title();
topSnapping->SetLabel(label.String()); topSnapping->SetLabel(label.String());
@@ -3333,8 +3338,7 @@ void Window::_SnapWindow()
window->AddToSnappingList(this, SNAP_BOTTOM, SNAP_TOP); window->AddToSnappingList(this, SNAP_BOTTOM, SNAP_TOP);
STRACE_SAT(("Adding %s[%d] to %s[%d]'s T2B list\n", STRACE_SAT(("Adding %s[%d] to %s[%d]'s T2B list\n",
window->Title(), window->WindowId(), Title(), window->Title(), window->WindowId(), Title(), WindowId()));
WindowId()));
} }
} }
@@ -3395,10 +3399,9 @@ void Window::_SnapWindow()
Window* window = static_cast<Window*>( Window* window = static_cast<Window*>(
fRightAdjacentWindows->ItemAt(i)); fRightAdjacentWindows->ItemAt(i));
window->_InitStackingAndSnapping(); window->_InitStackingAndSnapping();
Constraint* rightSnapping = Constraint* rightSnapping
fDesktop->fStackAndTileSpec->AddConstraint( = fDesktop->fStackAndTileSpec->AddConstraint(
-1, fRightVar, 1, window->fLeftVar, -1, fRightVar, 1, window->fLeftVar, OperatorType(EQ), 11);
OperatorType(EQ), 11);
BString label("rightSnapping of "); BString label("rightSnapping of ");
label << Title(); label << Title();
rightSnapping->SetLabel(label.String()); rightSnapping->SetLabel(label.String());
@@ -3408,8 +3411,7 @@ void Window::_SnapWindow()
window->AddToSnappingList(this, SNAP_LEFT, SNAP_RIGHT); window->AddToSnappingList(this, SNAP_LEFT, SNAP_RIGHT);
STRACE_SAT(("Adding %s[%d] to %s[%d]'s R2L list\n", STRACE_SAT(("Adding %s[%d] to %s[%d]'s R2L list\n",
window->Title(), window->WindowId(), Title(), window->Title(), window->WindowId(), Title(), WindowId()));
WindowId()));
} }
} }
@@ -3470,10 +3472,9 @@ void Window::_SnapWindow()
Window* window = static_cast<Window*>( Window* window = static_cast<Window*>(
fBottomAdjacentWindows->ItemAt(i)); fBottomAdjacentWindows->ItemAt(i));
window->_InitStackingAndSnapping(); window->_InitStackingAndSnapping();
Constraint* bottomSnapping = Constraint* bottomSnapping
fDesktop->fStackAndTileSpec->AddConstraint( = fDesktop->fStackAndTileSpec->AddConstraint(
-1, fBottomVar, 1, window->fTopVar, -1, fBottomVar, 1, window->fTopVar, OperatorType(EQ), 32);
OperatorType(EQ), 32);
BString label("bottomSnapping of "); BString label("bottomSnapping of ");
label << Title(); label << Title();
bottomSnapping->SetLabel(label.String()); bottomSnapping->SetLabel(label.String());
@@ -3483,8 +3484,7 @@ void Window::_SnapWindow()
window->AddToSnappingList(this, SNAP_TOP, SNAP_BOTTOM); window->AddToSnappingList(this, SNAP_TOP, SNAP_BOTTOM);
STRACE_SAT(("Adding %s[%d] to %s[%d]'s B2T list\n", STRACE_SAT(("Adding %s[%d] to %s[%d]'s B2T list\n",
window->Title(), window->WindowId(), Title(), window->Title(), window->WindowId(), Title(), WindowId()));
WindowId()));
} }
} }
@@ -3501,9 +3501,9 @@ void Window::_SnapWindow()
void void
Window::AddToSnappingList(Window* window, Window::AddToSnappingList(Window* window, SnapOrientation thisSnapOrientation,
SnapOrientation thisSnapOrientation, SnapOrientation otherSnapOrientation)
SnapOrientation otherSnapOrientation) { {
AddToSnappingList(window->WindowId(), thisSnapOrientation, AddToSnappingList(window->WindowId(), thisSnapOrientation,
otherSnapOrientation); otherSnapOrientation);
} }
@@ -3519,10 +3519,9 @@ Window::AddToSnappingList(Window* window,
\param otherSnapOrientation snapping orientation for given window \param otherSnapOrientation snapping orientation for given window
*/ */
void void
Window::AddToSnappingList(int32 windowId, Window::AddToSnappingList(int32 windowId, SnapOrientation thisSnapOrientation,
SnapOrientation thisSnapOrientation, SnapOrientation otherSnapOrientation)
SnapOrientation otherSnapOrientation) { {
BList* windowIdList = GetSnappingList(thisSnapOrientation, BList* windowIdList = GetSnappingList(thisSnapOrientation,
otherSnapOrientation, true); otherSnapOrientation, true);
// This may be the case if invalid snap orientation combo is given // This may be the case if invalid snap orientation combo is given
@@ -3541,11 +3540,12 @@ Window::AddToSnappingList(int32 windowId,
*id = windowId; *id = windowId;
windowIdList->AddItem(id); windowIdList->AddItem(id);
#ifdef DEBUG_STACK_AND_TILE
char snapStr[][7] = {"left", "right", "top", "bottom"}; char snapStr[][7] = {"left", "right", "top", "bottom"};
STRACE_SAT(("\tAdded %s to %s's %s 2 %s list\n", STRACE_SAT(("\tAdded %s to %s's %s 2 %s list\n",
windowId, Title(), windowId, Title(), snapStr[thisSnapOrientation],
snapStr[thisSnapOrientation],
snapStr[otherSnapOrientation])); snapStr[otherSnapOrientation]));
#endif
} }
@@ -3559,8 +3559,8 @@ Window::AddToSnappingList(int32 windowId,
*/ */
void void
Window::RemoveFromSnappingList(int32 windowId, Window::RemoveFromSnappingList(int32 windowId,
SnapOrientation thisSnapOrientation, SnapOrientation thisSnapOrientation, SnapOrientation otherSnapOrientation)
SnapOrientation otherSnapOrientation) { {
BList* windowIdList = GetSnappingList(thisSnapOrientation, BList* windowIdList = GetSnappingList(thisSnapOrientation,
otherSnapOrientation, false); otherSnapOrientation, false);
@@ -3575,11 +3575,13 @@ Window::RemoveFromSnappingList(int32 windowId,
windowIdList->RemoveItem(i); windowIdList->RemoveItem(i);
free(id); free(id);
#ifdef DEBUG_STACK_AND_TILE
char snapStr[][7] = {"left", "right", "top", "bottom"}; char snapStr[][7] = {"left", "right", "top", "bottom"};
STRACE_SAT(("\tRemoved %x from %s's %s 2 %s list\n", STRACE_SAT(("\tRemoved %x from %s's %s 2 %s list\n",
windowId, Title(), windowId, Title(),
snapStr[thisSnapOrientation], snapStr[thisSnapOrientation],
snapStr[otherSnapOrientation])); snapStr[otherSnapOrientation]));
#endif
return; return;
} }
} }
@@ -3597,8 +3599,7 @@ Window::RemoveFromSnappingList(int32 windowId,
*/ */
BList* BList*
Window::GetSnappingList(SnapOrientation thisSnapOrientation, Window::GetSnappingList(SnapOrientation thisSnapOrientation,
SnapOrientation otherSnapOrientation, SnapOrientation otherSnapOrientation, bool createIfNull)
bool createIfNull)
{ {
BList** windowIdListRef = _GetSnappingListRef(thisSnapOrientation, BList** windowIdListRef = _GetSnappingListRef(thisSnapOrientation,
otherSnapOrientation, createIfNull); otherSnapOrientation, createIfNull);
@@ -3611,8 +3612,7 @@ Window::GetSnappingList(SnapOrientation thisSnapOrientation,
BList** BList**
Window::_GetSnappingListRef(SnapOrientation thisSnapOrientation, Window::_GetSnappingListRef(SnapOrientation thisSnapOrientation,
SnapOrientation otherSnapOrientation, SnapOrientation otherSnapOrientation, bool createIfNull)
bool createIfNull)
{ {
BList** windowIdListRef = NULL; BList** windowIdListRef = NULL;
if (thisSnapOrientation == SNAP_LEFT if (thisSnapOrientation == SNAP_LEFT
@@ -3668,8 +3668,7 @@ Window::_GetSnappingListRef(SnapOrientation thisSnapOrientation,
\param otherSnap snapping orientation for given window \param otherSnap snapping orientation for given window
*/ */
Constraint* Constraint*
Window::SnapToWindow(Window* otherWindow, Window::SnapToWindow(Window* otherWindow, SnapOrientation thisSnap,
SnapOrientation thisSnap,
SnapOrientation otherSnap) SnapOrientation otherSnap)
{ {
Variable* thisSnappingVar; Variable* thisSnappingVar;
@@ -3699,7 +3698,8 @@ Window::SnapToWindow(Window* otherWindow,
break; break;
case SNAP_RIGHT: case SNAP_RIGHT:
snapDistance = -11; snapDistance = -11;
moveDeltaX = otherFrame.right - thisFrame.left - snapDistance; moveDeltaX
= otherFrame.right - thisFrame.left - snapDistance;
otherSnappingVar = otherWindow->fRightVar; otherSnappingVar = otherWindow->fRightVar;
break; break;
default: default:
@@ -3709,10 +3709,12 @@ Window::SnapToWindow(Window* otherWindow,
case SNAP_RIGHT: case SNAP_RIGHT:
thisSnappingVar = fRightVar; thisSnappingVar = fRightVar;
snappingLabel << "rightSnapping of "; snappingLabel << "rightSnapping of ";
switch (otherSnap) { switch (otherSnap) {
case SNAP_LEFT: case SNAP_LEFT:
snapDistance = 11; snapDistance = 11;
moveDeltaX = otherFrame.left - thisFrame.right - snapDistance; moveDeltaX
= otherFrame.left - thisFrame.right - snapDistance;
otherSnappingVar = otherWindow->fLeftVar; otherSnappingVar = otherWindow->fLeftVar;
break; break;
case SNAP_RIGHT: case SNAP_RIGHT:
@@ -3733,7 +3735,8 @@ Window::SnapToWindow(Window* otherWindow,
break; break;
case SNAP_BOTTOM: case SNAP_BOTTOM:
snapDistance = -32; snapDistance = -32;
moveDeltaY = otherFrame.bottom - thisFrame.top - snapDistance; moveDeltaY
= otherFrame.bottom - thisFrame.top - snapDistance;
otherSnappingVar = otherWindow->fBottomVar; otherSnappingVar = otherWindow->fBottomVar;
break; break;
default: default:
@@ -3746,7 +3749,8 @@ Window::SnapToWindow(Window* otherWindow,
switch (otherSnap) { switch (otherSnap) {
case SNAP_TOP: case SNAP_TOP:
snapDistance = 32; snapDistance = 32;
moveDeltaY = otherFrame.top - thisFrame.bottom - snapDistance; moveDeltaY
= otherFrame.top - thisFrame.bottom - snapDistance;
otherSnappingVar = otherWindow->fTopVar; otherSnappingVar = otherWindow->fTopVar;
break; break;
case SNAP_BOTTOM: case SNAP_BOTTOM:
@@ -3764,10 +3768,11 @@ Window::SnapToWindow(Window* otherWindow,
Constraint* snappingConstraint; Constraint* snappingConstraint;
if (snapDistance == 0) if (snapDistance == 0)
snappingConstraint = thisSnappingVar->IsEqual(otherSnappingVar); snappingConstraint = thisSnappingVar->IsEqual(otherSnappingVar);
else else {
snappingConstraint = fDesktop->fStackAndTileSpec->AddConstraint( snappingConstraint = fDesktop->fStackAndTileSpec->AddConstraint(
-1, thisSnappingVar, 1, otherSnappingVar, -1, thisSnappingVar, 1, otherSnappingVar, OperatorType(EQ),
OperatorType(EQ), snapDistance); snapDistance);
}
snappingLabel << Title(); snappingLabel << Title();
snappingConstraint->SetLabel(snappingLabel.String()); snappingConstraint->SetLabel(snappingLabel.String());
@@ -3795,9 +3800,8 @@ Window::SnapToWindow(Window* otherWindow,
should be stored. should be stored.
*/ */
BRect BRect
Window::_BoundingRectAndWindows(BList* windows, Window::_BoundingRectAndWindows(BList* windows, Window** leftmostWindow,
Window** leftmostWindow, Window** topmostWindow, Window** topmostWindow, Window** rightmostWindow, Window** bottommostWindow)
Window** rightmostWindow, Window** bottommostWindow)
{ {
ASSERT(!windows->IsEmpty()); ASSERT(!windows->IsEmpty());
@@ -3916,10 +3920,8 @@ Window::StackAndTile()
} }
// set window locations and sizes // set window locations and sizes
for (Window* window = fDesktop->GetWindows().LastWindow(); for (Window* window = fDesktop->GetWindows().LastWindow(); window != NULL;
window;
window = window->PreviousWindow(fCurrentWorkspace)) { window = window->PreviousWindow(fCurrentWorkspace)) {
if (window->fLeftVar) { if (window->fLeftVar) {
fDesktop->MoveWindowBy(window, fDesktop->MoveWindowBy(window,
window->fLeftVar->Value() - window->fFrame.left, window->fLeftVar->Value() - window->fFrame.left,
@@ -3972,8 +3974,8 @@ Window::StackAndTile()
} }
debug_printf("\n"); debug_printf("\n");
delete specStr; delete specStr;
#endif
STRACE_SAT(("Finished Window::StackAndTile() on %s\n", Title())); STRACE_SAT(("Finished Window::StackAndTile() on %s\n", Title()));
#endif
} }
@@ -4030,8 +4032,8 @@ Window::SetWindowId(int32 windowId)
void void
Window::_RemoveStackingPersistently() Window::_RemoveStackingPersistently()
{ {
STRACE_SAT(("Window::_RemoveStackingPersistently() on %s, fStackedWindowIds=%x\n", STRACE_SAT(("Window::_RemoveStackingPersistently() on %s, "
Title(), fStackedWindowIds)); "fStackedWindowIds=%x\n", Title(), fStackedWindowIds));
if (!fStackedWindowIds) if (!fStackedWindowIds)
return; return;
@@ -4083,9 +4085,9 @@ Window::_RemoveSnappingPersistently()
id from the snapping list of other relevant windows id from the snapping list of other relevant windows
*/ */
void void
Window::_FreeUpSnappingList(SnapOrientation thisSnap, Window::_FreeUpSnappingList(SnapOrientation thisSnap, SnapOrientation otherSnap,
SnapOrientation otherSnap, bool deleteFromOtherWindowsList)
bool deleteFromOtherWindowsList) { {
BList** idListRef = _GetSnappingListRef(thisSnap, otherSnap, false); BList** idListRef = _GetSnappingListRef(thisSnap, otherSnap, false);
if (!idListRef) if (!idListRef)
@@ -4101,8 +4103,10 @@ Window::_FreeUpSnappingList(SnapOrientation thisSnap,
Window* otherWindow = fDesktop->FindWindow(*id); Window* otherWindow = fDesktop->FindWindow(*id);
// Remove this window from the other window's snapping list. // Remove this window from the other window's snapping list.
// Note the order of orientation is reversed. // Note the order of orientation is reversed.
if (otherWindow) if (otherWindow) {
otherWindow->RemoveFromSnappingList(WindowId(), otherSnap, thisSnap); otherWindow->RemoveFromSnappingList(WindowId(), otherSnap,
thisSnap);
}
} }
free(id); free(id);
} }
@@ -4134,5 +4138,3 @@ Window::UpdateSession::AddCause(uint8 cause)
{ {
fCause |= cause; fCause |= cause;
} }
+34 -31
View File
@@ -50,6 +50,7 @@ enum SnapOrientation {
SNAP_LEFT, SNAP_RIGHT, SNAP_TOP, SNAP_BOTTOM SNAP_LEFT, SNAP_RIGHT, SNAP_TOP, SNAP_BOTTOM
}; };
class Window { class Window {
public: public:
Window(const BRect& frame, const char *name, Window(const BRect& frame, const char *name,
@@ -333,6 +334,39 @@ protected:
void _AlterDeltaForSnap(BPoint& delta, void _AlterDeltaForSnap(BPoint& delta,
bigtime_t now); bigtime_t now);
// Stack & Tile specific members
void _InitStackingAndSnapping();
void _RemoveStackingAndSnapping();
void _CheckIfReadyToStack();
void _StackWindow();
void _ArrangeStackedWindowTabs();
void _CheckIfReadyToSnap();
void _SnapWindow();
BRect _BoundingRectAndWindows(BList* windows,
Window** leftmostWindow,
Window** topmostWindow,
Window** rightmostWindow,
Window** bottommostWindow);
void _BoundWindowByWorkspace();
void _UnboundWindowByWorkspace();
void _RemoveStackingPersistently();
void _RemoveSnappingPersistently();
void _FreeUpSnappingList(SnapOrientation thisSnap,
SnapOrientation otherSnap,
bool deleteFromOtherWindowsList);
BList** _GetSnappingListRef(
SnapOrientation thisSnapOrientation,
SnapOrientation otherSnapOrientation,
bool createIfNull);
void _EnsureWindowWithinScreenBounds(Window* window, Window* detached);
protected:
BString fTitle; BString fTitle;
// TODO: no fp rects anywhere // TODO: no fp rects anywhere
BRect fFrame; BRect fFrame;
@@ -454,37 +488,6 @@ protected:
int32 fWorkspacesViewCount; int32 fWorkspacesViewCount;
// Stack & Tile specific members // Stack & Tile specific members
void _InitStackingAndSnapping();
void _RemoveStackingAndSnapping();
void _CheckIfReadyToStack();
void _StackWindow();
void _ArrangeStackedWindowTabs();
void _CheckIfReadyToSnap();
void _SnapWindow();
BRect _BoundingRectAndWindows(BList* windows,
Window** leftmostWindow,
Window** topmostWindow,
Window** rightmostWindow,
Window** bottommostWindow);
void _BoundWindowByWorkspace();
void _UnboundWindowByWorkspace();
void _RemoveStackingPersistently();
void _RemoveSnappingPersistently();
void _FreeUpSnappingList(SnapOrientation thisSnap,
SnapOrientation otherSnap,
bool deleteFromOtherWindowsList);
BList** _GetSnappingListRef(
SnapOrientation thisSnapOrientation,
SnapOrientation otherSnapOrientation,
bool createIfNull);
void _EnsureWindowWithinScreenBounds(Window* window, Window* detached);
Variable* fLeftVar; Variable* fLeftVar;
Variable* fTopVar; Variable* fTopVar;
Variable* fRightVar; Variable* fRightVar;
+2 -3
View File
@@ -135,8 +135,7 @@ WorkspacesView::_WorkspaceAt(BPoint where, int32& index)
BRect BRect
WorkspacesView::_WindowFrame(const BRect& workspaceFrame, WorkspacesView::_WindowFrame(const BRect& workspaceFrame,
const BRect& screenFrame, const BRect& windowFrame, const BRect& screenFrame, const BRect& windowFrame, BPoint windowPosition)
BPoint windowPosition)
{ {
BRect frame = windowFrame; BRect frame = windowFrame;
frame.OffsetTo(windowPosition); frame.OffsetTo(windowPosition);
@@ -568,7 +567,7 @@ WorkspacesView::MouseMoved(BMessage* message, BPoint where)
if (fHasMoved) { if (fHasMoved) {
Window()->Desktop()->MoveWindowBy(fSelectedWindow, left - leftTop.x, Window()->Desktop()->MoveWindowBy(fSelectedWindow, left - leftTop.x,
top - leftTop.y, fSelectedWorkspace); top - leftTop.y, fSelectedWorkspace);
//TODO Re-apply stack & tile constraints so that any other windows // TODO: Re-apply stack & tile constraints so that any other windows
// that are stacked/snapped against this window can be re-adjusted. // that are stacked/snapped against this window can be re-adjusted.
// Must smartly call stack and tile after workspace shifting has // Must smartly call stack and tile after workspace shifting has
// finalised. How? // finalised. How?