[sorry, I sent this to bug-gnustep, then was told that this was a better 
forum...]


 From:   Graham Lee <gra...@iamleeg.com> 
 To:   <bug-gnus...@gnu.org> 
 Sent:   2/5/2017 12:27 PM 
 Subject:   [proposed patch] GORM and hi-dpi 

Hi folks, 
 
GORM does not draw its palette views correctly when the display scale  
factor is anything other than 1.0. Well, what I actually think is that  
each palette does not create its own content view correctly, but that  
means a different patch per palette. 
 
I worked with Steven Baker here at FOSDEM to patch it, and the  
per-palette patch looks like the attached file. I'd like to discuss  
whether writing this patch another four times for the other palettes is  
appropriate, or whether there's a preferable alternative to do this. 
 
Cheers, 
 
Graham. 
 
Index: Palettes/1Windows/WindowsPalette.m
===================================================================
--- Palettes/1Windows/WindowsPalette.m	(revision 40319)
+++ Palettes/1Windows/WindowsPalette.m	(working copy)
@@ -112,9 +112,12 @@
   NSString	*drawerPath = [bundle pathForImageResource: @"Drawer"];
   NSImage	*drawerImage = [[NSImage alloc] initWithContentsOfFile: drawerPath];
   NSFont        *systemFont = [NSFont boldSystemFontOfSize: [NSFont systemFontSize]];
+  float         scaleFactor = [[NSScreen mainScreen] userSpaceScaleFactor];
+  float         contentWidth = 272.0 * scaleFactor;
+  float         contentHeight = 192.0 * scaleFactor;
+  NSRect        contentRect = NSMakeRect(0, 0, contentWidth, contentHeight);
   RELEASE(originalWindow);
-  originalWindow = [[NSWindow alloc] initWithContentRect: 
-				       NSMakeRect(0, 0, 272, 192)
+  originalWindow = [[NSWindow alloc] initWithContentRect: contentRect
 				     styleMask: NSBorderlessWindowMask 
 				     backing: NSBackingStoreRetained
 				     defer: NO];
_______________________________________________
Gnustep-dev mailing list
Gnustep-dev@gnu.org
https://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to