+
+static bool rowRLBT(const Rect &first, const Rect &second) {
+ if (first.bottom() == second.bottom())
+ return first.right() > second.right();
+ return first.bottom() > second.bottom();
+}
+
+static bool rowRLTB(const Rect &first, const Rect &second) {
+ if (first.y() == second.y())
+ return first.right() > second.right();
+ return first.y() < second.y();
+}
+
+static bool rowLRBT(const Rect &first, const Rect &second) {
+ if (first.bottom() == second.bottom())
+ return first.x() < second.x();
+ return first.bottom() > second.bottom();
+}
+
+static bool rowLRTB(const Rect &first, const Rect &second) {
+ if (first.y() == second.y())
+ return first.x() < second.x();
+ return first.y() < second.y();
+}
+
+static bool colLRTB(const Rect &first, const Rect &second) {
+ if (first.x() == second.x())
+ return first.y() < second.y();
+ return first.x() < second.x();
+}
+
+static bool colLRBT(const Rect &first, const Rect &second) {
+ if (first.x() == second.x())
+ return first.bottom() > second.bottom();
+ return first.x() < second.x();
+}
+
+static bool colRLTB(const Rect &first, const Rect &second) {
+ if (first.right() == second.right())
+ return first.y() < second.y();
+ return first.right() > second.right();
+}
+
+static bool colRLBT(const Rect &first, const Rect &second) {
+ if (first.right() == second.right())
+ return first.bottom() > second.bottom();
+ return first.right() > second.right();
+}
+
+
+bool Workspace::smartPlacement(Rect& win, const Rect& availableArea) {