Revision: 14224
          http://sourceforge.net/p/skim-app/code/14224
Author:   hofman
Date:     2024-04-19 14:52:11 +0000 (Fri, 19 Apr 2024)
Log Message:
-----------
capture window screenshot with best resolution

Modified Paths:
--------------
    trunk/SKMainWindowController_FullScreen.m
    trunk/SKSnapshotWindowController.m

Modified: trunk/SKMainWindowController_FullScreen.m
===================================================================
--- trunk/SKMainWindowController_FullScreen.m   2024-04-19 14:29:19 UTC (rev 
14223)
+++ trunk/SKMainWindowController_FullScreen.m   2024-04-19 14:52:11 UTC (rev 
14224)
@@ -312,7 +312,7 @@
 
 - (void)displayStaticContentForWindow:(NSWindow *)window {
     NSRect frame = [window frame];
-    CGImageRef cgImage = CGWindowListCreateImage(CGRectNull, 
kCGWindowListOptionIncludingWindow, (CGWindowID)[window windowNumber], 
kCGWindowImageBoundsIgnoreFraming);
+    CGImageRef cgImage = CGWindowListCreateImage(CGRectNull, 
kCGWindowListOptionIncludingWindow, (CGWindowID)[window windowNumber], 
kCGWindowImageBoundsIgnoreFraming | kCGWindowImageBestResolution);
     if (([window styleMask] & NSWindowStyleMaskFullScreen) != 0 && 
autoHideToolbarInFullScreen == NO && [[window toolbar] isVisible]) {
         NSWindow *tbWindow = nil;
         for (tbWindow in [window childWindows])
@@ -319,7 +319,7 @@
             if ([NSStringFromClass([tbWindow class]) 
containsString:@"Toolbar"])
                 break;
         if (tbWindow) {
-            CGImageRef tbCgImage = CGWindowListCreateImage(CGRectNull, 
kCGWindowListOptionIncludingWindow, (CGWindowID)[tbWindow windowNumber], 
kCGWindowImageBoundsIgnoreFraming);
+            CGImageRef tbCgImage = CGWindowListCreateImage(CGRectNull, 
kCGWindowListOptionIncludingWindow, (CGWindowID)[tbWindow windowNumber], 
kCGWindowImageBoundsIgnoreFraming | kCGWindowImageBestResolution);
             NSRect tbFrame = [tbWindow frame];
             size_t width = CGImageGetWidth(cgImage), height = 
CGImageGetHeight(cgImage);
             CGFloat sx = width / NSWidth(frame), sy = height / NSHeight(frame);

Modified: trunk/SKSnapshotWindowController.m
===================================================================
--- trunk/SKSnapshotWindowController.m  2024-04-19 14:29:19 UTC (rev 14223)
+++ trunk/SKSnapshotWindowController.m  2024-04-19 14:52:11 UTC (rev 14224)
@@ -635,7 +635,7 @@
             canUseCGWindowAPI = NO;
         
         if (canUseCGWindowAPI) {
-            CGImageRef cgImage = CGWindowListCreateImage(CGRectNull, 
kCGWindowListOptionIncludingWindow, (CGWindowID)[window windowNumber], 
kCGWindowImageBoundsIgnoreFraming);
+            CGImageRef cgImage = CGWindowListCreateImage(CGRectNull, 
kCGWindowListOptionIncludingWindow, (CGWindowID)[window windowNumber], 
kCGWindowImageBoundsIgnoreFraming | kCGWindowImageBestResolution);
             windowImage = [[NSImage alloc] initWithCGImage:cgImage 
size:windowRect.size];
             CGImageRelease(cgImage);
         } else {

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to