Revision: 15535 http://sourceforge.net/p/skim-app/code/15535 Author: hofman Date: 2025-06-23 22:00:03 +0000 (Mon, 23 Jun 2025) Log Message: ----------- Make sure color panel accessory view is cleared when going into presentation. Simpler check for window.
Modified Paths: -------------- trunk/SKMainWindowController_FullScreen.m trunk/SKMainWindowController_UI.m Modified: trunk/SKMainWindowController_FullScreen.m =================================================================== --- trunk/SKMainWindowController_FullScreen.m 2025-06-23 21:49:35 UTC (rev 15534) +++ trunk/SKMainWindowController_FullScreen.m 2025-06-23 22:00:03 UTC (rev 15535) @@ -233,6 +233,8 @@ // remember normal setup to return to, we must do this before changing the interactionMode [savedNormalSetup setDictionary:[pdfView displaySettings]]; + if ([[[NSColorPanel sharedColorPanel] accessoryView] isEqual:colorAccessoryView] || [[[NSColorPanel sharedColorPanel] accessoryView] isEqual:textColorAccessoryView]) + [[NSColorPanel sharedColorPanel] setAccessoryView:nil]; NSWindow *normalWindow = [self window]; savedNormalWindow = normalWindow; Modified: trunk/SKMainWindowController_UI.m =================================================================== --- trunk/SKMainWindowController_UI.m 2025-06-23 21:49:35 UTC (rev 15534) +++ trunk/SKMainWindowController_UI.m 2025-06-23 22:00:03 UTC (rev 15535) @@ -232,38 +232,31 @@ #pragma mark NSWindow delegate protocol - (void)windowDidBecomeMain:(NSNotification *)notification { - if ([self interactionMode] != SKPresentationMode) + if ([self interactionMode] != SKPresentationMode) { [self updateUtilityPanel]; - else if ([NSApp isActive] && [[NSUserDefaults standardUserDefaults] boolForKey:SKUseNormalLevelForPresentationKey] == NO && [[self window] isEqual:savedNormalWindow] == NO) + } else if ([NSApp isActive] && [[NSUserDefaults standardUserDefaults] boolForKey:SKUseNormalLevelForPresentationKey] == NO && [self window] != savedNormalWindow) { [[self window] setLevel:NSPopUpMenuWindowLevel]; + } } - (void)windowDidResignMain:(NSNotification *)notification { - [[SKImageToolTipWindow sharedToolTipWindow] orderOut:nil]; - if ([[[NSColorPanel sharedColorPanel] accessoryView] isEqual:colorAccessoryView] || [[[NSColorPanel sharedColorPanel] accessoryView] isEqual:textColorAccessoryView]) - [[NSColorPanel sharedColorPanel] setAccessoryView:nil]; - if ([self interactionMode] == SKPresentationMode && [[NSUserDefaults standardUserDefaults] boolForKey:SKUseNormalLevelForPresentationKey] == NO && [[self window] isEqual:savedNormalWindow] == NO) + if ([self interactionMode] != SKPresentationMode) { + [[SKImageToolTipWindow sharedToolTipWindow] orderOut:nil]; + if ([[[NSColorPanel sharedColorPanel] accessoryView] isEqual:colorAccessoryView] || [[[NSColorPanel sharedColorPanel] accessoryView] isEqual:textColorAccessoryView]) + [[NSColorPanel sharedColorPanel] setAccessoryView:nil]; + } else if ([[NSUserDefaults standardUserDefaults] boolForKey:SKUseNormalLevelForPresentationKey] == NO && [self window] != savedNormalWindow) { [[self window] setLevel:NSNormalWindowLevel]; + } } - (void)windowDidResignKey:(NSNotification *)notification { - [[SKImageToolTipWindow sharedToolTipWindow] orderOut:nil]; + if ([self interactionMode] != SKPresentationMode) { + [[SKImageToolTipWindow sharedToolTipWindow] orderOut:nil]; + } } -- (void)windowWillClose:(NSNotification *)notification { - [(id)[self document] windowWillClose:notification]; - - if ([[pdfView document] isFinding]) - [[pdfView document] cancelFindString]; - - if ((mwcFlags.isEditingTable || [pdfView isEditing]) && [self commitEditing] == NO) - [self discardEditing]; - - [self cleanup]; // clean up everything -} - - (void)windowDidChangeScreen:(NSNotification *)notification { - if ([self interactionMode] == SKPresentationMode && [[self window] isEqual:savedNormalWindow] == NO) { + if ([self interactionMode] == SKPresentationMode && [self window] != savedNormalWindow) { NSScreen *screen = [[self window] screen]; [[self window] setFrame:[screen frame] display:NO]; if (sideWindow) { @@ -277,13 +270,14 @@ } - (void)windowDidMove:(NSNotification *)notification { - if ([self interactionMode] == SKPresentationMode && [[self window] isEqual:savedNormalWindow] == NO) { + if ([self interactionMode] == SKPresentationMode && [self window] != savedNormalWindow) { if ([[self window] styleMask] == NSWindowStyleMaskBorderless) { NSScreen *screen = [[self window] screen]; NSRect screenFrame = [screen frame]; if (NSEqualRects(screenFrame, [[self window] frame]) == NO) [[self window] setFrame:screenFrame display:NO]; - } else if (sideWindow) { + } + if (sideWindow) { NSRect screenFrame = [[[self window] screen] frame]; NSRect frame = [sideWindow frame]; frame.origin.x = NSMinX(screenFrame); @@ -303,6 +297,18 @@ } } +- (void)windowWillClose:(NSNotification *)notification { + [(id)[self document] windowWillClose:notification]; + + if ([[pdfView document] isFinding]) + [[pdfView document] cancelFindString]; + + if ((mwcFlags.isEditingTable || [pdfView isEditing]) && [self commitEditing] == NO) + [self discardEditing]; + + [self cleanup]; // clean up everything +} + - (id)windowWillReturnFieldEditor:(NSWindow *)window toObject:(id)anObject { if (fieldEditor == nil) { fieldEditor = [[SKFieldEditor alloc] init]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ Skim-app-commit mailing list Skim-app-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/skim-app-commit