mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-15 06:59:43 -05:00
Merge pull request #641 from Ongy/idle-inhibit
Add idle-inhibit implementation
This commit is contained in:
commit
b7b86a9591
8 changed files with 480 additions and 0 deletions
|
|
@ -16,6 +16,10 @@
|
|||
#include <wlr/types/wlr_xcursor_manager.h>
|
||||
#include <wlr/types/wlr_xdg_shell_v6.h>
|
||||
#include <wlr/types/wlr_xdg_shell.h>
|
||||
#include <wlr/types/wlr_list.h>
|
||||
#include <wlr/types/wlr_idle.h>
|
||||
#include <wlr/types/wlr_idle_inhibit_v1.h>
|
||||
#include "rootston/view.h"
|
||||
#include "rootston/config.h"
|
||||
#include "rootston/output.h"
|
||||
#include "rootston/view.h"
|
||||
|
|
@ -41,6 +45,7 @@ struct roots_desktop {
|
|||
struct wlr_server_decoration_manager *server_decoration_manager;
|
||||
struct wlr_primary_selection_device_manager *primary_selection_device_manager;
|
||||
struct wlr_idle *idle;
|
||||
struct wlr_idle_inhibit_manager_v1 *idle_inhibit;
|
||||
|
||||
struct wl_listener new_output;
|
||||
struct wl_listener layout_change;
|
||||
|
|
|
|||
45
include/wlr/types/wlr_idle_inhibit_v1.h
Normal file
45
include/wlr/types/wlr_idle_inhibit_v1.h
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
#ifndef WLR_TYPES_WLR_IDLE_INHIBIT_V1_H
|
||||
#define WLR_TYPES_WLR_IDLE_INHIBIT_V1_H
|
||||
|
||||
#include <wayland-server.h>
|
||||
|
||||
/* This interface permits clients to inhibit the idle behavior such as
|
||||
* screenblanking, locking, and screensaving.
|
||||
*
|
||||
* This allows clients to ensure they stay visible instead of being hidden by
|
||||
* power-saving.
|
||||
*
|
||||
* Inhibitors are created for surfaces. They should only be in effect, while
|
||||
* this surface is visible.
|
||||
* The effect could also be limited to outputs it is displayed on (e.g.
|
||||
* dimm/dpms off outputs, except the one a video is displayed on).
|
||||
*/
|
||||
|
||||
struct wlr_idle_inhibit_manager_v1 {
|
||||
struct wl_list wl_resources; // wl_resource_get_link
|
||||
struct wl_list inhibitors; // wlr_idle_inhibit_inhibitor_v1::link
|
||||
struct wl_global *global;
|
||||
|
||||
struct wl_listener display_destroy;
|
||||
|
||||
struct {
|
||||
struct wl_signal new_inhibitor;
|
||||
} events;
|
||||
};
|
||||
|
||||
struct wlr_idle_inhibitor_v1 {
|
||||
struct wlr_surface *surface;
|
||||
struct wl_resource *resource;
|
||||
struct wl_listener surface_destroy;
|
||||
|
||||
struct wl_list link; // wlr_idle_inhibit_manager_v1::inhibitors;
|
||||
|
||||
struct {
|
||||
struct wl_signal destroy;
|
||||
} events;
|
||||
};
|
||||
|
||||
struct wlr_idle_inhibit_manager_v1 *wlr_idle_inhibit_v1_create(struct wl_display *display);
|
||||
void wlr_idle_inhibit_v1_destroy(struct wlr_idle_inhibit_manager_v1 *idle_inhibit);
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue