Revision: 13694
http://sourceforge.net/p/skim-app/code/13694
Author: hofman
Date: 2023-10-25 15:40:13 +0000 (Wed, 25 Oct 2023)
Log Message:
-----------
Use custom windowFrame animatable property for animation of full screen window
to avoid bug in restricting target frame when using setFrame:display: on 12+
Modified Paths:
--------------
trunk/SKMainWindow.h
trunk/SKMainWindow.m
trunk/SKMainWindowController_FullScreen.m
Modified: trunk/SKMainWindow.h
===================================================================
--- trunk/SKMainWindow.h 2023-10-24 15:08:32 UTC (rev 13693)
+++ trunk/SKMainWindow.h 2023-10-25 15:40:13 UTC (rev 13694)
@@ -49,6 +49,7 @@
}
@property (nonatomic) BOOL disableConstrainedFrame;
+@property (nonatomic) NSRect windowFrame;
- (id<SKMainWindowDelegate>)delegate;
- (void)setDelegate:(id<SKMainWindowDelegate>)newDelegate;
Modified: trunk/SKMainWindow.m
===================================================================
--- trunk/SKMainWindow.m 2023-10-24 15:08:32 UTC (rev 13693)
+++ trunk/SKMainWindow.m 2023-10-25 15:40:13 UTC (rev 13694)
@@ -45,7 +45,23 @@
@implementation SKMainWindow
@synthesize disableConstrainedFrame;
+@dynamic windowFrame;
++ (id)defaultAnimationForKey:(NSString *)key {
+ if ([key isEqualToString:@"windowFrame"])
+ return [CABasicAnimation animation];
+ else
+ return [super defaultAnimationForKey:key];
+}
+
+- (NSRect)windowFrame {
+ return [self frame];
+}
+
+- (void)setWindowFrame:(NSRect)frameRect {
+ [self setFrame:frameRect display:YES];
+}
+
- (void)sendEvent:(NSEvent *)theEvent {
if ([theEvent type] == NSEventTypeLeftMouseDown || [theEvent type] ==
NSEventTypeRightMouseDown || [theEvent type] == NSEventTypeKeyDown) {
if ([[self delegate]
respondsToSelector:@selector(window:willSendEvent:)])
Modified: trunk/SKMainWindowController_FullScreen.m
===================================================================
--- trunk/SKMainWindowController_FullScreen.m 2023-10-24 15:08:32 UTC (rev
13693)
+++ trunk/SKMainWindowController_FullScreen.m 2023-10-25 15:40:13 UTC (rev
13694)
@@ -670,7 +670,7 @@
[(SKMainWindow *)window setDisableConstrainedFrame:YES];
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) {
[context setDuration:duration - 0.02];
- [[window animator] setFrame:frame display:YES];
+ [[(SKMainWindow *)window animator] setWindowFrame:frame];
setAlphaValueOfTitleBarControls(window, 0.0, YES);
}
completionHandler:^{
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