git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

commit 8d6ff9aafc8f87661ab9b461f721eaf10d7ecaee
parent 8a234a25a3c34cf98581152c474ec62711861605
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Thu, 11 Sep 2025 01:06:00 +0300

Redo the way debugging interacts with mouse hiding, fixes #724

Diffstat:
MCocoa/Document.m11++++++-----
MCocoa/GBView.m6++++++
2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/Cocoa/Document.m b/Cocoa/Document.m @@ -407,10 +407,12 @@ static void debuggerReloadCallback(GB_gameboy_t *gb) if (self.vramWindow.isVisible) { dispatch_async(dispatch_get_main_queue(), ^{ - self.view.mouseHidingEnabled = (self.mainWindow.styleMask & NSWindowStyleMaskFullScreen) != 0; [self reloadVRAMData: nil]; }); } + + self.view.mouseHidingEnabled = (_mainWindow.styleMask & NSWindowStyleMaskFullScreen) && !_consoleWindow.visible && !_memoryWindow.visible && !_vramWindow.visible && !_printerFeedWindow.visible && !_cheatsWindow.visible; + if (self.view.isRewinding) { _rewind = true; [self.osdView displayText:@"Rewinding…"]; @@ -1583,7 +1585,7 @@ enum GBWindowResizeAction } } -- (void) appendPendingOutput +- (void)appendPendingOutput { [_consoleOutputLock lock]; if (_shouldClearSideView) { @@ -1602,6 +1604,8 @@ enum GBWindowResizeAction } if ([[NSUserDefaults standardUserDefaults] boolForKey:@"DeveloperMode"]) { [self.consoleWindow orderFront:nil]; + /* Make sure mouse is not hidden while debugging */ + self.view.mouseHidingEnabled = false; } _pendingConsoleOutput = nil; } @@ -1650,9 +1654,6 @@ enum GBWindowResizeAction } [_consoleOutputLock unlock]; - - /* Make sure mouse is not hidden while debugging */ - self.view.mouseHidingEnabled = false; } - (IBAction)showConsoleWindow:(id)sender diff --git a/Cocoa/GBView.m b/Cocoa/GBView.m @@ -894,6 +894,12 @@ static const uint8_t workboy_vk_to_key[] = { - (void)setMouseHidingEnabled:(bool)mouseHidingEnabled { if (mouseHidingEnabled == _mouseHidingEnabled) return; + if (![NSThread isMainThread]) { + dispatch_async(dispatch_get_main_queue(), ^{ + [self setMouseHidingEnabled:mouseHidingEnabled]; + }); + return; + } _mouseHidingEnabled = mouseHidingEnabled;

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.