gboolean has_bounds;
char *title;
+
+ GdkGeometry geometry_hints;
+ GdkSurfaceHints geometry_mask;
+ GdkGeometry last_sent_geometry_hints;
};
typedef struct
};
}
-static void gdk_wayland_surface_set_geometry_hints (GdkWaylandSurface *impl,
- const GdkGeometry *geometry,
- GdkSurfaceHints geom_mask);
+static void gdk_wayland_toplevel_set_geometry_hints (GdkWaylandToplevel *toplevel,
+ const GdkGeometry *geometry,
+ GdkSurfaceHints geom_mask);
static void
gdk_wayland_surface_sync_shadow (GdkSurface *surface)
return;
gdk_wayland_surface_get_window_geometry (surface, &geometry);
- gdk_wayland_surface_set_geometry_hints (impl,
- &impl->geometry_hints,
- impl->geometry_mask);
+ if (GDK_IS_WAYLAND_TOPLEVEL (impl))
+ {
+ GdkWaylandToplevel *toplevel = GDK_WAYLAND_TOPLEVEL (impl);
+ gdk_wayland_toplevel_set_geometry_hints (toplevel,
+ &toplevel->geometry_hints,
+ toplevel->geometry_mask);
+ }
if (gdk_rectangle_equal (&geometry, &impl->last_sent_window_geometry))
return;
geometry.max_height = geometry.min_height = size.height;
mask = GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE;
}
- gdk_wayland_surface_set_geometry_hints (wayland_surface, &geometry, mask);
+
+ gdk_wayland_toplevel_set_geometry_hints (wayland_toplevel, &geometry, mask);
if (size.shadow.is_valid)
{
if (wayland_surface->next_layout.toplevel.should_constrain)
{
- gdk_surface_constrain_size (&wayland_surface->geometry_hints,
- wayland_surface->geometry_mask,
+ gdk_surface_constrain_size (&wayland_toplevel->geometry_hints,
+ wayland_toplevel->geometry_mask,
width, height,
&width, &height);
}
unset_transient_for_exported (surface);
impl->last_sent_window_geometry = (GdkRectangle) { 0 };
- impl->last_sent_min_width = 0;
- impl->last_sent_min_height = 0;
- impl->last_sent_max_width = 0;
- impl->last_sent_max_height = 0;
+
+ if (GDK_IS_WAYLAND_TOPLEVEL (impl))
+ {
+ GdkWaylandToplevel *toplevel = GDK_WAYLAND_TOPLEVEL (impl);
+ toplevel->last_sent_geometry_hints.min_width = 0;
+ toplevel->last_sent_geometry_hints.min_height = 0;
+ toplevel->last_sent_geometry_hints.max_width = 0;
+ toplevel->last_sent_geometry_hints.max_height = 0;
+ }
_gdk_wayland_surface_clear_saved_size (surface);
impl->mapped = FALSE;
wayland_surface->display_server.wl_surface);
wl_proxy_set_queue ((struct wl_proxy *) wayland_toplevel->display_server.gtk_surface,
wayland_surface->event_queue);
- gdk_wayland_surface_set_geometry_hints (wayland_surface,
- &wayland_surface->geometry_hints,
- wayland_surface->geometry_mask);
+ gdk_wayland_toplevel_set_geometry_hints (wayland_toplevel,
+ &wayland_toplevel->geometry_hints,
+ wayland_toplevel->geometry_mask);
gtk_surface1_add_listener (wayland_toplevel->display_server.gtk_surface,
>k_surface_listener,
wayland_surface);
}
static void
-gdk_wayland_surface_set_geometry_hints (GdkWaylandSurface *impl,
- const GdkGeometry *geometry,
- GdkSurfaceHints geom_mask)
+gdk_wayland_toplevel_set_geometry_hints (GdkWaylandToplevel *toplevel,
+ const GdkGeometry *geometry,
+ GdkSurfaceHints geom_mask)
{
+ GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (toplevel);
GdkWaylandDisplay *display_wayland;
int min_width, min_height;
int max_width, max_height;
- if (GDK_SURFACE_DESTROYED (impl))
+ if (GDK_SURFACE_DESTROYED (toplevel))
return;
- display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (GDK_SURFACE (impl)));
+ display_wayland = GDK_WAYLAND_DISPLAY (gdk_surface_get_display (GDK_SURFACE (toplevel)));
- impl->geometry_hints = *geometry;
- impl->geometry_mask = geom_mask;
+ toplevel->geometry_hints = *geometry;
+ toplevel->geometry_mask = geom_mask;
if (!is_realized_toplevel (impl))
return;
max_height = 0;
}
- if (impl->last_sent_min_width == min_width &&
- impl->last_sent_min_height == min_height &&
- impl->last_sent_max_width == max_width &&
- impl->last_sent_max_height == max_height)
+ if (toplevel->last_sent_geometry_hints.min_width == min_width &&
+ toplevel->last_sent_geometry_hints.min_height == min_height &&
+ toplevel->last_sent_geometry_hints.max_width == max_width &&
+ toplevel->last_sent_geometry_hints.max_height == max_height)
return;
switch (display_wayland->shell_variant)
g_assert_not_reached ();
}
- impl->last_sent_min_width = min_width;
- impl->last_sent_min_height = min_height;
- impl->last_sent_max_width = max_width;
- impl->last_sent_max_height = max_height;
+ toplevel->last_sent_geometry_hints.min_width = min_width;
+ toplevel->last_sent_geometry_hints.min_height = min_height;
+ toplevel->last_sent_geometry_hints.max_width = max_width;
+ toplevel->last_sent_geometry_hints.max_height = max_height;
}
static void