mirror of
https://github.com/theCheeseboard/libtdesktopenvironment.git
synced 2025-01-22 10:22:02 -05:00
Initial gamma control support
This commit is contained in:
parent
c7362233b4
commit
bd03fe54cc
5 changed files with 13 additions and 5 deletions
|
@ -46,6 +46,7 @@ target_sources(plugin-${PLUGIN_NAME} PRIVATE ${SOURCES} ${HEADERS})
|
|||
wayland-protocols/tdesktopenvironment-protocols/tdesktopenvironment-keygrab-v1.xml
|
||||
wayland-protocols/tdesktopenvironment-protocols/tdesktopenvironment-accessibility-v1.xml
|
||||
wayland-protocols/wlr-protocols/unstable/wlr-output-management-unstable-v1.xml
|
||||
wayland-protocols/wlr-protocols/unstable/wlr-gamma-control-unstable-v1.xml
|
||||
)
|
||||
install(DIRECTORY wayland-protocols/tdesktopenvironment-protocols
|
||||
DESTINATION ${CMAKE_INSTALL_DATADIR}/libtdesktopenvironment/wayland-protocols
|
||||
|
|
|
@ -251,19 +251,19 @@ QScreen* WaylandScreen::qtScreen() const {
|
|||
}
|
||||
|
||||
void WaylandScreen::set() {
|
||||
auto config = zwlr_output_manager_v1_create_configuration(d->backend->object(), d->backend->serial());
|
||||
auto config = zwlr_output_manager_v1_create_configuration(d->backend->QtWayland::zwlr_output_manager_v1::object(), d->backend->serial());
|
||||
|
||||
for (auto systemScreen : d->backend->screens()) {
|
||||
auto screen = qobject_cast<WaylandScreen*>(systemScreen);
|
||||
auto screenProperties = screen->d;
|
||||
|
||||
if (screen->d->powered) {
|
||||
auto configHead = zwlr_output_configuration_v1_enable_head(config, screen->object());
|
||||
auto configHead = zwlr_output_configuration_v1_enable_head(config, screen->QtWayland::zwlr_output_head_v1::object());
|
||||
zwlr_output_configuration_head_v1_set_mode(configHead, screenProperties->modes.at(screenProperties->currentMode)->object());
|
||||
zwlr_output_configuration_head_v1_set_position(configHead, screenProperties->position.x(), screenProperties->position.y());
|
||||
zwlr_output_configuration_head_v1_set_transform(configHead, screenProperties->transform);
|
||||
} else {
|
||||
zwlr_output_configuration_v1_disable_head(config, screen->object());
|
||||
zwlr_output_configuration_v1_disable_head(config, screen->QtWayland::zwlr_output_head_v1::object());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,12 +21,14 @@
|
|||
#define WAYLANDSCREEN_H
|
||||
|
||||
#include "Screens/systemscreen.h"
|
||||
#include "qwayland-wlr-gamma-control-unstable-v1.h"
|
||||
#include "qwayland-wlr-output-management-unstable-v1.h"
|
||||
|
||||
class WaylandScreenBackend;
|
||||
struct WaylandScreenPrivate;
|
||||
class WaylandScreen : public SystemScreen,
|
||||
public QtWayland::zwlr_output_head_v1 {
|
||||
public QtWayland::zwlr_output_head_v1,
|
||||
public QtWayland::zwlr_gamma_control_v1 {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit WaylandScreen(::zwlr_output_head_v1* head, WaylandScreenBackend* backend);
|
||||
|
|
|
@ -39,6 +39,9 @@ WaylandScreenBackend::WaylandScreenBackend() :
|
|||
if (!d->registry.init<QtWayland::zwlr_output_manager_v1>(this)) {
|
||||
tWarn("WaylandScreenBackend") << "The compositor doesn't support the wlr-output-management protocol";
|
||||
}
|
||||
if (!d->registry.init<QtWayland::zwlr_gamma_control_manager_v1>(this)) {
|
||||
tWarn("WaylandScreenBackend") << "The compositor doesn't support the wlr-gamma-control protocol";
|
||||
}
|
||||
|
||||
auto display = reinterpret_cast<wl_display*>(qApp->platformNativeInterface()->nativeResourceForIntegration("display"));
|
||||
wl_display_roundtrip(display);
|
||||
|
|
|
@ -21,12 +21,14 @@
|
|||
#define WAYLANDSCREENBACKEND_H
|
||||
|
||||
#include "Screens/private/screenbackend.h"
|
||||
#include "qwayland-wlr-gamma-control-unstable-v1.h"
|
||||
#include "qwayland-wlr-output-management-unstable-v1.h"
|
||||
#include <QObject>
|
||||
|
||||
struct WaylandScreenBackendPrivate;
|
||||
class WaylandScreenBackend : public ScreenBackend,
|
||||
public QtWayland::zwlr_output_manager_v1 {
|
||||
public QtWayland::zwlr_output_manager_v1,
|
||||
public QtWayland::zwlr_gamma_control_manager_v1 {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit WaylandScreenBackend();
|
||||
|
|
Loading…
Reference in a new issue