mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-12-22 18:09:49 +01:00
idle-inhibit: style adjustments and motivation
This commit is contained in:
parent
87a7afb641
commit
67285c1d57
3 changed files with 23 additions and 11 deletions
|
@ -68,41 +68,41 @@ static void pointer_handle_button(void *data, struct wl_pointer *pointer, uint32
|
|||
static void pointer_handle_enter(void *data, struct wl_pointer *wl_pointer,
|
||||
uint32_t serial, struct wl_surface *surface,
|
||||
wl_fixed_t surface_x, wl_fixed_t surface_y) {
|
||||
/* NOOP: ignore event */
|
||||
// This space intentionally left blank
|
||||
}
|
||||
|
||||
static void pointer_handle_leave(void *data, struct wl_pointer *wl_pointer,
|
||||
uint32_t serial, struct wl_surface *surface) {
|
||||
/* NOOP: ignore event */
|
||||
// This space intentionally left blank
|
||||
}
|
||||
|
||||
static void pointer_handle_motion(void *data, struct wl_pointer *wl_pointer,
|
||||
uint32_t time, wl_fixed_t surface_x, wl_fixed_t surface_y) {
|
||||
/* NOOP: ignore event */
|
||||
// This space intentionally left blank
|
||||
}
|
||||
|
||||
static void pointer_handle_axis(void *data, struct wl_pointer *wl_pointer,
|
||||
uint32_t time, uint32_t axis, wl_fixed_t value) {
|
||||
/* NOOP: ignore event */
|
||||
// This space intentionally left blank
|
||||
}
|
||||
|
||||
static void pointer_handle_frame(void *data, struct wl_pointer *wl_pointer) {
|
||||
/* NOOP: ignore event */
|
||||
// This space intentionally left blank
|
||||
}
|
||||
|
||||
static void pointer_handle_axis_source(void *data,
|
||||
struct wl_pointer *wl_pointer, uint32_t axis_source) {
|
||||
/* NOOP: ignore event */
|
||||
// This space intentionally left blank
|
||||
}
|
||||
|
||||
static void pointer_handle_axis_stop(void *data,
|
||||
struct wl_pointer *wl_pointer, uint32_t time, uint32_t axis) {
|
||||
/* NOOP: ignore event */
|
||||
// This space intentionally left blank
|
||||
}
|
||||
|
||||
static void pointer_handle_axis_discrete(void *data,
|
||||
struct wl_pointer *wl_pointer, uint32_t axis, int32_t discrete) {
|
||||
/* NOOP: ignore event */
|
||||
// This space intentionally left blank
|
||||
}
|
||||
|
||||
static const struct wl_pointer_listener pointer_listener = {
|
||||
|
@ -225,7 +225,7 @@ int main(int argc, char **argv) {
|
|||
draw();
|
||||
|
||||
while (wl_display_dispatch(display) != -1) {
|
||||
/** Do Nothing */
|
||||
// This space intentionally left blank
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
|
|
|
@ -3,6 +3,18 @@
|
|||
|
||||
#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
|
||||
|
|
|
@ -12,14 +12,14 @@ static struct zwp_idle_inhibit_manager_v1_interface idle_inhibit_impl;
|
|||
|
||||
static struct zwp_idle_inhibitor_v1_interface idle_inhibitor_impl;
|
||||
|
||||
struct wlr_idle_inhibit_manager_v1 *
|
||||
static struct wlr_idle_inhibit_manager_v1 *
|
||||
wlr_idle_inhibit_manager_v1_from_resource(struct wl_resource *resource) {
|
||||
assert(wl_resource_instance_of(resource, &zwp_idle_inhibit_manager_v1_interface,
|
||||
&idle_inhibit_impl));
|
||||
return wl_resource_get_user_data(resource);
|
||||
}
|
||||
|
||||
struct wlr_idle_inhibitor_v1 *
|
||||
static struct wlr_idle_inhibitor_v1 *
|
||||
wlr_idle_inhibitor_v1_from_resource(struct wl_resource *resource) {
|
||||
assert(wl_resource_instance_of(resource, &zwp_idle_inhibitor_v1_interface,
|
||||
&idle_inhibitor_impl));
|
||||
|
|
Loading…
Reference in a new issue