Changeset View
Changeset View
Standalone View
Standalone View
effects.cpp
Show First 20 Lines • Show All 926 Lines • ▼ Show 20 Line(s) | |||||
927 | 927 | | |||
928 | int EffectsHandlerImpl::desktopGridHeight() const | 928 | int EffectsHandlerImpl::desktopGridHeight() const | ||
929 | { | 929 | { | ||
930 | return desktopGridSize().height(); | 930 | return desktopGridSize().height(); | ||
931 | } | 931 | } | ||
932 | 932 | | |||
933 | int EffectsHandlerImpl::workspaceWidth() const | 933 | int EffectsHandlerImpl::workspaceWidth() const | ||
934 | { | 934 | { | ||
935 | return desktopGridWidth() * displayWidth(); | 935 | return desktopGridWidth() * screens()->size().width(); | ||
936 | } | 936 | } | ||
937 | 937 | | |||
938 | int EffectsHandlerImpl::workspaceHeight() const | 938 | int EffectsHandlerImpl::workspaceHeight() const | ||
939 | { | 939 | { | ||
940 | return desktopGridHeight() * displayHeight(); | 940 | return desktopGridHeight() * screens()->size().height(); | ||
941 | } | 941 | } | ||
942 | 942 | | |||
943 | int EffectsHandlerImpl::desktopAtCoords(QPoint coords) const | 943 | int EffectsHandlerImpl::desktopAtCoords(QPoint coords) const | ||
944 | { | 944 | { | ||
945 | if (auto vd = VirtualDesktopManager::self()->grid().at(coords)) { | 945 | if (auto vd = VirtualDesktopManager::self()->grid().at(coords)) { | ||
946 | return vd->x11DesktopNumber(); | 946 | return vd->x11DesktopNumber(); | ||
947 | } | 947 | } | ||
948 | return 0; | 948 | return 0; | ||
949 | } | 949 | } | ||
950 | 950 | | |||
951 | QPoint EffectsHandlerImpl::desktopGridCoords(int id) const | 951 | QPoint EffectsHandlerImpl::desktopGridCoords(int id) const | ||
952 | { | 952 | { | ||
953 | return VirtualDesktopManager::self()->grid().gridCoords(id); | 953 | return VirtualDesktopManager::self()->grid().gridCoords(id); | ||
954 | } | 954 | } | ||
955 | 955 | | |||
956 | QPoint EffectsHandlerImpl::desktopCoords(int id) const | 956 | QPoint EffectsHandlerImpl::desktopCoords(int id) const | ||
957 | { | 957 | { | ||
958 | QPoint coords = VirtualDesktopManager::self()->grid().gridCoords(id); | 958 | QPoint coords = VirtualDesktopManager::self()->grid().gridCoords(id); | ||
959 | if (coords.x() == -1) | 959 | if (coords.x() == -1) | ||
960 | return QPoint(-1, -1); | 960 | return QPoint(-1, -1); | ||
961 | return QPoint(coords.x() * displayWidth(), coords.y() * displayHeight()); | 961 | const QSize displaySize = screens()->size(); | ||
962 | return QPoint(coords.x() * displaySize.width(), coords.y() * displaySize.height()); | ||||
962 | } | 963 | } | ||
963 | 964 | | |||
964 | int EffectsHandlerImpl::desktopAbove(int desktop, bool wrap) const | 965 | int EffectsHandlerImpl::desktopAbove(int desktop, bool wrap) const | ||
965 | { | 966 | { | ||
966 | return getDesktop<DesktopAbove>(desktop, wrap); | 967 | return getDesktop<DesktopAbove>(desktop, wrap); | ||
967 | } | 968 | } | ||
968 | 969 | | |||
969 | int EffectsHandlerImpl::desktopToRight(int desktop, bool wrap) const | 970 | int EffectsHandlerImpl::desktopToRight(int desktop, bool wrap) const | ||
▲ Show 20 Lines • Show All 1125 Lines • Show Last 20 Lines |