[gtk+] wayland: Move window geometry calculation to helper
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] wayland: Move window geometry calculation to helper
- Date: Thu, 25 Aug 2016 04:45:06 +0000 (UTC)
commit 643f0339238f1cd4d853a81d4cdb3e149d660ee8
Author: Jonas Ådahl <jadahl gmail com>
Date: Fri Jul 1 17:02:11 2016 +0800
wayland: Move window geometry calculation to helper
We'll use it from more places later.
https://bugzilla.gnome.org/show_bug.cgi?id=769937
gdk/wayland/gdkwindow-wayland.c | 28 +++++++++++++++++++++-------
1 files changed, 21 insertions(+), 7 deletions(-)
---
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index f1f0098..7dd451b 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -1056,20 +1056,34 @@ gdk_wayland_window_sync_title (GdkWindow *window)
}
static void
+gdk_wayland_window_get_window_geometry (GdkWindow *window,
+ GdkRectangle *geometry)
+{
+ GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+
+ *geometry = (GdkRectangle) {
+ .x = impl->margin_left,
+ .y = impl->margin_top,
+ .width = window->width - (impl->margin_left + impl->margin_right),
+ .height = window->height - (impl->margin_top + impl->margin_bottom)
+ };
+}
+
+static void
gdk_wayland_window_sync_margin (GdkWindow *window)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
- gint x, y, width, height;
+ GdkRectangle geometry;
if (!impl->display_server.xdg_surface)
return;
- x = impl->margin_left;
- y = impl->margin_top;
- width = window->width - (impl->margin_left + impl->margin_right);
- height = window->height - (impl->margin_top + impl->margin_bottom);
-
- xdg_surface_set_window_geometry (impl->display_server.xdg_surface, x, y, width, height);
+ gdk_wayland_window_get_window_geometry (window, &geometry);
+ xdg_surface_set_window_geometry (impl->display_server.xdg_surface,
+ geometry.x,
+ geometry.y,
+ geometry.width,
+ geometry.height);
}
static struct wl_region *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]