adium 5773:a0b7e4250562: Fixes HiDPI mode detection if a seconda...
commits at adium.im
commits at adium.im
Wed Dec 4 16:35:15 UTC 2013
details: http://hg.adium.im/adium/rev/a0b7e4250562
revision: 5773:a0b7e4250562
branch: adium-1.5.10
author: Johannes Loepelmann <johannes at loepelmann.de>
date: Wed Dec 04 17:17:21 2013 +0100
Fixes HiDPI mode detection if a secondary display is connected and set as primary
- if a secondary display was connected to a retina mbp and set as the primary display, adium would fail to detect HiDPI and set avatar images too large for some services, causing disconnects from i.e. jabber services due to "policy violation"
- Fixes Ticket #16552
r=xnyhps
diffs (37 lines):
diff -r 780fbb0dd353 -r a0b7e4250562 Copyright.txt
--- a/Copyright.txt Wed Dec 04 17:25:21 2013 +0100
+++ b/Copyright.txt Wed Dec 04 17:17:21 2013 +0100
@@ -72,6 +72,7 @@
Jack M.H. Lin
Paul R. Livesey
Daniel Ljungborg
+Johannes Loepelmann
Casey Lutz
Jeff Mahoney
Andreas Marienborg
diff -r 780fbb0dd353 -r a0b7e4250562 Frameworks/AIUtilities Framework/Source/AIImageDrawingAdditions.m
--- a/Frameworks/AIUtilities Framework/Source/AIImageDrawingAdditions.m Wed Dec 04 17:25:21 2013 +0100
+++ b/Frameworks/AIUtilities Framework/Source/AIImageDrawingAdditions.m Wed Dec 04 17:17:21 2013 +0100
@@ -67,10 +67,18 @@
- (NSImage *)imageByScalingToSize:(NSSize)size DPI:(CGFloat)dpi
{
CGFloat backingScaleFactor = dpi / 72.0;
-
- if ([[NSScreen mainScreen] respondsToSelector:@selector(backingScaleFactor)]) {
- backingScaleFactor /= [[NSScreen mainScreen] backingScaleFactor];
- }
+
+ CGFloat screenScalingFactor = 1.0;
+
+ for(NSScreen* screen in [NSScreen screens]) {
+ if ([screen respondsToSelector:@selector(backingScaleFactor)]) {
+ if([screen backingScaleFactor] > screenScalingFactor) {
+ screenScalingFactor = [screen backingScaleFactor];
+ }
+ }
+ }
+
+ backingScaleFactor /= screenScalingFactor;
return ([self imageByScalingToSize:NSMakeSize(size.width * backingScaleFactor, size.height * backingScaleFactor) fraction:1.0f flipImage:NO proportionally:YES allowAnimation:YES]);
}
More information about the commits
mailing list