Merge pull request #544 from emersion/fix-views-outside-output-layout

Fix views outside output layout
This commit is contained in:
Drew DeVault 2018-01-01 11:45:08 -05:00 committed by GitHub
commit b23bd8ea28
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 151 additions and 106 deletions

View file

@ -47,6 +47,7 @@ struct roots_desktop {
struct wl_listener output_add;
struct wl_listener output_remove;
struct wl_listener layout_change;
struct wl_listener xdg_shell_v6_surface;
struct wl_listener wl_shell_surface;
struct wl_listener decoration_new;

View file

@ -8,18 +8,18 @@ struct wlr_box {
int width, height;
};
void wlr_box_closest_point(struct wlr_box *box, double x, double y,
double *dest_x, double *dest_y);
void wlr_box_closest_point(const struct wlr_box *box, double x, double y,
double *dest_x, double *dest_y);
bool wlr_box_intersection(struct wlr_box *box_a,
struct wlr_box *box_b, struct wlr_box **dest);
bool wlr_box_intersection(const struct wlr_box *box_a,
const struct wlr_box *box_b, struct wlr_box *dest);
bool wlr_box_contains_point(struct wlr_box *box, double x, double y);
bool wlr_box_contains_point(const struct wlr_box *box, double x, double y);
bool wlr_box_empty(struct wlr_box *box);
bool wlr_box_empty(const struct wlr_box *box);
enum wl_output_transform;
void wlr_box_transform(struct wlr_box *box, enum wl_output_transform transform,
struct wlr_box *dest);
void wlr_box_transform(const struct wlr_box *box,
enum wl_output_transform transform, struct wlr_box *dest);
#endif

View file

@ -1,6 +1,7 @@
#ifndef WLR_TYPES_WLR_OUTPUT_LAYOUT_H
#define WLR_TYPES_WLR_OUTPUT_LAYOUT_H
#include <wlr/types/wlr_box.h>
#include <wlr/types/wlr_output.h>
#include <wayland-util.h>
#include <stdbool.h>
@ -61,7 +62,7 @@ bool wlr_output_layout_contains_point(struct wlr_output_layout *layout,
struct wlr_output *reference, int x, int y);
bool wlr_output_layout_intersects(struct wlr_output_layout *layout,
struct wlr_output *reference, int x1, int y1, int x2, int y2);
struct wlr_output *reference, const struct wlr_box *target_box);
/**
* Get the closest point on this layout from the given point from the reference