libnativeapi / libnativeapi/nativeapi

[Bug] Double-click on title bar doesn't work when title bar is hidden on macOS

Offen
#48 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
C++
Sterne
34
Forks
7
Ø Merge
3 T. 1 Std.
Gemergte PRs (30 T.)
1

Beschreibung

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

  1. Create a window with TitleBarStyle::Hidden set:
    window_ptr->SetTitleBarStyle(nativeapi::TitleBarStyle::Hidden);
    
  2. Run the application
  3. Double-click on the title bar area of the window (the region where the title bar would normally be)
  4. 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 NSWindow implementation does not have custom mouse event handling for double-click detection in the title bar area when the title bar is hidden

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Untersuche src/platform/macos/window_macos.mm mit Schwerpunkt auf der NSWindow-Verarbeitung für TitleBarStyle::Hidden und Mausereignisse im Titelleistenbereich. Reproduziere das Problem unter macOS mit beiden Einstellungen für AppleActionOnDoubleClick. Als abgeschlossen gilt die Arbeit, wenn ein Doppelklick auf den ausgeblendeten Titelleistenbereich entsprechend der Systemeinstellung zoomt oder minimiert, während sichtbare Titelleisten unverändert bleiben.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
cpp, macos, objective-c
Bereich
desktop, operating-systems
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
68/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.