aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2017-10-08 17:03:27 -0400
committerTony Crisci <tony@dubstepdish.com>2017-10-08 17:03:27 -0400
commit761b35339efcbd01ab70b67b74f7910859f9365e (patch)
tree096af4ad119f9adf76ac2f25d94c0bf6cc7a6510
parent3f4ccd0558a962558625ca61cfb7320cffd33b8a (diff)
bug: handle commit empty buffer
-rw-r--r--types/wlr_surface.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/types/wlr_surface.c b/types/wlr_surface.c
index e675ac69..3b4ff42c 100644
--- a/types/wlr_surface.c
+++ b/types/wlr_surface.c
@@ -132,6 +132,12 @@ static void surface_set_input_region(struct wl_client *client,
}
static void wlr_surface_update_size(struct wlr_surface *surface, struct wlr_surface_state *state) {
+ if (!state->buffer) {
+ state->height = 0;
+ state->width = 0;
+ return;
+ }
+
int scale = state->scale;
enum wl_output_transform transform = state->transform;
@@ -342,6 +348,9 @@ static void wlr_surface_commit_pending(struct wlr_surface *surface) {
int32_t oldh = surface->current->buffer_height;
wlr_surface_move_state(surface, surface->pending, surface->current);
+ if (!surface->current->buffer) {
+ surface->texture->valid = false;
+ }
// commit subsurface order
struct wlr_subsurface *subsurface;
@@ -445,9 +454,6 @@ static void surface_commit(struct wl_client *client,
void wlr_surface_flush_damage(struct wlr_surface *surface) {
if (!surface->current->buffer) {
- if (surface->texture->valid) {
- // TODO: Detach buffers
- }
return;
}
struct wl_shm_buffer *buffer = wl_shm_buffer_get(surface->current->buffer);