Changeset View
Changeset View
Standalone View
Standalone View
screenedge.cpp
Show First 20 Lines • Show All 710 Lines • ▼ Show 20 Line(s) | |||||
711 | KWIN_SINGLETON_FACTORY(ScreenEdges) | 711 | KWIN_SINGLETON_FACTORY(ScreenEdges) | ||
712 | 712 | | |||
713 | ScreenEdges::ScreenEdges(QObject *parent) | 713 | ScreenEdges::ScreenEdges(QObject *parent) | ||
714 | : QObject(parent) | 714 | : QObject(parent) | ||
715 | , m_desktopSwitching(false) | 715 | , m_desktopSwitching(false) | ||
716 | , m_desktopSwitchingMovingClients(false) | 716 | , m_desktopSwitchingMovingClients(false) | ||
717 | , m_timeThreshold(0) | 717 | , m_timeThreshold(0) | ||
718 | , m_reactivateThreshold(0) | 718 | , m_reactivateThreshold(0) | ||
719 | , m_virtualDesktopLayout(0) | 719 | , m_virtualDesktopLayout(nullptr) | ||
720 | , m_actionTopLeft(ElectricActionNone) | 720 | , m_actionTopLeft(ElectricActionNone) | ||
721 | , m_actionTop(ElectricActionNone) | 721 | , m_actionTop(ElectricActionNone) | ||
722 | , m_actionTopRight(ElectricActionNone) | 722 | , m_actionTopRight(ElectricActionNone) | ||
723 | , m_actionRight(ElectricActionNone) | 723 | , m_actionRight(ElectricActionNone) | ||
724 | , m_actionBottomRight(ElectricActionNone) | 724 | , m_actionBottomRight(ElectricActionNone) | ||
725 | , m_actionBottom(ElectricActionNone) | 725 | , m_actionBottom(ElectricActionNone) | ||
726 | , m_actionBottomLeft(ElectricActionNone) | 726 | , m_actionBottomLeft(ElectricActionNone) | ||
727 | , m_actionLeft(ElectricActionNone) | 727 | , m_actionLeft(ElectricActionNone) | ||
728 | , m_gestureRecognizer(new GestureRecognizer(this)) | 728 | , m_gestureRecognizer(new GestureRecognizer(this)) | ||
729 | { | 729 | { | ||
730 | QWidget w; | 730 | QWidget w; | ||
731 | m_cornerOffset = (w.physicalDpiX() + w.physicalDpiY() + 5) / 6; | 731 | m_cornerOffset = (w.physicalDpiX() + w.physicalDpiY() + 5) / 6; | ||
732 | 732 | | |||
733 | connect(workspace(), &Workspace::clientRemoved, this, &ScreenEdges::deleteEdgeForClient); | 733 | connect(workspace(), &Workspace::clientRemoved, this, &ScreenEdges::deleteEdgeForClient); | ||
734 | } | 734 | } | ||
735 | 735 | | |||
736 | ScreenEdges::~ScreenEdges() | 736 | ScreenEdges::~ScreenEdges() | ||
737 | { | 737 | { | ||
738 | s_self = NULL; | 738 | s_self = nullptr; | ||
739 | } | 739 | } | ||
740 | 740 | | |||
741 | void ScreenEdges::init() | 741 | void ScreenEdges::init() | ||
742 | { | 742 | { | ||
743 | reconfigure(); | 743 | reconfigure(); | ||
744 | updateLayout(); | 744 | updateLayout(); | ||
745 | recreateEdges(); | 745 | recreateEdges(); | ||
746 | } | 746 | } | ||
▲ Show 20 Lines • Show All 128 Lines • ▼ Show 20 Line(s) | 874 | if ((*it)->border() == border) { | |||
875 | (*it)->setTouchAction(newValue); | 875 | (*it)->setTouchAction(newValue); | ||
876 | } | 876 | } | ||
877 | } | 877 | } | ||
878 | } | 878 | } | ||
879 | 879 | | |||
880 | void ScreenEdges::updateLayout() | 880 | void ScreenEdges::updateLayout() | ||
881 | { | 881 | { | ||
882 | const QSize desktopMatrix = VirtualDesktopManager::self()->grid().size(); | 882 | const QSize desktopMatrix = VirtualDesktopManager::self()->grid().size(); | ||
883 | Qt::Orientations newLayout = 0; | 883 | Qt::Orientations newLayout = nullptr; | ||
884 | if (desktopMatrix.width() > 1) { | 884 | if (desktopMatrix.width() > 1) { | ||
885 | newLayout |= Qt::Horizontal; | 885 | newLayout |= Qt::Horizontal; | ||
886 | } | 886 | } | ||
887 | if (desktopMatrix.height() > 1) { | 887 | if (desktopMatrix.height() > 1) { | ||
888 | newLayout |= Qt::Vertical; | 888 | newLayout |= Qt::Vertical; | ||
889 | } | 889 | } | ||
890 | if (newLayout == m_virtualDesktopLayout) { | 890 | if (newLayout == m_virtualDesktopLayout) { | ||
891 | return; | 891 | return; | ||
▲ Show 20 Lines • Show All 604 Lines • Show Last 20 Lines |