linux: a fitted panel realized before its first fit keeps its options size

Aperta
#2,096 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@houko ci sta già lavorando.

Dal 23/11/2026.

  • #2179 di @houko — aperta

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

Context

fitPanel (internal/platform/linux/panel.go, the function that applies driver.WindowFitSize to a panel) sizes the panel only with gtk_window_set_default_size. GTK honours a default size only until the window is realized. A panel that gets realized before its first fit therefore keeps its PanelOptions size instead of its content's size. The panel can be realized before its first fit by anything that needs its X11 window or calls gtk_widget_realize before the first show; reading its X11 window for stacking levels is one example.

Why it matters

A fitted panel (a popover, a tooltip-like window, a docked panel) shows at the wrong size, larger or smaller than its content, depending only on whether some code touched its native window early. The ordering dependency is invisible to the app. It surfaced as the CI timeout of TestTransparentFittedPanelKeepsItsAnchor in #2041, which called x11Window() before ShowAt.

Proposal

When the panel is already realized, fitPanel should resize the live window too (gtk_window_resize, or set the size request so GTK reallocates), not only the default size, and keep the existing placement step afterwards. Unrealized panels can keep using the default size.

Acceptance
  • Under xvfb-run, a fitted panel whose X11 window was read before ShowAt shows at its fitted size (repro: in TestTransparentFittedPanelKeepsItsAnchor, run host.onLoop(t, func() { p.x11Window() }) before ShowAt; today the snapshot stays at the options size, 280x240, instead of 180x80).
  • A fitted panel that refits while visible resizes and keeps its anchor.
Lingua principale
Go
Stelle
684
Fork
41
Merge medio
8h 8m
PR unite (30g)
911

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

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 nsgo-dev/nsgo

Tutte le issue di nsgo-dev/nsgo

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.