cage/output.h
Clayton Craft 7e44e3c832
cage: add support for wlr-output-power-management
This implements the zwlr_output_power_management_v1 protocol, which
allow clients such as swayidle to toggle display power state. Outputs
are intentionally not removed per the discussion in #245.

A dpms_powered_off flag is tracked on each output to prevent a DPMS "on"
request from re-enabling an output that was disabled via wlr-output-management
rather than DPMS.

The protocol generation/dep additions is heavily inspired by swaywm

Fixes #245
2026-06-08 14:18:52 -07:00

32 lines
921 B
C

#ifndef CG_OUTPUT_H
#define CG_OUTPUT_H
#include <wayland-server-core.h>
#include <wlr/types/wlr_output.h>
#include "server.h"
#include "view.h"
struct cg_output {
struct cg_server *server;
struct wlr_output *wlr_output;
struct wlr_scene_output *scene_output;
struct wl_listener commit;
struct wl_listener request_state;
struct wl_listener destroy;
struct wl_listener frame;
struct wl_list link; // cg_server::outputs
bool dpms_powered_off;
};
void handle_output_manager_apply(struct wl_listener *listener, void *data);
void handle_output_manager_test(struct wl_listener *listener, void *data);
void handle_output_layout_change(struct wl_listener *listener, void *data);
void handle_new_output(struct wl_listener *listener, void *data);
void output_set_window_title(struct cg_output *output, const char *title);
void handle_output_power_manager_set_mode(struct wl_listener *listener, void *data);
#endif