output: add usable area

This area will be defined by the layer shell surfaces, as the total
output layout area minus areas occupied by layer shell surfaces.

It is meant for layer shell surfaces to reserve space that will not be
used for views, such as a status bar.
This commit is contained in:
Jente Hidskes 2020-02-23 22:32:29 +01:00
parent c3a3539080
commit dc090aa517
2 changed files with 4 additions and 0 deletions

View file

@ -56,6 +56,8 @@ output_enable(struct cg_output *output)
wlr_output_enable(wlr_output, true);
wlr_output_commit(wlr_output);
output->usable_area = *wlr_output_layout_get_box(output->server->output_layout, wlr_output);
struct wlr_scene_output *scene_output;
wl_list_for_each (scene_output, &output->server->scene->outputs, link) {
if (scene_output->output == wlr_output) {

View file

@ -4,6 +4,7 @@
#include <wayland-server-core.h>
#include <wlr/types/wlr_output.h>
#include <wlr/types/wlr_output_damage.h>
#include <wlr/util/box.h>
#include "server.h"
#include "view.h"
@ -20,6 +21,7 @@ struct cg_output {
struct cg_server *server;
struct wlr_output *wlr_output;
struct wlr_scene_output *scene_output;
struct wlr_box usable_area;
struct wl_listener commit;
struct wl_listener mode;