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

Ouverte
#1,324 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
48/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
c
Domaine
desktop

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.

Langage dominant
C
Étoiles
10
Forks
8
Merge moyen
6 h 32 min
PR mergées (30 j)
1

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de FriendsofECCE/ECCE

Toutes les issues de FriendsofECCE/ECCE

Issues similaires

Plus d'issues C

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.