libnativeapi / libnativeapi/nativeapi
[Bug] Double-click on title bar doesn't work when title bar is hidden on macOS
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- C++
- Estrellas
- 34
- Forks
- 7
- Merge medio
- 3 d 1 h
- PR fusionados (30 d)
- 1
Descripción
Description
When a window has its title bar hidden (using TitleBarStyle::Hidden), double-clicking on the title bar area does not trigger the expected system behavior (zoom/maximize or minimize) on macOS. The window appears to ignore double-click events in the title bar region entirely.
Environment
- Platform: macOS
- Affected versions: All versions (tested on macOS Ventura and later)
- Window style:
TitleBarStyle::Hidden
Steps to Reproduce
- Create a window with
TitleBarStyle::Hiddenset:window_ptr->SetTitleBarStyle(nativeapi::TitleBarStyle::Hidden); - Run the application
- Double-click on the title bar area of the window (the region where the title bar would normally be)
- Observe that nothing happens
Expected Behavior
Double-clicking on the title bar area should trigger the system default action based on the user's "AppleActionOnDoubleClick" system preference:
- Zoom/Maximize (default behavior)
- Minimize (if configured in System Settings → Desktop & Dock → Double-click a window's title bar to)
This should match the behavior of standard macOS applications.
Actual Behavior
The double-click event is either:
- Not being received by the window, or
- Being received but not processed because the window doesn't recognize clicks in the title bar area when the title bar is hidden
The window remains in its current state without any zoom or minimize action occurring.
Root Cause Analysis
When TitleBarStyle::Hidden is applied, the window's title bar is visually hidden, but more importantly, the window's default double-click handling for the title bar area appears to be disabled. Standard NSWindow behavior relies on the title bar being present and interactive to handle double-click events.
The current implementation does not override mouseUp: or any other mouse event handler to manually detect and handle double-clicks in the title bar region when the title bar is hidden.
Additional Context
- This issue does not occur when the title bar is visible (default behavior works correctly)
- The issue affects all windows created with
TitleBarStyle::Hidden - Users expect consistent behavior regardless of title bar visibility
- This is a UX regression that makes windows with hidden title bars feel inconsistent with native macOS applications
Impact
- Users cannot use the standard double-click gesture to zoom/maximize or minimize windows
- Applications using hidden title bars lose this common macOS interaction pattern
- May confuse users who expect consistent window management behavior
Related Code
- File:
src/platform/macos/window_macos.mm - The current
NSWindowimplementation does not have custom mouse event handling for double-click detection in the title bar area when the title bar is hidden
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Inspecciona src/platform/macos/window_macos.mm, centrándote en el manejo de NSWindow para TitleBarStyle::Hidden y en los eventos del ratón en el área de la barra de título. Reproduce el problema en macOS con ambas configuraciones de AppleActionOnDoubleClick. Se considera terminado cuando hacer doble clic en la región oculta de la barra de título amplía o minimiza según la preferencia del sistema, mientras que las barras de título visibles permanecen sin cambios.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- cpp, macos, objective-c
- Área
- desktop, operating-systems
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Tranquilo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 68/100