Changeset View
Changeset View
Standalone View
Standalone View
screens.cpp
Show All 26 Lines | |||||
27 | #include <workspace.h> | 27 | #include <workspace.h> | ||
28 | #include <config-kwin.h> | 28 | #include <config-kwin.h> | ||
29 | #include "platform.h" | 29 | #include "platform.h" | ||
30 | #include "wayland_server.h" | 30 | #include "wayland_server.h" | ||
31 | #ifdef KWIN_UNIT_TEST | 31 | #ifdef KWIN_UNIT_TEST | ||
32 | #include <mock_screens.h> | 32 | #include <mock_screens.h> | ||
33 | #endif | 33 | #endif | ||
34 | 34 | | |||
35 | #include <cmath> | ||||
36 | | ||||
35 | namespace KWin | 37 | namespace KWin | ||
36 | { | 38 | { | ||
37 | 39 | | |||
38 | Screens *Screens::s_self = nullptr; | 40 | Screens *Screens::s_self = nullptr; | ||
39 | Screens *Screens::create(QObject *parent) | 41 | Screens *Screens::create(QObject *parent) | ||
40 | { | 42 | { | ||
41 | Q_ASSERT(!s_self); | 43 | Q_ASSERT(!s_self); | ||
42 | #ifdef KWIN_UNIT_TEST | 44 | #ifdef KWIN_UNIT_TEST | ||
▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | 133 | { | |||
134 | for (int i = 0; i < count(); ++i) { | 136 | for (int i = 0; i < count(); ++i) { | ||
135 | bounding = bounding.united(geometry(i)); | 137 | bounding = bounding.united(geometry(i)); | ||
136 | maxScale = qMax(maxScale, scale(i)); | 138 | maxScale = qMax(maxScale, scale(i)); | ||
137 | } | 139 | } | ||
138 | if (m_boundingSize != bounding.size()) { | 140 | if (m_boundingSize != bounding.size()) { | ||
139 | m_boundingSize = bounding.size(); | 141 | m_boundingSize = bounding.size(); | ||
140 | emit sizeChanged(); | 142 | emit sizeChanged(); | ||
141 | } | 143 | } | ||
144 | kwinApp()->setX11Scale(std::ceil(maxScale - 0.05)); | ||||
142 | if (!qFuzzyCompare(m_maxScale, maxScale)) { | 145 | if (!qFuzzyCompare(m_maxScale, maxScale)) { | ||
143 | m_maxScale = maxScale; | 146 | m_maxScale = maxScale; | ||
144 | emit maxScaleChanged(); | 147 | emit maxScaleChanged(); | ||
145 | } | 148 | } | ||
146 | } | 149 | } | ||
147 | 150 | | |||
148 | void Screens::setCount(int count) | 151 | void Screens::setCount(int count) | ||
149 | { | 152 | { | ||
▲ Show 20 Lines • Show All 100 Lines • Show Last 20 Lines |