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

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

メンテナーはふだん 1 日以内に返信

@houko がすでに取り組んでいます。

2026年11月23日 から。

  • #2179 @houko による — オープン

評価

この issue はまだ評価されていません。

説明

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.
主要言語
Go
スター
684
フォーク
41
平均マージ
8時間 8分
マージ済み PR(30日)
911

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

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

nsgo-dev/nsgo のほかの issue

nsgo-dev/nsgo の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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