mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-24 18:31:20 +00:00
Fix for bug #27631
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28802 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
23c6ece351
commit
92e4946b9d
2 changed files with 16 additions and 7 deletions
|
@ -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
|
||||
|
|
|
@ -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];
|
||||
|
|
Loading…
Reference in a new issue