Revision: 14026
http://sourceforge.net/p/skim-app/code/14026
Author: hofman
Date: 2024-01-30 17:07:00 +0000 (Tue, 30 Jan 2024)
Log Message:
-----------
Always make window layer backed, so we don't have to change this for
animations. The check there did not work anyway, I am not sure how layer backed
works in practice, it is not as documented.
Modified Paths:
--------------
trunk/SKMainWindowController.m
trunk/SKMainWindowController_FullScreen.m
trunk/SKSideViewController.m
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2024-01-29 16:45:53 UTC (rev 14025)
+++ trunk/SKMainWindowController.m 2024-01-30 17:07:00 UTC (rev 14026)
@@ -341,6 +341,9 @@
if (@available(macOS 11.0, *))
[window setToolbarStyle:NSWindowToolbarStyleExpanded];
+ // for animations
+ [[window contentView] setWantsLayer:YES];
+
if (mwcFlags.fullSizeContent) {
titleBarHeight = NSHeight([window frame]) - NSHeight([window
contentLayoutRect]);
[leftSideController setTopInset:titleBarHeight];
@@ -1576,11 +1579,6 @@
[[SKImageToolTipWindow sharedToolTipWindow] orderOut:nil];
if (animate) {
- BOOL hasLayer = [contentView wantsLayer] || [contentView layer] != nil;
- if (hasLayer == NO) {
- [contentView setWantsLayer:YES];
- [contentView displayIfNeeded];
- }
[NSAnimationContext runAnimationGroup:^(NSAnimationContext * context){
[[contentView animator] replaceSubview:oldView
with:overviewContentView];
[NSLayoutConstraint activateConstraints:constraints];
@@ -1587,8 +1585,6 @@
}
completionHandler:^{
[touchBarController overviewChanged];
- if (hasLayer == NO)
- [contentView setWantsLayer:NO];
}];
} else {
[contentView replaceSubview:oldView with:overviewContentView];
@@ -1621,11 +1617,6 @@
[NSLayoutConstraint constraintWithItem:hasStatus ? statusBar :
contentView attribute:hasStatus ? NSLayoutAttributeTop :
NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:newView
attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0.0]];
if (animate) {
- BOOL hasLayer = [contentView wantsLayer] || [contentView layer] != nil;
- if (hasLayer == NO) {
- [contentView setWantsLayer:YES];
- [contentView displayIfNeeded];
- }
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){
[[contentView animator] replaceSubview:overviewContentView
with:newView];
[NSLayoutConstraint activateConstraints:constraints];
@@ -1634,8 +1625,6 @@
[touchBarController overviewChanged];
if ([pdfView window] == [self window])
[[self window] makeFirstResponder:pdfView];
- if (hasLayer == NO)
- [contentView setWantsLayer:NO];
if (handler)
handler();
}];
Modified: trunk/SKMainWindowController_FullScreen.m
===================================================================
--- trunk/SKMainWindowController_FullScreen.m 2024-01-29 16:45:53 UTC (rev
14025)
+++ trunk/SKMainWindowController_FullScreen.m 2024-01-30 17:07:00 UTC (rev
14026)
@@ -294,6 +294,7 @@
[mainWindow setDelegate:nil];
[self setWindow:fullScreenWindow];
+ [[fullScreenWindow contentView] setWantsLayer:YES];
[fullScreenWindow setAlphaValue:0.0];
[fullScreenWindow orderFront:nil];
[fullScreenWindow makeKeyWindow];
Modified: trunk/SKSideViewController.m
===================================================================
--- trunk/SKSideViewController.m 2024-01-29 16:45:53 UTC (rev 14025)
+++ trunk/SKSideViewController.m 2024-01-30 17:07:00 UTC (rev 14026)
@@ -96,7 +96,6 @@
BOOL changeButton = wasAlternate != isAlternate;
NSSegmentedControl *oldButton = wasAlternate ? alternateButton : button;
NSSegmentedControl *newButton = isAlternate ? alternateButton : button;
- NSView *buttonView = [oldButton superview];
NSView *contentView = [oldView superview];
id firstResponder = [[oldView window] firstResponder];
@@ -128,26 +127,6 @@
} else {
isAnimating = YES;
- BOOL hasLayer = YES;
-
- if (@available(macOS 10.14, *)) {
- hasLayer = [[self view] wantsLayer] || [[self view] layer] != nil;
- if (hasLayer == NO) {
- [[self view] setWantsLayer:YES];
- [[self view] displayIfNeeded];
- }
- } else {
- hasLayer = [contentView wantsLayer] || [contentView layer] != nil;
- if (hasLayer == NO) {
- [contentView setWantsLayer:YES];
- [contentView displayIfNeeded];
- if (changeButton) {
- [buttonView setWantsLayer:YES];
- [buttonView displayIfNeeded];
- }
- }
- }
-
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){
[context setDuration:DURATION];
[[contentView animator] replaceSubview:oldView with:newView];
@@ -158,15 +137,6 @@
}
}
completionHandler:^{
- if (hasLayer == NO) {
- if (@available(macOS 10.14, *)) {
- [[self view] setWantsLayer:NO];
- } else {
- [contentView setWantsLayer:NO];
- if (changeButton)
- [buttonView setWantsLayer:NO];
- }
- }
[[firstResponder window] makeFirstResponder:firstResponder];
[[contentView window] recalculateKeyViewLoop];
isAnimating = NO;
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