Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#69 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cpp

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
C++
Stelle
34
Fork
7
Merge medio
3g 1h
PR unite (30g)
1

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di libnativeapi/nativeapi

Tutte le issue di libnativeapi/nativeapi

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.