numere-org / NumeRe

Framework for numerical computations, data analysis and visualisation
https://www.numere.org
GNU General Public License v3.0
20 stars 7 forks source link

Fix the graphical glitch with the editor tabs #259

Closed numeredev closed 1 month ago

numeredev commented 1 month ago

DESCRIPTION

Describe the bug Sometimes, the focus of the editor tabs is getting lost and it looks like the focus is on an secondary window.

To Reproduce Steps to reproduce the behavior: Only happens occasionally, but typically after rebooting the machine from hibernation.

Expected behavior The focus is kept on the currently viewed Editor tab.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

(Do not write below this line)


DEVS' SECTION

ANALYSIS

The central reason why this glitch only happens occasionally, is that the drawing loop happens separated from the user interaction, i.e. the tabs search for the window focus and no focus can be found, therefore all tabs in a three-state tab group appear in the third (damped) state. We can use a hack to access the main frame via wxTheApp() (requires that we add the main frame pointer to the app class), read the window title and use this information to compare with the tab caption. Will only work with the editor tabs, but that's sufficient for now.

IMPLEMENTATION STEPS

(see also our Wiki for implementation guidelines)

DOCUMENTATION STEPS

(see also our Wiki for further information)

PULL REQUEST