Revision: 15318
          http://sourceforge.net/p/skim-app/code/15318
Author:   hofman
Date:     2025-05-29 09:16:45 +0000 (Thu, 29 May 2025)
Log Message:
-----------
Don't override nextResponder in side window, actions should reach the window 
controller through the main window. Implement cancelOperation by sending 
toggleLeftSidePane: to parent window's windowController.

Modified Paths:
--------------
    trunk/SKSideWindow.m

Modified: trunk/SKSideWindow.m
===================================================================
--- trunk/SKSideWindow.m        2025-05-28 14:29:30 UTC (rev 15317)
+++ trunk/SKSideWindow.m        2025-05-29 09:16:45 UTC (rev 15318)
@@ -44,6 +44,7 @@
 #import "NSColor_SKExtensions.h"
 #import "NSView_SKExtensions.h"
 #import "NSImage_SKExtensions.h"
+#import "SKMainWindowController_Actions.h"
 
 #define DEFAULT_WINDOW_WIDTH    300.0
 #define DEFAULT_WINDOW_HEIGHT   400.0
@@ -163,20 +164,14 @@
 
 - (void)keyDown:(NSEvent *)theEvent {
     if ([theEvent firstCharacter] == 't' && [theEvent 
deviceIndependentModifierFlags] == 0)
-        [self cancelOperation:self];
+        [[[self parentWindow] windowController] 
tryToPerform:@selector(toggleLeftSidePane:) with:self];
     else
         [super keyDown:theEvent];
 }
 
 - (void)cancelOperation:(id)sender {
-    // for some reason this action method is not passed on up the responder 
chain, so we do this ourselves
-    if ([[self nextResponder] respondsToSelector:@selector(cancelOperation:)])
-        [[self nextResponder] cancelOperation:self];
+    [[[self parentWindow] windowController] 
tryToPerform:@selector(toggleLeftSidePane:) with:self];
 }
-    
-- (NSResponder *)nextResponder {
-    return [[self parentWindow] windowController];
-}
 
 - (void)resizeWithEvent:(NSEvent *)theEvent {
     NSPoint initialLocation = [theEvent locationOnScreen];

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

Reply via email to