# Changeset View

Changeset View

# Standalone View

Standalone View

# abstract_output.cpp

Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | 48 | { | |||
---|---|---|---|---|---|

49 | if (!m_waylandOutput) { | 49 | if (!m_waylandOutput) { | ||

50 | return i18n("unknown"); | 50 | return i18n("unknown"); | ||

51 | } | 51 | } | ||

52 | return QStringLiteral("%1 %2").arg(m_waylandOutput->manufacturer()).arg(m_waylandOutput->model()); | 52 | return QStringLiteral("%1 %2").arg(m_waylandOutput->manufacturer()).arg(m_waylandOutput->model()); | ||

53 | } | 53 | } | ||

54 | 54 | | |||

55 | QRect AbstractOutput::geometry() const | 55 | QRect AbstractOutput::geometry() const | ||

56 | { | 56 | { | ||

57 | return QRect(m_globalPos, pixelSize() / scale()); | 57 | return QRect(m_globalPos, orientateSize(pixelSize()) / scale()); | ||

58 | } | 58 | } | ||

59 | 59 | | |||

60 | QSize AbstractOutput::physicalSize() const | 60 | QSize AbstractOutput::physicalSize() const | ||

61 | { | 61 | { | ||

62 | return orientateSize(m_physicalSize); | 62 | return orientateSize(m_physicalSize); | ||

63 | } | 63 | } | ||

64 | 64 | | |||

65 | int AbstractOutput::refreshRate() const | 65 | int AbstractOutput::refreshRate() const | ||

Show All 30 Lines | 91 | if (m_waylandOutput) { | |||

96 | // or maybe even set this to 3 when we're scaling to 1.5 | 96 | // or maybe even set this to 3 when we're scaling to 1.5 | ||

97 | // don't treat this like it's chosen deliberately | 97 | // don't treat this like it's chosen deliberately | ||

98 | m_waylandOutput->setScale(std::ceil(scale)); | 98 | m_waylandOutput->setScale(std::ceil(scale)); | ||

99 | } | 99 | } | ||

100 | if (m_waylandOutputDevice) { | 100 | if (m_waylandOutputDevice) { | ||

101 | m_waylandOutputDevice->setScaleF(scale); | 101 | m_waylandOutputDevice->setScaleF(scale); | ||

102 | } | 102 | } | ||

103 | if (m_xdgOutput) { | 103 | if (m_xdgOutput) { | ||

104 | m_xdgOutput->setLogicalSize(pixelSize() / m_scale); | 104 | m_xdgOutput->setLogicalSize(orientateSize(pixelSize()) / m_scale); | ||

105 | m_xdgOutput->done(); | 105 | m_xdgOutput->done(); | ||

106 | } | 106 | } | ||

107 | emit modeChanged(); | 107 | emit modeChanged(); | ||

108 | } | 108 | } | ||

109 | 109 | | |||

110 | void AbstractOutput::setChanges(KWayland::Server::OutputChangeSet *changes) | 110 | void AbstractOutput::setChanges(KWayland::Server::OutputChangeSet *changes) | ||

111 | { | 111 | { | ||

112 | qCDebug(KWIN_CORE) << "Set changes in AbstractOutput."; | 112 | qCDebug(KWIN_CORE) << "Set changes in AbstractOutput."; | ||

▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | |||||

155 | 155 | | |||

156 | void AbstractOutput::setWaylandMode(const QSize &size, int refreshRate) | 156 | void AbstractOutput::setWaylandMode(const QSize &size, int refreshRate) | ||

157 | { | 157 | { | ||

158 | if (m_waylandOutput.isNull()) { | 158 | if (m_waylandOutput.isNull()) { | ||

159 | return; | 159 | return; | ||

160 | } | 160 | } | ||

161 | m_waylandOutput->setCurrentMode(size, refreshRate); | 161 | m_waylandOutput->setCurrentMode(size, refreshRate); | ||

162 | if (m_xdgOutput) { | 162 | if (m_xdgOutput) { | ||

163 | m_xdgOutput->setLogicalSize(pixelSize() / scale()); | 163 | m_xdgOutput->setLogicalSize(orientateSize(pixelSize()) / scale()); | ||

164 | m_xdgOutput->done(); | 164 | m_xdgOutput->done(); | ||

165 | } | 165 | } | ||

166 | } | 166 | } | ||

167 | 167 | | |||

168 | void AbstractOutput::createXdgOutput() | 168 | void AbstractOutput::createXdgOutput() | ||

169 | { | 169 | { | ||

170 | if (!m_waylandOutput || m_xdgOutput) { | 170 | if (!m_waylandOutput || m_xdgOutput) { | ||

171 | return; | 171 | return; | ||

▲ Show 20 Lines • Show All 88 Lines • Show Last 20 Lines |