Changeset View
Changeset View
Standalone View
Standalone View
abstract_output.cpp
Show All 15 Lines | |||||
16 | 16 | | |||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | #include "abstract_output.h" | 20 | #include "abstract_output.h" | ||
21 | #include "wayland_server.h" | 21 | #include "wayland_server.h" | ||
22 | 22 | | |||
23 | // KWayland | 23 | // KWayland | ||
24 | #include <KWayland/Server/display.h> | ||||
24 | #include <KWayland/Server/output_interface.h> | 25 | #include <KWayland/Server/output_interface.h> | ||
25 | #include <KWayland/Server/outputchangeset.h> | 26 | #include <KWayland/Server/outputchangeset.h> | ||
26 | #include <KWayland/Server/outputdevice_interface.h> | 27 | #include <KWayland/Server/outputdevice_interface.h> | ||
27 | #include <KWayland/Server/xdgoutput_interface.h> | 28 | #include <KWayland/Server/xdgoutput_interface.h> | ||
28 | // KF5 | 29 | // KF5 | ||
29 | #include <KLocalizedString> | 30 | #include <KLocalizedString> | ||
30 | 31 | | |||
31 | #include <cmath> | 32 | #include <cmath> | ||
▲ Show 20 Lines • Show All 90 Lines • ▼ Show 20 Line(s) | 119 | { | |||
122 | m_xdgOutput = waylandServer()->xdgOutputManager()->createXdgOutput(m_waylandOutput, m_waylandOutput); | 123 | m_xdgOutput = waylandServer()->xdgOutputManager()->createXdgOutput(m_waylandOutput, m_waylandOutput); | ||
123 | } | 124 | } | ||
124 | 125 | | |||
125 | void AbstractOutput::setWaylandOutputDevice(KWayland::Server::OutputDeviceInterface *set) | 126 | void AbstractOutput::setWaylandOutputDevice(KWayland::Server::OutputDeviceInterface *set) | ||
126 | { | 127 | { | ||
127 | m_waylandOutputDevice = set; | 128 | m_waylandOutputDevice = set; | ||
128 | } | 129 | } | ||
129 | 130 | | |||
131 | void AbstractOutput::initWaylandOutput() | ||||
132 | { | ||||
133 | Q_ASSERT(m_waylandOutputDevice); | ||||
134 | | ||||
135 | if (!m_waylandOutput.isNull()) { | ||||
136 | delete m_waylandOutput.data(); | ||||
137 | m_waylandOutput.clear(); | ||||
138 | } | ||||
139 | m_waylandOutput = waylandServer()->display()->createOutput(); | ||||
140 | setWaylandOutput(m_waylandOutput.data()); | ||||
davidedmundson: this does nothing, I think setWaylandOutput can be killed completely | |||||
141 | createXdgOutput(); | ||||
142 | | ||||
143 | m_waylandOutput->setManufacturer(m_waylandOutputDevice->manufacturer()); | ||||
144 | m_waylandOutput->setModel(m_waylandOutputDevice->model()); | ||||
145 | m_waylandOutput->setPhysicalSize(rawPhysicalSize()); | ||||
146 | | ||||
davidedmundson: 2 newlines | |||||
147 | | ||||
148 | for(const auto &mode: m_waylandOutputDevice->modes()) { | ||||
149 | KWayland::Server::OutputInterface::ModeFlags flags; | ||||
150 | if (mode.flags & KWayland::Server::OutputDeviceInterface::ModeFlag::Current) { | ||||
151 | flags |= KWayland::Server::OutputInterface::ModeFlag::Current; | ||||
152 | } | ||||
153 | if (mode.flags & KWayland::Server::OutputDeviceInterface::ModeFlag::Preferred) { | ||||
154 | flags |= KWayland::Server::OutputInterface::ModeFlag::Preferred; | ||||
155 | } | ||||
156 | m_waylandOutput->addMode(mode.size, flags, mode.refreshRate); | ||||
157 | } | ||||
158 | m_waylandOutput->create(); | ||||
159 | } | ||||
160 | | ||||
130 | } | 161 | } |
this does nothing, I think setWaylandOutput can be killed completely