mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-23 05:15:58 +01:00
layer-shell: add committed
bitmask
This commit is contained in:
parent
59fa3637c3
commit
754f40f9cb
2 changed files with 20 additions and 1 deletions
|
@ -43,7 +43,18 @@ struct wlr_layer_shell_v1 {
|
||||||
void *data;
|
void *data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum wlr_layer_surface_v1_state_field {
|
||||||
|
WLR_LAYER_SURFACE_V1_STATE_DESIRED_SIZE = 1 << 0,
|
||||||
|
WLR_LAYER_SURFACE_V1_STATE_ANCHOR = 1 << 1,
|
||||||
|
WLR_LAYER_SURFACE_V1_STATE_EXCLUSIVE_ZONE = 1 << 2,
|
||||||
|
WLR_LAYER_SURFACE_V1_STATE_MARGIN = 1 << 3,
|
||||||
|
WLR_LAYER_SURFACE_V1_STATE_KEYBOARD_INTERACTIVITY = 1 << 4,
|
||||||
|
WLR_LAYER_SURFACE_V1_STATE_LAYER = 1 << 5,
|
||||||
|
};
|
||||||
|
|
||||||
struct wlr_layer_surface_v1_state {
|
struct wlr_layer_surface_v1_state {
|
||||||
|
uint32_t committed; // enum wlr_layer_surface_v1_state_field
|
||||||
|
|
||||||
uint32_t anchor;
|
uint32_t anchor;
|
||||||
int32_t exclusive_zone;
|
int32_t exclusive_zone;
|
||||||
struct {
|
struct {
|
||||||
|
@ -51,9 +62,10 @@ struct wlr_layer_surface_v1_state {
|
||||||
} margin;
|
} margin;
|
||||||
enum zwlr_layer_surface_v1_keyboard_interactivity keyboard_interactive;
|
enum zwlr_layer_surface_v1_keyboard_interactivity keyboard_interactive;
|
||||||
uint32_t desired_width, desired_height;
|
uint32_t desired_width, desired_height;
|
||||||
uint32_t actual_width, actual_height;
|
|
||||||
enum zwlr_layer_shell_v1_layer layer;
|
enum zwlr_layer_shell_v1_layer layer;
|
||||||
|
|
||||||
uint32_t configure_serial;
|
uint32_t configure_serial;
|
||||||
|
uint32_t actual_width, actual_height;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct wlr_layer_surface_v1_configure {
|
struct wlr_layer_surface_v1_configure {
|
||||||
|
|
|
@ -103,6 +103,7 @@ static void layer_surface_handle_set_size(struct wl_client *client,
|
||||||
if (!surface) {
|
if (!surface) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
surface->pending.committed |= WLR_LAYER_SURFACE_V1_STATE_DESIRED_SIZE;
|
||||||
surface->pending.desired_width = width;
|
surface->pending.desired_width = width;
|
||||||
surface->pending.desired_height = height;
|
surface->pending.desired_height = height;
|
||||||
}
|
}
|
||||||
|
@ -124,6 +125,7 @@ static void layer_surface_handle_set_anchor(struct wl_client *client,
|
||||||
if (!surface) {
|
if (!surface) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
surface->pending.committed |= WLR_LAYER_SURFACE_V1_STATE_ANCHOR;
|
||||||
surface->pending.anchor = anchor;
|
surface->pending.anchor = anchor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,6 +136,7 @@ static void layer_surface_handle_set_exclusive_zone(struct wl_client *client,
|
||||||
if (!surface) {
|
if (!surface) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
surface->pending.committed |= WLR_LAYER_SURFACE_V1_STATE_EXCLUSIVE_ZONE;
|
||||||
surface->pending.exclusive_zone = zone;
|
surface->pending.exclusive_zone = zone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,6 +148,7 @@ static void layer_surface_handle_set_margin(
|
||||||
if (!surface) {
|
if (!surface) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
surface->pending.committed |= WLR_LAYER_SURFACE_V1_STATE_MARGIN;
|
||||||
surface->pending.margin.top = top;
|
surface->pending.margin.top = top;
|
||||||
surface->pending.margin.right = right;
|
surface->pending.margin.right = right;
|
||||||
surface->pending.margin.bottom = bottom;
|
surface->pending.margin.bottom = bottom;
|
||||||
|
@ -160,6 +164,7 @@ static void layer_surface_handle_set_keyboard_interactivity(
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
surface->pending.committed |= WLR_LAYER_SURFACE_V1_STATE_KEYBOARD_INTERACTIVITY;
|
||||||
if (wl_resource_get_version(resource) < ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_ON_DEMAND_SINCE_VERSION) {
|
if (wl_resource_get_version(resource) < ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_ON_DEMAND_SINCE_VERSION) {
|
||||||
surface->pending.keyboard_interactive = !!interactive;
|
surface->pending.keyboard_interactive = !!interactive;
|
||||||
} else {
|
} else {
|
||||||
|
@ -204,6 +209,7 @@ static void layer_surface_set_layer(struct wl_client *client,
|
||||||
"Invalid layer %" PRIu32, layer);
|
"Invalid layer %" PRIu32, layer);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
surface->pending.committed |= WLR_LAYER_SURFACE_V1_STATE_LAYER;
|
||||||
surface->pending.layer = layer;
|
surface->pending.layer = layer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -309,6 +315,7 @@ static void layer_surface_role_commit(struct wlr_surface *wlr_surface) {
|
||||||
}
|
}
|
||||||
|
|
||||||
surface->current = surface->pending;
|
surface->current = surface->pending;
|
||||||
|
surface->pending.committed = 0;
|
||||||
|
|
||||||
if (wlr_surface_has_buffer(surface->surface) && !surface->configured) {
|
if (wlr_surface_has_buffer(surface->surface) && !surface->configured) {
|
||||||
wl_resource_post_error(surface->resource,
|
wl_resource_post_error(surface->resource,
|
||||||
|
|
Loading…
Reference in a new issue