* Source/NSWindow.m (setFrame:display:): use _screeForFrame: here

to prevent `_screen` reassign -  it will be reassigned in
  sendEvent: (GSAppKitWindowMoved event) after call to [self screen].
  (setFrameFromString:): removed unused code because _screenForFrame:
  never returns `nil`. Do not reassign `_screen` here.
This commit is contained in:
Sergii Stoian 2020-02-13 18:30:04 +02:00
parent 381c24cdf4
commit 533be55806
2 changed files with 11 additions and 15 deletions

View file

@ -1,3 +1,11 @@
2020-02-13 Sergii Stoian <stoyan255@gmail.com>
* Source/NSWindow.m (setFrame:display:): use _screeForFrame: here
to prevent `_screen` reassign - it will be reassigned in
sendEvent: (GSAppKitWindowMoved event) after call to [self screen].
(setFrameFromString:): removed unused code because _screenForFrame:
never returns `nil`. Do not reassign `_screen` here.
2020-02-12 Sergii Stoian <stoyan255@gmail.com>
* Source/NSWindow.m (sendEvent:): set current screen to ivar and

View file

@ -2249,12 +2249,13 @@ titleWithRepresentedFilename(NSString *representedFilename)
{
frameRect.size.height = _minimumSize.height;
}
/* Windows need to be constrained when displayed or resized - but only
titled windows are constrained */
if (_styleMask & NSTitledWindowMask)
{
frameRect = [self constrainFrameRect: frameRect toScreen: [self screen]];
frameRect = [self constrainFrameRect: frameRect
toScreen: [self _screenForFrame: frameRect]];
}
// If nothing changes, don't send it to the backend and don't redisplay
@ -4972,16 +4973,6 @@ current key view.<br />
* the window could be placed (ie a rectangle excluding the dock).
*/
screen = [self _screenForFrame: fRect];
// Check whether a portion is showing somewhere...
if (screen == nil)
{
// If the window doesn't show up on any screen then we need
// to move it so it can be seen and assign it to the main
// screen...
screen = [NSScreen mainScreen];
NSDebugLLog(@"NSWindow", @"%s: re-assigning to main screen\n", __PRETTY_FUNCTION__);
}
nRect = [screen visibleFrame];
/*
@ -5033,9 +5024,6 @@ current key view.<br />
}
}
// Make sure we are using the new screen we are applying to...
ASSIGN(_screen, screen);
/*
* Set frame.
*/