aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-10-08 17:15:42 -0400
committerGitHub <noreply@github.com>2017-10-08 17:15:42 -0400
commit39fd218443dae6d6c81713b2f85ead3e9e1c3ea1 (patch)
tree096af4ad119f9adf76ac2f25d94c0bf6cc7a6510
parent3f4ccd0558a962558625ca61cfb7320cffd33b8a (diff)
parent761b35339efcbd01ab70b67b74f7910859f9365e (diff)
Merge pull request #245 from acrisci/bug/commit-empty-buffer
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);