mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 16:10:48 +00:00
* Source/NSWindow.m (processEvent:): notification moved back here from
`screen` method. Placing posting notification into `screen` method is unreliable/dangerous - notification observer may call [NSWindow screen] which results in notification posting loop.
This commit is contained in:
parent
4c531f04bc
commit
381c24cdf4
1 changed files with 21 additions and 12 deletions
|
@ -2702,8 +2702,6 @@ titleWithRepresentedFilename(NSString *representedFilename)
|
|||
}
|
||||
}
|
||||
ASSIGN(_screen, [self _screenForFrame: _frame]);
|
||||
[nc postNotificationName: NSWindowDidChangeScreenNotification
|
||||
object: self];
|
||||
return _screen;
|
||||
}
|
||||
|
||||
|
@ -4172,16 +4170,27 @@ checkCursorRectanglesExited(NSView *theView, NSEvent *theEvent, NSPoint lastPoi
|
|||
switch (sub)
|
||||
{
|
||||
case GSAppKitWindowMoved:
|
||||
_frame.origin.x = (CGFloat)[theEvent data1];
|
||||
_frame.origin.y = (CGFloat)[theEvent data2];
|
||||
NSDebugLLog(@"Moving", @"Move event: %d %@",
|
||||
(int)_windowNum, NSStringFromPoint(_frame.origin));
|
||||
if (_autosaveName != nil)
|
||||
{
|
||||
[self saveFrameUsingName: _autosaveName];
|
||||
}
|
||||
[nc postNotificationName: NSWindowDidMoveNotification
|
||||
object: self];
|
||||
{
|
||||
NSScreen *oldScreen;
|
||||
NSScreen *newScreen;
|
||||
oldScreen = [self screen];
|
||||
_frame.origin.x = (CGFloat)[theEvent data1];
|
||||
_frame.origin.y = (CGFloat)[theEvent data2];
|
||||
newScreen = [self screen];
|
||||
NSDebugLLog(@"Moving", @"Move event: %d %@",
|
||||
(int)_windowNum, NSStringFromPoint(_frame.origin));
|
||||
if (_autosaveName != nil)
|
||||
{
|
||||
[self saveFrameUsingName: _autosaveName];
|
||||
}
|
||||
[nc postNotificationName: NSWindowDidMoveNotification
|
||||
object: self];
|
||||
if (newScreen != oldScreen)
|
||||
{
|
||||
[nc postNotificationName: NSWindowDidChangeScreenNotification
|
||||
object: self];
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case GSAppKitWindowResized:
|
||||
|
|
Loading…
Reference in a new issue