summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2014-02-07 17:20:14 -0500
committerJasper St. Pierre <jstpierre@mecheye.net>2014-02-07 19:33:17 -0500
commitbfe8a354cdd82ded6e38e8c38849e1ecc1b2f90c (patch)
tree907ef99772197a4d1ee6f65fd48b3f858f8c7d3b /gdk
parentc52e710dc834e42ff2fe46cd7fb2e81e25f8f4ac (diff)
downloadgtk+-bfe8a354cdd82ded6e38e8c38849e1ecc1b2f90c.tar.gz
wayland: Add support for set_shadow_width
Diffstat (limited to 'gdk')
-rw-r--r--gdk/wayland/gdkwindow-wayland.c19
-rw-r--r--gdk/wayland/protocol/xdg-shell.xml26
2 files changed, 44 insertions, 1 deletions
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index 6d80527c34..ab5953f320 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -2148,6 +2148,23 @@ gdk_wayland_window_set_opaque_region (GdkWindow *window,
wl_region_destroy (wl_region);
}
+static void
+gdk_wayland_window_set_shadow_width (GdkWindow *window,
+ int left,
+ int right,
+ int top,
+ int bottom)
+{
+ GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
+
+ if (GDK_WINDOW_DESTROYED (window))
+ return;
+
+ if (!impl->xdg_surface)
+ return;
+
+ xdg_surface_set_margin (impl->xdg_surface, left, right, top, bottom);
+}
static void
_gdk_window_impl_wayland_class_init (GdkWindowImplWaylandClass *klass)
@@ -2238,9 +2255,9 @@ _gdk_window_impl_wayland_class_init (GdkWindowImplWaylandClass *klass)
impl_class->delete_property = gdk_wayland_window_delete_property;
impl_class->get_scale_factor = gdk_wayland_window_get_scale_factor;
impl_class->set_opaque_region = gdk_wayland_window_set_opaque_region;
+ impl_class->set_shadow_width = gdk_wayland_window_set_shadow_width;
}
-
void
_gdk_wayland_window_set_device_grabbed (GdkWindow *window,
GdkDevice *device,
diff --git a/gdk/wayland/protocol/xdg-shell.xml b/gdk/wayland/protocol/xdg-shell.xml
index 5c21f4ebc9..f0d04aa34a 100644
--- a/gdk/wayland/protocol/xdg-shell.xml
+++ b/gdk/wayland/protocol/xdg-shell.xml
@@ -124,6 +124,32 @@
<arg name="parent" type="object" interface="wl_surface" allow-null="true"/>
</request>
+ <request name="set_margin">
+ <description summary="set the visible frame boundaries">
+ This tells the compositor what the visible size of the window
+ should be, so it can use it to determine what borders to use for
+ constrainment and alignment.
+
+ CSD often has invisible areas for decoration purposes, like drop
+ shadows. These "shadow" drawings need to be subtracted out of the
+ normal boundaries of the window when computing where to place
+ windows (e.g. to set this window so it's centered on top of another,
+ or to put it to the left or right of the screen.)
+
+ This value should change as little as possible at runtime, to
+ prevent flicker.
+
+ This value is also ignored when the window is maximized or
+ fullscreen, and assumed to be 0.
+
+ If never called, this value is assumed to be 0.
+ </description>
+ <arg name="left_margin" type="int"/>
+ <arg name="right_margin" type="int"/>
+ <arg name="top_margin" type="int"/>
+ <arg name="bottom_margin" type="int"/>
+ </request>
+
<request name="set_title">
<description summary="set surface title">
Set a short title for the surface.