Skip to content

Commit

Permalink
Merge pull request #94 from dousherve/arc
Browse files Browse the repository at this point in the history
Hide cursor in fullscreen
  • Loading branch information
nickv2002 authored Mar 28, 2023
2 parents a967841 + 034a176 commit 7372634
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions Classes/Session/TSSTSessionWindowController.m
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ - (void)mouseMoved:(NSEvent *)theEvent
}

[self refreshLoupePanel];

[self handleFullscreenCursorHiding];
}


Expand Down Expand Up @@ -397,6 +399,15 @@ - (void)infoPanelSetupAtPoint:(NSPoint)point
right: NSMaxX([[bar window] frame])];
}

- (void)handleFullscreenCursorHiding
{
if ([[self window] isFullscreen])
{
// Invalidate eventual previous timer to prevent cursor flickering
[mouseMovedTimer invalidate];
mouseMovedTimer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(hideCursor) userInfo:nil repeats:NO];
}
}

#pragma mark - Actions

Expand Down Expand Up @@ -1052,12 +1063,9 @@ - (NSURL *)fileURL

- (void)hideCursor
{
[mouseMovedTimer invalidate];
mouseMovedTimer = nil;

if([[self window] isFullscreen])
{
[NSCursor setHiddenUntilMouseMoves: YES];
}
[NSCursor setHiddenUntilMouseMoves: YES];
}


Expand Down

0 comments on commit 7372634

Please sign in to comment.