libnativeapi / libnativeapi/nativeapi

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

オープン
#48 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
C++
スター
34
フォーク
7
平均マージ
3日 1時間
マージ済み PR(30日)
1

説明

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

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

src/platform/macos/window_macos.mm を調査し、TitleBarStyle::Hidden に対する NSWindow の処理と、タイトルバー領域のマウスイベントに重点を置きます。AppleActionOnDoubleClick の両方の設定で macOS 上の問題を再現します。非表示のタイトルバー領域をダブルクリックするとシステム環境設定に従ってズームまたは最小化され、表示されているタイトルバーは変更されないことが完了条件です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
cpp, macos, objective-c
領域
desktop, operating-systems
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
68/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。