Merge branch 'master' into randr

Conflicts:
	ChangeLog
This commit is contained in:
Sergii Stoian 2020-03-05 02:19:23 +02:00
commit 6d4afe9678
3 changed files with 20 additions and 10 deletions

View file

@ -1,3 +1,8 @@
2020-02-28 Sergii Stoian <stoyan255@gmail.com>
* Source/NSWindow.m (center): always center window on main screen -
monitor where user expects to see window.
2020-02-26 Sergii Stoian <stoyan255@gmail.com>
* Source/NSWindow.m (sendEvent:): removed usage of extra local variables

View file

@ -178,6 +178,15 @@
is meant to make things friendlier for slow computers.
</p>
</desc>
<term>GSScaleFactor</term>
<desc>
<p>
A floating point number, <code>1.0</code> by default. Scales
GUI elements by the given factor for high-DPI monitors. DPI
auto-detection on some platforms (only Windows, for now) will
cause the default to appear to change.
</p>
</desc>
<term>GSUnknownFileTool</term>
<desc>
<p>

View file

@ -2087,16 +2087,12 @@ titleWithRepresentedFilename(NSString *representedFilename)
- (void) center
{
NSScreen *screen = [self screen];
NSSize screenSize;
NSPoint origin = _frame.origin;
if (screen == nil) {
screen = [NSScreen mainScreen];
}
screenSize = [screen visibleFrame].size;
origin.x = (screenSize.width - _frame.size.width) / 2;
origin.y = (screenSize.height - _frame.size.height) / 2;
NSRect screenFrame = [[NSScreen mainScreen] visibleFrame];
NSSize screenSize = screenFrame.size;
NSPoint origin = screenFrame.origin;
origin.x += (screenSize.width - _frame.size.width) / 2;
origin.y += (screenSize.height - _frame.size.height) / 2;
[self setFrameOrigin: origin];
}