kwin/plugins/platforms/x11/standalone/x11placeholderoutput.cpp
Vlad Zahorodnii 8a606e47c4 platforms/x11: Introduce X11PlaceholderOutput
It is useful in case the Xrandr extension is unavailable or no outputs
are connected.
2020-12-21 09:20:16 +00:00

42 lines
787 B
C++

/*
SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "x11placeholderoutput.h"
#include "main.h"
namespace KWin
{
X11PlaceholderOutput::X11PlaceholderOutput(QObject *parent)
: AbstractOutput(parent)
{
}
QString X11PlaceholderOutput::name() const
{
return QStringLiteral("Placeholder-0");
}
QRect X11PlaceholderOutput::geometry() const
{
xcb_screen_t *screen = kwinApp()->x11DefaultScreen();
if (screen) {
return QRect(0, 0, screen->width_in_pixels, screen->height_in_pixels);
}
return QRect();
}
int X11PlaceholderOutput::refreshRate() const
{
return 60000;
}
QSize X11PlaceholderOutput::pixelSize() const
{
return geometry().size();
}
} // namespace KWin