libnativeapi / libnativeapi/nativeapi

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

Open
#48 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
34
Forks
7
Avg merge
3d 1h
Merged PRs (30d)
1

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect src/platform/macos/window_macos.mm, focusing on NSWindow handling for TitleBarStyle::Hidden and title-bar-area mouse events. Reproduce the issue on macOS with both AppleActionOnDoubleClick settings. Done means double-clicking the hidden title-bar region zooms or minimizes according to the system preference while visible title bars remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, macos, objective-c
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.