A window centred before it is mapped can end up off the display, and only a size-event race puts it back

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
c
領域
desktop

調査の方向性

Read src/wxgui/ewxClasses/ewxWindowUtils.C, especially outsideDisplay() and keepOnDisplay(), then trace ewxFrame::Show() and its deferred call behavior. Check how maximized, full-screen, tiled, restored-geometry, and Builder AUI windows are handled before applying the deferred adjustment. Done means windows that grow when mapped stay on display without disturbing those deliberately positioned states; the issue calls for a separate round of checking.

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

説明

bug

A top-level window that is centred and fitted while it still has its pre-map size, but takes a larger size from its sizer's minimum when GTK maps it, is positioned for the smaller size and can then hang below the display.

What normally rescues it is the wxEVT_SIZE watcher in src/wxgui/ewxClasses/ewxWindowUtils.C (watch()), which re-fits after the map. That is a race: on one Xvfb the watcher won every run, on two other machines it lost every run. Gating the watcher off reproduces the losing case exactly, which is how it was confirmed.

Seen in the Calculation Editor: CalcEdMessages::showEditor() centres at the pre-map height (528, giving y=120), Show() fits at that height, GTK then allocates 613 at map time, and 120 + 613 + 36 (TITLE_RESERVE) = 769 on a 768-pixel display. Fixed there by clamping once more from CallAfter after Show().

The general case is not fixed. Any app that is centred before map and grows at map has the same race. The shared fix would be a deferred keepOnDisplay() in ewxFrame::Show(), but keepOnDisplay() (ewxWindowUtils.C:~940) has none of the guards outsideDisplay() (:781) has -- it does not check maximized, full-screen or tiled state -- so calling it unguarded for every frame would also reach windows other apps position deliberately (restored geometry, the Builder's AUI frame). The honest version is to guard keepOnDisplay() as outsideDisplay() is guarded, then call it deferred from ewxFrame::Show().

Worth doing as one change rather than per app, but it is a behaviour change for every window, so it wants its own round of checking rather than riding along with a release.

主要言語
C
スター
10
フォーク
8
平均マージ
6時間 32分
マージ済み PR(30日)
1

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

FriendsofECCE/ECCE のほかの issue

FriendsofECCE/ECCE の issue をすべて見る

似ている issue

C の issue をもっと見る

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

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