mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-11 21:20:09 +00:00
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
This commit is contained in:
parent
f55096fc74
commit
48a45ff672
@ -1,3 +1,8 @@
|
|||||||
|
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>
|
2007-06-16 Richard Hult <richard@imendio.com>
|
||||||
|
|
||||||
* gdk/quartz/gdkwindow-quartz.c (gdk_window_set_transient_for):
|
* gdk/quartz/gdkwindow-quartz.c (gdk_window_set_transient_for):
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* GdkQuartzWindow.m
|
/* GdkQuartzWindow.m
|
||||||
*
|
*
|
||||||
* Copyright (C) 2005 Imendio AB
|
* Copyright (C) 2005-2007 Imendio AB
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
@ -18,7 +18,6 @@
|
|||||||
* Boston, MA 02111-1307, USA.
|
* Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#import "GdkQuartzWindow.h"
|
#import "GdkQuartzWindow.h"
|
||||||
#include "gdkwindow-quartz.h"
|
#include "gdkwindow-quartz.h"
|
||||||
#include "gdkprivate-quartz.h"
|
#include "gdkprivate-quartz.h"
|
||||||
@ -69,6 +68,40 @@
|
|||||||
_gdk_quartz_events_update_focus_window (window, FALSE);
|
_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
|
-(void)windowDidMove:(NSNotification *)aNotification
|
||||||
{
|
{
|
||||||
NSRect content_rect = [self contentRectForFrameRect:[self frame]];
|
NSRect content_rect = [self contentRectForFrameRect:[self frame]];
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* GdkQuartzWindow.h
|
/* GdkQuartzWindow.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2005 Imendio AB
|
* Copyright (C) 2005-2007 Imendio AB
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU Lesser General Public
|
* modify it under the terms of the GNU Lesser General Public
|
||||||
@ -19,11 +19,15 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#import <AppKit/AppKit.h>
|
#import <AppKit/AppKit.h>
|
||||||
#include "gdkwindow.h"
|
#include <glib.h>
|
||||||
|
|
||||||
@interface GdkQuartzWindow : NSWindow {
|
@interface GdkQuartzWindow : NSWindow {
|
||||||
|
BOOL leftDown;
|
||||||
|
BOOL inMove;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-(BOOL)isInMove;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user