mirror of
https://codeberg.org/dwl/dwl.git
synced 2026-04-06 07:15:31 -04:00
Implement the output power management protocol.
I thought wlr-randr used this, but it doesn't so I don't even know what this is for.
This commit is contained in:
parent
960c32a7d8
commit
8842479a1c
3 changed files with 148 additions and 1 deletions
16
dwl.c
16
dwl.c
|
|
@ -32,6 +32,7 @@
|
|||
#include <wlr/types/wlr_output.h>
|
||||
#include <wlr/types/wlr_output_layout.h>
|
||||
#include <wlr/types/wlr_output_management_v1.h>
|
||||
#include <wlr/types/wlr_output_power_management_v1.h>
|
||||
#include <wlr/types/wlr_pointer.h>
|
||||
#include <wlr/types/wlr_presentation_time.h>
|
||||
#include <wlr/types/wlr_primary_selection.h>
|
||||
|
|
@ -283,6 +284,7 @@ static void outputmgrtest(struct wl_listener *listener, void *data);
|
|||
static void pointerfocus(Client *c, struct wlr_surface *surface,
|
||||
double sx, double sy, uint32_t time);
|
||||
static void printstatus(void);
|
||||
static void powermgrsetmodenotify(struct wl_listener *listener, void *data);
|
||||
static void quit(const Arg *arg);
|
||||
static void rendermon(struct wl_listener *listener, void *data);
|
||||
static void requeststartdrag(struct wl_listener *listener, void *data);
|
||||
|
|
@ -356,6 +358,9 @@ static struct wlr_session_lock_manager_v1 *session_lock_mgr;
|
|||
static struct wlr_scene_rect *locked_bg;
|
||||
static struct wlr_session_lock_v1 *cur_lock;
|
||||
|
||||
static struct wlr_output_power_manager_v1 *power_mgr;
|
||||
static struct wl_listener power_mgr_set_mode = {.notify = powermgrsetmodenotify};
|
||||
|
||||
static struct wlr_seat *seat;
|
||||
static struct wl_list keyboards;
|
||||
static unsigned int cursor_mode;
|
||||
|
|
@ -1885,6 +1890,14 @@ printstatus(void)
|
|||
fflush(stdout);
|
||||
}
|
||||
|
||||
void
|
||||
powermgrsetmodenotify(struct wl_listener *listener, void *data)
|
||||
{
|
||||
struct wlr_output_power_v1_set_mode_event *event = data;
|
||||
wlr_output_enable(event->output, event->mode);
|
||||
wlr_output_commit(event->output);
|
||||
}
|
||||
|
||||
void
|
||||
quit(const Arg *arg)
|
||||
{
|
||||
|
|
@ -2192,6 +2205,9 @@ setup(void)
|
|||
activation = wlr_xdg_activation_v1_create(dpy);
|
||||
wl_signal_add(&activation->events.request_activate, &request_activate);
|
||||
|
||||
power_mgr = wlr_output_power_manager_v1_create(dpy);
|
||||
wl_signal_add(&power_mgr->events.set_mode, &power_mgr_set_mode);
|
||||
|
||||
/* Creates an output layout, which a wlroots utility for working with an
|
||||
* arrangement of screens in a physical layout. */
|
||||
output_layout = wlr_output_layout_create();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue