Changeset View
Changeset View
Standalone View
Standalone View
placement.cpp
Show First 20 Lines • Show All 845 Lines • ▼ Show 20 Line(s) | |||||
846 | int Workspace::packPositionLeft(const AbstractClient *client, int oldX, bool leftEdge) const | 846 | int Workspace::packPositionLeft(const AbstractClient *client, int oldX, bool leftEdge) const | ||
847 | { | 847 | { | ||
848 | int newX = clientArea(MaximizeArea, client).left(); | 848 | int newX = clientArea(MaximizeArea, client).left(); | ||
849 | if (oldX <= newX) { // try another Xinerama screen | 849 | if (oldX <= newX) { // try another Xinerama screen | ||
850 | newX = clientArea(MaximizeArea, | 850 | newX = clientArea(MaximizeArea, | ||
851 | QPoint(client->frameGeometry().left() - 1, client->frameGeometry().center().y()), client->desktop()).left(); | 851 | QPoint(client->frameGeometry().left() - 1, client->frameGeometry().center().y()), client->desktop()).left(); | ||
852 | } | 852 | } | ||
853 | if (client->titlebarPosition() != AbstractClient::PositionLeft) { | 853 | if (client->titlebarPosition() != AbstractClient::PositionLeft) { | ||
854 | const int right = newX - client->clientPos().x(); | 854 | const int right = newX - client->frameMargins().left(); | ||
855 | QRect frameGeometry = client->frameGeometry(); | 855 | QRect frameGeometry = client->frameGeometry(); | ||
856 | frameGeometry.moveRight(right); | 856 | frameGeometry.moveRight(right); | ||
857 | if (screens()->intersecting(frameGeometry) < 2) { | 857 | if (screens()->intersecting(frameGeometry) < 2) { | ||
858 | newX = right; | 858 | newX = right; | ||
859 | } | 859 | } | ||
860 | } | 860 | } | ||
861 | if (oldX <= newX) { | 861 | if (oldX <= newX) { | ||
862 | return oldX; | 862 | return oldX; | ||
Show All 16 Lines | |||||
879 | int Workspace::packPositionRight(const AbstractClient *client, int oldX, bool rightEdge) const | 879 | int Workspace::packPositionRight(const AbstractClient *client, int oldX, bool rightEdge) const | ||
880 | { | 880 | { | ||
881 | int newX = clientArea(MaximizeArea, client).right(); | 881 | int newX = clientArea(MaximizeArea, client).right(); | ||
882 | if (oldX >= newX) { // try another Xinerama screen | 882 | if (oldX >= newX) { // try another Xinerama screen | ||
883 | newX = clientArea(MaximizeArea, | 883 | newX = clientArea(MaximizeArea, | ||
884 | QPoint(client->frameGeometry().right() + 1, client->frameGeometry().center().y()), client->desktop()).right(); | 884 | QPoint(client->frameGeometry().right() + 1, client->frameGeometry().center().y()), client->desktop()).right(); | ||
885 | } | 885 | } | ||
886 | if (client->titlebarPosition() != AbstractClient::PositionRight) { | 886 | if (client->titlebarPosition() != AbstractClient::PositionRight) { | ||
887 | const int right = newX + client->width() - (client->clientSize().width() + client->clientPos().x()); | 887 | const int right = newX + client->frameMargins().right(); | ||
888 | QRect frameGeometry = client->frameGeometry(); | 888 | QRect frameGeometry = client->frameGeometry(); | ||
889 | frameGeometry.moveRight(right); | 889 | frameGeometry.moveRight(right); | ||
890 | if (screens()->intersecting(frameGeometry) < 2) { | 890 | if (screens()->intersecting(frameGeometry) < 2) { | ||
891 | newX = right; | 891 | newX = right; | ||
892 | } | 892 | } | ||
893 | } | 893 | } | ||
894 | if (oldX >= newX) { | 894 | if (oldX >= newX) { | ||
895 | return oldX; | 895 | return oldX; | ||
Show All 16 Lines | |||||
912 | int Workspace::packPositionUp(const AbstractClient *client, int oldY, bool topEdge) const | 912 | int Workspace::packPositionUp(const AbstractClient *client, int oldY, bool topEdge) const | ||
913 | { | 913 | { | ||
914 | int newY = clientArea(MaximizeArea, client).top(); | 914 | int newY = clientArea(MaximizeArea, client).top(); | ||
915 | if (oldY <= newY) { // try another Xinerama screen | 915 | if (oldY <= newY) { // try another Xinerama screen | ||
916 | newY = clientArea(MaximizeArea, | 916 | newY = clientArea(MaximizeArea, | ||
917 | QPoint(client->frameGeometry().center().x(), client->frameGeometry().top() - 1), client->desktop()).top(); | 917 | QPoint(client->frameGeometry().center().x(), client->frameGeometry().top() - 1), client->desktop()).top(); | ||
918 | } | 918 | } | ||
919 | if (client->titlebarPosition() != AbstractClient::PositionTop) { | 919 | if (client->titlebarPosition() != AbstractClient::PositionTop) { | ||
920 | const int top = newY - client->clientPos().y(); | 920 | const int top = newY - client->frameMargins().top(); | ||
921 | QRect frameGeometry = client->frameGeometry(); | 921 | QRect frameGeometry = client->frameGeometry(); | ||
922 | frameGeometry.moveTop(top); | 922 | frameGeometry.moveTop(top); | ||
923 | if (screens()->intersecting(frameGeometry) < 2) { | 923 | if (screens()->intersecting(frameGeometry) < 2) { | ||
924 | newY = top; | 924 | newY = top; | ||
925 | } | 925 | } | ||
926 | } | 926 | } | ||
927 | if (oldY <= newY) { | 927 | if (oldY <= newY) { | ||
928 | return oldY; | 928 | return oldY; | ||
Show All 16 Lines | |||||
945 | int Workspace::packPositionDown(const AbstractClient *client, int oldY, bool bottomEdge) const | 945 | int Workspace::packPositionDown(const AbstractClient *client, int oldY, bool bottomEdge) const | ||
946 | { | 946 | { | ||
947 | int newY = clientArea(MaximizeArea, client).bottom(); | 947 | int newY = clientArea(MaximizeArea, client).bottom(); | ||
948 | if (oldY >= newY) { // try another Xinerama screen | 948 | if (oldY >= newY) { // try another Xinerama screen | ||
949 | newY = clientArea(MaximizeArea, | 949 | newY = clientArea(MaximizeArea, | ||
950 | QPoint(client->frameGeometry().center().x(), client->frameGeometry().bottom() + 1), client->desktop()).bottom(); | 950 | QPoint(client->frameGeometry().center().x(), client->frameGeometry().bottom() + 1), client->desktop()).bottom(); | ||
951 | } | 951 | } | ||
952 | if (client->titlebarPosition() != AbstractClient::PositionBottom) { | 952 | if (client->titlebarPosition() != AbstractClient::PositionBottom) { | ||
953 | const int bottom = newY + client->height() - (client->clientSize().height() + client->clientPos().y()); | 953 | const int bottom = newY + client->frameMargins().bottom(); | ||
954 | QRect frameGeometry = client->frameGeometry(); | 954 | QRect frameGeometry = client->frameGeometry(); | ||
955 | frameGeometry.moveBottom(bottom); | 955 | frameGeometry.moveBottom(bottom); | ||
956 | if (screens()->intersecting(frameGeometry) < 2) { | 956 | if (screens()->intersecting(frameGeometry) < 2) { | ||
957 | newY = bottom; | 957 | newY = bottom; | ||
958 | } | 958 | } | ||
959 | } | 959 | } | ||
960 | if (oldY >= newY) { | 960 | if (oldY >= newY) { | ||
961 | return oldY; | 961 | return oldY; | ||
Show All 19 Lines |