mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-29 16:05:59 +01:00
surface: ignore viewport src rect on NULL buffer
According to the viewporter protocol: > If the wl_buffer is NULL, the surface has no content and therefore no size.
This commit is contained in:
parent
c18c419b56
commit
d177abecae
1 changed files with 5 additions and 0 deletions
|
@ -147,6 +147,11 @@ static void surface_set_input_region(struct wl_client *client,
|
||||||
*/
|
*/
|
||||||
static void surface_state_viewport_src_size(struct wlr_surface_state *state,
|
static void surface_state_viewport_src_size(struct wlr_surface_state *state,
|
||||||
int *out_width, int *out_height) {
|
int *out_width, int *out_height) {
|
||||||
|
if (state->buffer_width == 0 && state->buffer_height == 0) {
|
||||||
|
*out_width = *out_height = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (state->viewport.has_src) {
|
if (state->viewport.has_src) {
|
||||||
*out_width = state->viewport.src.width;
|
*out_width = state->viewport.src.width;
|
||||||
*out_height = state->viewport.src.height;
|
*out_height = state->viewport.src.height;
|
||||||
|
|
Loading…
Reference in a new issue