git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28802 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2009-10-11 20:17:28 +00:00
parent 23c6ece351
commit 92e4946b9d
2 changed files with 16 additions and 7 deletions

View file

@ -1,3 +1,9 @@
2009-10-11 Fred Kiefer <FredKiefer@gmx.de>
* Source/GSStandardWindowDecorationView.m
(-resizeWindowStartingWithEvent:): restructure event handling code
and add periodic event.
2009-10-11 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSApplication.m: ([stopModalWithCode:]) correct the check to

View file

@ -302,9 +302,10 @@ calc_new_frame(NSRect frame, NSPoint point, NSPoint firstPoint,
- (void) resizeWindowStartingWithEvent: (NSEvent *)event
{
unsigned int mask = NSLeftMouseDraggedMask | NSLeftMouseUpMask;
unsigned int mask = NSLeftMouseDraggedMask | NSLeftMouseUpMask | NSPeriodicMask;
NSEvent *currentEvent = event;
NSDate *distantPast = [NSDate distantPast];
NSDate *distantFuture = [NSDate distantFuture];
NSPoint firstPoint, point;
NSRect newFrame, frame;
NSSize minSize, maxSize;
@ -333,6 +334,7 @@ calc_new_frame(NSRect frame, NSPoint point, NSPoint firstPoint,
maxSize = [window maxSize];
[window _captureMouse: nil];
[NSEvent startPeriodicEventsAfterDelay: 0.1 withPeriod: 0.1];
do
{
while (currentEvent && [currentEvent type] != NSLeftMouseUp)
@ -350,18 +352,19 @@ calc_new_frame(NSRect frame, NSPoint point, NSPoint firstPoint,
if (currentEvent && [currentEvent type] == NSLeftMouseUp)
break;
currentEvent = [_window nextEventMatchingMask: mask
untilDate: [NSDate distantFuture]
inMode: NSEventTrackingRunLoopMode
dequeue: YES];
num++;
if(num == 5)
if (num == 5)
{
[window setFrame: newFrame display: YES];
num = 0;
}
currentEvent = [_window nextEventMatchingMask: mask
untilDate: distantFuture
inMode: NSEventTrackingRunLoopMode
dequeue: YES];
} while ([currentEvent type] != NSLeftMouseUp);
[NSEvent stopPeriodicEvents];
[window _releaseMouse: nil];
[window setFrame: newFrame display: YES];