Skip to content

Commit c69bd38

Browse files
committed
wait for a configure event before attaching a buffer to the surface
1 parent 85525d7 commit c69bd38

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

src/custom-shell-surface.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,13 @@ custom_shell_surface_on_window_map (GtkWidget *widget, CustomShellSurface *self)
7878
// attached, so we don't need to commit. If this is removed, test-window-with-initially-attached-buffer should fail.
7979
wl_surface_attach (wl_surface, NULL, 0, 0);
8080

81+
self->configured = FALSE;
8182
self->virtual->map (self, wl_surface);
8283
gdk_window_set_priv_mapped (gdk_window);
8384

8485
wl_surface_commit (wl_surface);
85-
wl_display_roundtrip (gdk_wayland_display_get_wl_display (gdk_display_get_default ()));
86+
while(!self->configured)
87+
wl_display_roundtrip (gdk_wayland_display_get_wl_display (gdk_display_get_default ()));
8688
}
8789

8890
void

src/custom-shell-surface.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ struct _CustomShellSurface
4747
{
4848
CustomShellSurfaceVirtual const *virtual;
4949
CustomShellSurfacePrivate *private;
50+
gboolean configured;
5051
};
5152

5253
// Usually called by the subclass constructors

src/layer-surface.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ layer_surface_handle_configure (void *data,
117117
};
118118

119119
layer_surface_update_size (self);
120+
((CustomShellSurface *)self)->configured = TRUE;
120121
}
121122

122123
static void

0 commit comments

Comments
 (0)