[gtk+/gtk-3-2] Quartz, Bug 655057: Eliminate Compiler Warning
- From: John Ralls <jralls src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-2] Quartz, Bug 655057: Eliminate Compiler Warning
- Date: Sun, 9 Oct 2011 17:08:11 +0000 (UTC)
commit 9aa26f0d6404bed1fccd0995f92030ad98d56afe
Author: Alex Corrado <alexander corrado gmail com>
Date: Sun Oct 9 09:52:14 2011 -0700
Quartz, Bug 655057: Eliminate Compiler Warning
When compiled with older SDKs, the original change for this bug caused a
compiler warning about NSWindow not being able to handle a setStyleMask
message. This tricks the compiler into thinking that it can.
gdk/quartz/gdkwindow-quartz.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index 9bd104d..82e79dc 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -2530,9 +2530,17 @@ gdk_quartz_window_get_frame_extents (GdkWindow *window,
rect->height = ns_rect.size.height;
}
+/* Fake protocol to make gcc think that it's OK to call setStyleMask
+ even if it isn't. We check to make sure before actually calling
+ it. */
+
+ protocol CanSetStyleMask
+- (void)setStyleMask:(int)mask;
+ end
+
static void
gdk_quartz_window_set_decorations (GdkWindow *window,
- GdkWMDecoration decorations)
+ GdkWMDecoration decorations)
{
GdkWindowImplQuartz *impl;
NSUInteger old_mask, new_mask;
@@ -2589,7 +2597,7 @@ gdk_quartz_window_set_decorations (GdkWindow *window,
*/
if ([impl->toplevel respondsToSelector:@selector(setStyleMask:)])
{
- [impl->toplevel setStyleMask:new_mask];
+ [(id<CanSetStyleMask>)impl->toplevel setStyleMask:new_mask];
}
else
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]