MetaWaylandSurface: cache the surface type until the first commit

Once the sizing is properly wired up, we need to make sure that
the size at the initial map is correct, and not always 0, 0 because
the buffer is not yet converted into a CoglTexture by MetaShapedTexture,
otherwise we end up sending out configure events at 1 x 1.
To do so, we cache the surface type in the initial state until the
first commit.

https://bugzilla.gnome.org/show_bug.cgi?id=707401
This commit is contained in:
Giovanni Campagna
2013-09-16 13:42:59 +02:00
parent a7eaf43e18
commit 12d6c70000
2 changed files with 81 additions and 53 deletions

View File

@ -36,6 +36,7 @@ struct _MetaWaylandBuffer
struct wl_signal destroy_signal;
struct wl_listener destroy_listener;
CoglTexture *texture;
int32_t width, height;
uint32_t busy_count;
};
@ -65,8 +66,16 @@ typedef struct
struct wl_list frame_callback_list;
} MetaWaylandDoubleBufferedState;
typedef enum {
META_WAYLAND_SURFACE_TOPLEVEL = 0,
META_WAYLAND_SURFACE_MAXIMIZED,
META_WAYLAND_SURFACE_FULLSCREEN
} MetaWaylandSurfaceType;
typedef struct
{
MetaWaylandSurfaceType initial_type;
char *title;
char *wm_class;
@ -78,14 +87,21 @@ typedef struct
char *gtk_window_object_path;
} MetaWaylandSurfaceInitialState;
typedef struct
{
MetaWaylandSurface *surface;
struct wl_resource *resource;
struct wl_listener surface_destroy_listener;
} MetaWaylandSurfaceExtension;
struct _MetaWaylandSurface
{
struct wl_resource *resource;
MetaWaylandCompositor *compositor;
MetaWaylandBufferReference buffer_ref;
MetaWindow *window;
gboolean has_shell_surface;
gboolean has_gtk_surface;
MetaWaylandSurfaceExtension *shell_surface;
MetaWaylandSurfaceExtension *gtk_surface;
/* All the pending state, that wl_surface.commit will apply. */
MetaWaylandDoubleBufferedState pending;
@ -95,13 +111,6 @@ struct _MetaWaylandSurface
MetaWaylandSurfaceInitialState *initial_state;
};
typedef struct
{
MetaWaylandSurface *surface;
struct wl_resource *resource;
struct wl_listener surface_destroy_listener;
} MetaWaylandSurfaceExtension;
void meta_wayland_init_shell (MetaWaylandCompositor *compositor);
MetaWaylandSurface *meta_wayland_surface_create (MetaWaylandCompositor *compositor,