Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Make Focus() / Blur() reliable and let Blur() return focus to the previous app

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

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
cpp

調査の方向性

Start by locating the platform implementations of Window::Focus(), Blur(), and IsFocused(), then inspect the Windows, Linux, and macOS focus behavior described in the issue. Done means focus changes succeed reliably across those platforms and Blur() returns focus to the previously active window or app.

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

説明

bug

Window::Focus() and Blur() follow the platforms' simplest calls and fail in common cases:

  • Windows: Focus() is SetForegroundWindow + SetFocus, which the foreground lock refuses when the app isn't in the foreground (only the taskbar flashes). Consider the AttachThreadInput / AllowSetForegroundWindow approaches, and check IsFocused() after focus changes.
  • Linux: gtk_window_present() without a timestamp is subject to focus-stealing prevention; use gtk_window_present_with_time() with the last event time.
  • Blur() should hand focus back to the previously active window or app. On macOS it only does orderBack:, and on Windows SetFocus(nullptr), which leaves the app active. Typical use: a launcher/search bar that hides and pastes into the previous app. Related: libnativeapi/nativeapi#59 (app-level hide on macOS).

Background:

  • leanflutter/window_manager#364: focus() not always working, isFocused() always false (Windows)
  • leanflutter/window_manager#218: focus() doesn't focus the window on Ubuntu
  • leanflutter/window_manager#387: how to unfocus the window and bring back the previous one
  • leanflutter/window_manager#352: focus the previous window when hiding
主要言語
C++
スター
34
フォーク
7
平均マージ
3日 1時間
マージ済み PR(30日)
1

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

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

はじめの一歩

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

libnativeapi/nativeapi のほかの issue

libnativeapi/nativeapi の issue をすべて見る

似ている issue

C++ の issue をもっと見る

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

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