summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hult <richard@imendio.com>2007-06-16 15:41:27 +0000
committerRichard Hult <rhult@src.gnome.org>2007-06-16 15:41:27 +0000
commit48a45ff672cb084cf72c132bcc50d0c2cfb845d7 (patch)
treea755d76c063984d8becf3daf6d967dd7e3c3c519
parentf55096fc74687f20cc6c15b88677436f12b500de (diff)
downloadgtk+-48a45ff672cb084cf72c132bcc50d0c2cfb845d7.tar.gz
Implement, to be used to detect if the window is currently being moved
2007-06-16 Richard Hult <richard@imendio.com> * gdk/quartz/GdkQuartzWindow.c: (isInMove): Implement, to be used to detect if the window is currently being moved with the mouse. svn path=/trunk/; revision=18159
-rw-r--r--ChangeLog5
-rw-r--r--gdk/quartz/GdkQuartzWindow.c37
-rw-r--r--gdk/quartz/GdkQuartzWindow.h8
3 files changed, 46 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 58afdf812e..7af406dec4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2007-06-16 Richard Hult <richard@imendio.com>
+ * gdk/quartz/GdkQuartzWindow.c: (isInMove): Implement, to be used
+ to detect if the window is currently being moved with the mouse.
+
+2007-06-16 Richard Hult <richard@imendio.com>
+
* gdk/quartz/gdkwindow-quartz.c (gdk_window_set_transient_for):
Don't set parent/child relationship for tooltip windows since that
moves the parent window to the front, due to the tooltip having a
diff --git a/gdk/quartz/GdkQuartzWindow.c b/gdk/quartz/GdkQuartzWindow.c
index 9a97ec4aee..cd18e7f9be 100644
--- a/gdk/quartz/GdkQuartzWindow.c
+++ b/gdk/quartz/GdkQuartzWindow.c
@@ -1,6 +1,6 @@
/* GdkQuartzWindow.m
*
- * Copyright (C) 2005 Imendio AB
+ * Copyright (C) 2005-2007 Imendio AB
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -18,7 +18,6 @@
* Boston, MA 02111-1307, USA.
*/
-
#import "GdkQuartzWindow.h"
#include "gdkwindow-quartz.h"
#include "gdkprivate-quartz.h"
@@ -69,6 +68,40 @@
_gdk_quartz_events_update_focus_window (window, FALSE);
}
+/* Used in combination with NSLeftMouseUp in sendEvent to keep track
+ * of when the window is being moved with the mouse.
+ */
+-(void)windowWillMove:(NSNotification *)aNotification
+{
+ if (leftDown)
+ inMove = YES;
+}
+
+-(void)sendEvent:(NSEvent *)event
+{
+ switch ([event type])
+ {
+ case NSLeftMouseDown:
+ leftDown = YES;
+ break;
+
+ case NSLeftMouseUp:
+ leftDown = NO;
+ inMove = NO;
+ break;
+
+ default:
+ break;
+ }
+
+ [super sendEvent:event];
+}
+
+-(BOOL)isInMove
+{
+ return inMove;
+}
+
-(void)windowDidMove:(NSNotification *)aNotification
{
NSRect content_rect = [self contentRectForFrameRect:[self frame]];
diff --git a/gdk/quartz/GdkQuartzWindow.h b/gdk/quartz/GdkQuartzWindow.h
index 5a00397095..4c2276d3c6 100644
--- a/gdk/quartz/GdkQuartzWindow.h
+++ b/gdk/quartz/GdkQuartzWindow.h
@@ -1,6 +1,6 @@
/* GdkQuartzWindow.h
*
- * Copyright (C) 2005 Imendio AB
+ * Copyright (C) 2005-2007 Imendio AB
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -19,11 +19,15 @@
*/
#import <AppKit/AppKit.h>
-#include "gdkwindow.h"
+#include <glib.h>
@interface GdkQuartzWindow : NSWindow {
+ BOOL leftDown;
+ BOOL inMove;
}
+-(BOOL)isInMove;
+
@end