fix(mac): disable the help button entirely in the title bar of OSK

On macOS 26 Tahoe, adding the help button causes the caption of the OSK
to overlap the window controls, preventing the OSK from being closed.
Disabling the help button is a stop-gap workaround; the help is still
available from the Configuration window. This should be considered for
re-engineering in 19.0 beta or 20.0 alpha.

Not marking the issue as fixed but allows us to postpone deeper
engineering.

Relates-to: #16571
This commit is contained in:
Marc Durdin 2026-09-28 10:40:53 +02:00
parent 7090b835c8
commit f1031e4ffc

View file

@ -39,9 +39,14 @@
[self.window setMaxSize:NSMakeSize(size.width*1.6, size.height*1.6)];
[self.window setMinSize:NSMakeSize(size.width*0.8, size.height*0.8)];
[self.window setBackgroundColor:[NSColor colorWithSRGBRed:241.0/255.0 green:242.0/255.0 blue:242.0/255.0 alpha:1.0]];
// # 1079: Versions of macOS prior to 10.10 do not support setting control size.
// #1079: Versions of macOS prior to 10.10 do not support setting control size.
// Safest to just not add the help button at all on the OSK.
/* #16571 - disabling the help button in the title bar entirely for now as on Tahoe it
pushes the title over the window controls. The help is still accessible
through the menu. This is a stop-gap while we re-engineer this in a
future release.
NSButton *helpBtn = [[NSButton alloc] initWithFrame:NSMakeRect(0, 0, 17, 17)];
if (helpBtn && [helpBtn respondsToSelector:@selector(setControlSize:)]) {
_helpButton = helpBtn;
@ -52,6 +57,7 @@
[_helpButton setEnabled:[self hasHelpDocumentation]];
[self.window addViewToTitleBar:_helpButton positionX:NSWidth(self.window.frame) - NSWidth(_helpButton.frame) -10];
}
*/
}
- (void)windowDidLoad {
@ -74,7 +80,7 @@
- (void)windowWillClose:(NSNotification *)notification {
os_log_debug([KMLogs oskLog], "OSKWindowController windowWillClose");
[KMSettingsRepository.shared writeShowOskOnActivate:NO];
// whenever the OSK is closing clear all of its modifier keys
[self.oskView clearOskModifiers];
[KMSentryHelper addOskVisibleTag:NO];
@ -84,12 +90,12 @@
NSString *kvkPath = [self AppDelegate].kvk.filePath;
if (!kvkPath)
return;
NSString *packagePath = [kvkPath stringByDeletingLastPathComponent];
if (packagePath != nil) {
if (self.AppDelegate.kbHelpWindow_.window != nil)
[self.AppDelegate.kbHelpWindow_ close];
[self.AppDelegate.kbHelpWindow.window centerInParent];
[self.AppDelegate.kbHelpWindow.window makeKeyAndOrderFront:nil];
[self.AppDelegate.kbHelpWindow.window setLevel:NSFloatingWindowLevel];
@ -142,7 +148,7 @@
*/
- (void)timerAction:(NSTimer *)timer {
UInt32 modifiers = GetCurrentKeyModifiers();
[self trackPhysicalShiftKeyState: modifiers];
[self trackPhysicalOptionKeyState: modifiers];
[self trackPhysicalControlKeyState: modifiers];
@ -195,7 +201,7 @@
if (!kvkPath) {
return NO;
}
NSString *packagePath = [kvkPath stringByDeletingLastPathComponent];
if (packagePath != nil) {
NSString *welcomeFile = [packagePath stringByAppendingPathComponent:@"welcome.htm"];
@ -203,7 +209,7 @@
return YES;
}
}
return NO;
}