Revision: 15317
http://sourceforge.net/p/skim-app/code/15317
Author: hofman
Date: 2025-05-28 14:29:30 +0000 (Wed, 28 May 2025)
Log Message:
-----------
No need for presentation wwindow to be a subclass of SKMainWindow. Implement
rightMouseDown: instead of intercepting riht mouse down events.
Modified Paths:
--------------
trunk/SKFullScreenWindow.h
trunk/SKFullScreenWindow.m
trunk/SKMainWindowController_FullScreen.m
trunk/SKPresentationView.m
Modified: trunk/SKFullScreenWindow.h
===================================================================
--- trunk/SKFullScreenWindow.h 2025-05-28 09:39:56 UTC (rev 15316)
+++ trunk/SKFullScreenWindow.h 2025-05-28 14:29:30 UTC (rev 15317)
@@ -37,19 +37,13 @@
*/
#import <Cocoa/Cocoa.h>
-#import "SKMainWindow.h"
NS_ASSUME_NONNULL_BEGIN
-@interface SKFullScreenWindow : SKMainWindow
+@interface SKFullScreenWindow : NSWindow
- (instancetype)initWithContentRect:(NSRect)contentRect;
@end
-
-@interface NSWindowController (SKMainFullScreenWindow)
-- (BOOL)handleRightMouseDown:(NSEvent *)theEvent;
-@end
-
NS_ASSUME_NONNULL_END
Modified: trunk/SKFullScreenWindow.m
===================================================================
--- trunk/SKFullScreenWindow.m 2025-05-28 09:39:56 UTC (rev 15316)
+++ trunk/SKFullScreenWindow.m 2025-05-28 14:29:30 UTC (rev 15317)
@@ -52,7 +52,6 @@
[self setFrame:contentRect display:NO];
[self setAnimationBehavior:NSWindowAnimationBehaviorNone];
[self setCollectionBehavior:NSWindowCollectionBehaviorManaged];
- [[self contentView] setWantsLayer:YES];
}
return self;
}
@@ -61,17 +60,9 @@
- (BOOL)canBecomeMainWindow { return YES; }
-- (void)sendEvent:(NSEvent *)theEvent {
- if ([theEvent type] == NSEventTypeRightMouseDown || ([theEvent type] ==
NSEventTypeLeftMouseDown && ([theEvent modifierFlags] &
NSEventModifierFlagControl))) {
- if ([[self windowController]
respondsToSelector:@selector(handleRightMouseDown:)] && [[self
windowController] handleRightMouseDown:theEvent])
- return;
- }
- [super sendEvent:theEvent];
-}
-
- (void)cancelOperation:(id)sender {
// for some reason this action method is not passed on to the window
controller, so we do this ourselves
- if ([[self windowController]
respondsToSelector:@selector(cancelOperation:)])
+ if ([[self windowController] respondsToSelector:_cmd])
[[self windowController] cancelOperation:self];
}
Modified: trunk/SKMainWindowController_FullScreen.m
===================================================================
--- trunk/SKMainWindowController_FullScreen.m 2025-05-28 09:39:56 UTC (rev
15316)
+++ trunk/SKMainWindowController_FullScreen.m 2025-05-28 14:29:30 UTC (rev
15317)
@@ -145,14 +145,6 @@
#pragma mark Presentation Support Methods
-- (BOOL)handleRightMouseDown:(NSEvent *)theEvent {
- if ([self interactionMode] == SKPresentationMode) {
- [self doGoToPreviousPage:nil];
- return YES;
- }
- return NO;
-}
-
- (void)showNotesForPresentationWindow:(NSWindow *)window {
PDFDocument *pdfDoc = [[self presentationNotesDocument] pdfDocument];
NSInteger offset = [self presentationNotesOffset];
Modified: trunk/SKPresentationView.m
===================================================================
--- trunk/SKPresentationView.m 2025-05-28 09:39:56 UTC (rev 15316)
+++ trunk/SKPresentationView.m 2025-05-28 14:29:30 UTC (rev 15317)
@@ -806,6 +806,10 @@
}
}
+- (void)rightMouseDown:(NSEvent *)theEvent {
+ [self goToPreviousPage:nil];
+}
+
- (void)mouseMoved:(NSEvent *)theEvent {
pvFlags.cursorHidden = NO;
[self setCursorForMouse:theEvent];
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