From 1688545087fccae7573de2d2e56431c7ba5dff56 Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Tue, 5 Jun 2012 08:31:48 +0200 Subject: [PATCH] Add custom binding for XRectangle to avoid warning --- src/Main.vala | 4 ++-- vapi/xfixes-4.0.vapi | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Main.vala b/src/Main.vala index d4b185d7..a409d966 100644 --- a/src/Main.vala +++ b/src/Main.vala @@ -176,13 +176,13 @@ namespace Gala **/ public void set_input_area (InputArea area) { - X.Rectangle rect; + X.Xrectangle rect; int width, height; screen.get_size (out width, out height); switch (area) { case InputArea.FULLSCREEN: - rect = {0, 0, (short)width, (short)height}; + rect = {0, 0, (ushort)width, (ushort)height}; break; case InputArea.HOT_CORNER: //leave one pix in the bottom left rect = {(short)(width - 1), (short)(height - 1), 1, 1}; diff --git a/vapi/xfixes-4.0.vapi b/vapi/xfixes-4.0.vapi index cd3652ed..3cbcfc76 100644 --- a/vapi/xfixes-4.0.vapi +++ b/vapi/xfixes-4.0.vapi @@ -5,7 +5,7 @@ namespace X { namespace Fixes { [CCode (cheader_filename = "X11/extensions/Xfixes.h", cname = "XFixesCreateRegion")] - public static X.XserverRegion create_region (X.Display display, [CCode (array_length = true)] X.Rectangle[] rectangles); + public static X.XserverRegion create_region (X.Display display, [CCode (array_length = true)] X.Xrectangle[] rectangles); [CCode (cheader_filename = "X11/extensions/Xfixes.h", cname = "XFixesDestroyRegion")] public static void destroy_region (X.Display display, X.XserverRegion region); } @@ -13,4 +13,12 @@ namespace X { [CCode (cheader_filename = "X11/extensions/Xfixes.h", cname = "XserverRegion", has_type_id = false)] public struct XserverRegion { } + [SimpleType] + [CCode (cheader_filename = "X11/Xlib.h", cname = "XRectangle", has_type_id = false)] + public struct Xrectangle { + public short x; + public short y; + public ushort width; + public ushort height; + } }