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 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
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 分鐘
30 天內合併 PR
1

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

FriendsofECCE/ECCE 的其他 Issue

查看 FriendsofECCE/ECCE 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。