mirror of
https://github.com/labwc/labwc.git
synced 2026-03-05 01:40:24 -05:00
parent
e4399b03e2
commit
0fb33066e9
3 changed files with 31 additions and 0 deletions
|
|
@ -26,6 +26,7 @@
|
||||||
#include <wlr/types/wlr_output.h>
|
#include <wlr/types/wlr_output.h>
|
||||||
#include <wlr/types/wlr_output_damage.h>
|
#include <wlr/types/wlr_output_damage.h>
|
||||||
#include <wlr/types/wlr_output_management_v1.h>
|
#include <wlr/types/wlr_output_management_v1.h>
|
||||||
|
#include <wlr/types/wlr_output_power_management_v1.h>
|
||||||
#include <wlr/types/wlr_output_layout.h>
|
#include <wlr/types/wlr_output_layout.h>
|
||||||
#include <wlr/types/wlr_relative_pointer_v1.h>
|
#include <wlr/types/wlr_relative_pointer_v1.h>
|
||||||
#include <wlr/types/wlr_pointer.h>
|
#include <wlr/types/wlr_pointer.h>
|
||||||
|
|
@ -171,6 +172,9 @@ struct server {
|
||||||
|
|
||||||
struct wlr_foreign_toplevel_manager_v1 *foreign_toplevel_manager;
|
struct wlr_foreign_toplevel_manager_v1 *foreign_toplevel_manager;
|
||||||
|
|
||||||
|
struct wlr_output_power_manager_v1 *output_power_manager_v1;
|
||||||
|
struct wl_listener output_power_manager_set_mode;
|
||||||
|
|
||||||
struct wlr_relative_pointer_manager_v1 *relative_pointer_manager;
|
struct wlr_relative_pointer_manager_v1 *relative_pointer_manager;
|
||||||
struct wlr_pointer_constraints_v1 *constraints;
|
struct wlr_pointer_constraints_v1 *constraints;
|
||||||
struct wl_listener new_constraint;
|
struct wl_listener new_constraint;
|
||||||
|
|
@ -520,6 +524,8 @@ struct output *output_from_wlr_output(struct server *server,
|
||||||
struct wlr_output *wlr_output);
|
struct wlr_output *wlr_output);
|
||||||
struct wlr_box output_usable_area_in_layout_coords(struct output *output);
|
struct wlr_box output_usable_area_in_layout_coords(struct output *output);
|
||||||
struct wlr_box output_usable_area_from_cursor_coords(struct server *server);
|
struct wlr_box output_usable_area_from_cursor_coords(struct server *server);
|
||||||
|
void handle_output_power_manager_set_mode(struct wl_listener *listener,
|
||||||
|
void *data);
|
||||||
|
|
||||||
void damage_all_outputs(struct server *server);
|
void damage_all_outputs(struct server *server);
|
||||||
void damage_view_whole(struct view *view);
|
void damage_view_whole(struct view *view);
|
||||||
|
|
|
||||||
18
src/output.c
18
src/output.c
|
|
@ -1286,3 +1286,21 @@ output_usable_area_from_cursor_coords(struct server *server)
|
||||||
struct output *output = output_from_wlr_output(server, wlr_output);
|
struct output *output = output_from_wlr_output(server, wlr_output);
|
||||||
return output_usable_area_in_layout_coords(output);
|
return output_usable_area_in_layout_coords(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
handle_output_power_manager_set_mode(struct wl_listener *listener, void *data)
|
||||||
|
{
|
||||||
|
struct wlr_output_power_v1_set_mode_event *event = data;
|
||||||
|
|
||||||
|
switch (event->mode) {
|
||||||
|
case ZWLR_OUTPUT_POWER_V1_MODE_OFF:
|
||||||
|
wlr_output_enable(event->output, false);
|
||||||
|
wlr_output_commit(event->output);
|
||||||
|
break;
|
||||||
|
case ZWLR_OUTPUT_POWER_V1_MODE_ON:
|
||||||
|
wlr_output_enable(event->output, true);
|
||||||
|
output_ensure_buffer(event->output);
|
||||||
|
wlr_output_commit(event->output);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -317,6 +317,13 @@ server_init(struct server *server)
|
||||||
server->foreign_toplevel_manager =
|
server->foreign_toplevel_manager =
|
||||||
wlr_foreign_toplevel_manager_v1_create(server->wl_display);
|
wlr_foreign_toplevel_manager_v1_create(server->wl_display);
|
||||||
|
|
||||||
|
server->output_power_manager_v1 =
|
||||||
|
wlr_output_power_manager_v1_create(server->wl_display);
|
||||||
|
server->output_power_manager_set_mode.notify =
|
||||||
|
handle_output_power_manager_set_mode;
|
||||||
|
wl_signal_add(&server->output_power_manager_v1->events.set_mode,
|
||||||
|
&server->output_power_manager_set_mode);
|
||||||
|
|
||||||
layers_init(server);
|
layers_init(server);
|
||||||
|
|
||||||
#if HAVE_XWAYLAND
|
#if HAVE_XWAYLAND
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue