wayland: implement wl_fixes

wilder/Plasma/6.3
Joaquim Monteiro 1 year ago committed by Vlad Zahorodnii
parent efcde5788e
commit b7c74cec41
  1. 5
      CMakeLists.txt
  2. 1
      src/config-kwin.h.cmake
  3. 1
      src/wayland/CMakeLists.txt
  4. 56
      src/wayland/fixes.cpp
  5. 36
      src/wayland/fixes.h
  6. 4
      src/wayland_server.cpp

@ -207,6 +207,11 @@ if (Wayland_VERSION VERSION_GREATER_EQUAL 1.23)
else()
set(HAVE_WL_DISPLAY_SET_DEFAULT_MAX_BUFFER_SIZE 0)
endif()
if (Wayland_VERSION VERSION_GREATER_EQUAL 1.23.90)
set(HAVE_WL_FIXES 1)
else()
set(HAVE_WL_FIXES 0)
endif()
find_package(WaylandProtocols 1.38)
set_package_properties(WaylandProtocols PROPERTIES

@ -31,5 +31,6 @@ constexpr QLatin1String BREEZE_KDECORATION_PLUGIN_ID("${BREEZE_KDECORATION_PLUGI
#cmakedefine01 HAVE_GLX
#cmakedefine01 HAVE_DL_LIBRARY
#cmakedefine01 HAVE_WL_DISPLAY_SET_DEFAULT_MAX_BUFFER_SIZE
#cmakedefine01 HAVE_WL_FIXES
constexpr QLatin1String XWAYLAND_SESSION_SCRIPTS("${XWAYLAND_SESSION_SCRIPTS}");

@ -339,6 +339,7 @@ target_sources(kwin PRIVATE
drmlease_v1.cpp
externalbrightness_v1.cpp
filtered_display.cpp
fixes.cpp
fractionalscale_v1.cpp
frog_colormanagement_v1.cpp
idle.cpp

@ -0,0 +1,56 @@
/*
SPDX-FileCopyrightText: 2024 Joaquim Monteiro <joaquim.monteiro@protonmail.com>
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#include "fixes.h"
#include "config-kwin.h"
#if HAVE_WL_FIXES
#include "display.h"
#include "qwayland-server-wayland.h"
namespace KWin
{
static constexpr int s_version = 1;
class FixesInterfacePrivate : public QtWaylandServer::wl_fixes
{
public:
FixesInterfacePrivate(Display *display);
protected:
void fixes_destroy(Resource *resource) override;
void fixes_destroy_registry(Resource *resource, struct ::wl_resource *registry) override;
};
FixesInterfacePrivate::FixesInterfacePrivate(Display *display)
: QtWaylandServer::wl_fixes(*display, s_version)
{
}
void FixesInterfacePrivate::fixes_destroy(Resource *resource)
{
wl_resource_destroy(resource->handle);
}
void FixesInterfacePrivate::fixes_destroy_registry(Resource *resource, struct ::wl_resource *registry)
{
wl_resource_destroy(registry);
}
FixesInterface::FixesInterface(Display *display, QObject *parent)
: QObject(parent)
, d{std::make_unique<FixesInterfacePrivate>(display)}
{
}
FixesInterface::~FixesInterface()
{
}
} // namespace KWin
#endif // HAVE_WL_FIXES

@ -0,0 +1,36 @@
/*
SPDX-FileCopyrightText: 2024 Joaquim Monteiro <joaquim.monteiro@protonmail.com>
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
*/
#pragma once
#include "config-kwin.h"
#if HAVE_WL_FIXES
#include "kwin_export.h"
#include <QObject>
namespace KWin
{
class Display;
class FixesInterfacePrivate;
class KWIN_EXPORT FixesInterface : public QObject
{
Q_OBJECT
public:
explicit FixesInterface(Display *display, QObject *parent = nullptr);
~FixesInterface() override;
private:
std::unique_ptr<FixesInterfacePrivate> d;
};
} // namespace KWin
#endif // HAVE_WL_FIXES

@ -38,6 +38,7 @@
#include "wayland/drmlease_v1.h"
#include "wayland/externalbrightness_v1.h"
#include "wayland/filtered_display.h"
#include "wayland/fixes.h"
#include "wayland/fractionalscale_v1.h"
#include "wayland/frog_colormanagement_v1.h"
#include "wayland/idle.h"
@ -506,6 +507,9 @@ bool WaylandServer::init()
m_externalBrightness = new ExternalBrightnessV1(m_display, m_display);
m_alphaModifierManager = new AlphaModifierManagerV1(m_display, m_display);
#if HAVE_WL_FIXES
new FixesInterface(m_display, m_display);
#endif
return true;
}

Loading…
Cancel
Save