DrmOutput creates OutputInterface on init
This automatically announces the OutputInterface when it gets created and removes it when it gets destroyed again.
This commit is contained in:
parent
603844cf98
commit
389d81731b
2 changed files with 18 additions and 0 deletions
|
@ -26,9 +26,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "udev.h"
|
||||
#include "utils.h"
|
||||
#include "virtual_terminal.h"
|
||||
#include "wayland_server.h"
|
||||
#if HAVE_GBM
|
||||
#include "egl_gbm_backend.h"
|
||||
#endif
|
||||
// KWayland
|
||||
#include <KWayland/Server/display.h>
|
||||
#include <KWayland/Server/output_interface.h>
|
||||
// Qt
|
||||
#include <QSocketNotifier>
|
||||
#include <QPainter>
|
||||
|
@ -61,6 +65,7 @@ DrmBackend::DrmBackend(QObject *parent)
|
|||
, m_udev(new Udev)
|
||||
, m_udevMonitor(m_udev->monitor())
|
||||
{
|
||||
handleOutputs();
|
||||
m_cursor[0] = nullptr;
|
||||
m_cursor[1] = nullptr;
|
||||
}
|
||||
|
@ -596,6 +601,10 @@ void DrmOutput::init()
|
|||
{
|
||||
m_savedCrtc.reset(drmModeGetCrtc(m_backend->fd(), m_crtcId));
|
||||
blank();
|
||||
m_waylandOutput.reset(waylandServer()->display()->createOutput());
|
||||
m_waylandOutput->setPhysicalSize(size() / 3.8);
|
||||
m_waylandOutput->addMode(size());
|
||||
m_waylandOutput->create();
|
||||
}
|
||||
|
||||
void DrmOutput::blank()
|
||||
|
|
|
@ -28,6 +28,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
struct gbm_bo;
|
||||
struct gbm_surface;
|
||||
|
||||
namespace KWayland
|
||||
{
|
||||
namespace Server
|
||||
{
|
||||
class OutputInterface;
|
||||
}
|
||||
}
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
|
@ -135,6 +143,7 @@ private:
|
|||
}
|
||||
};
|
||||
QScopedPointer<_drmModeCrtc, CrtcCleanup> m_savedCrtc;
|
||||
QScopedPointer<KWayland::Server::OutputInterface> m_waylandOutput;
|
||||
};
|
||||
|
||||
class DrmBuffer
|
||||
|
|
Loading…
Reference in a new issue