Skip to content

Commit 9523c87

Browse files
committed
Use wx.CallAfter for one-time focus of the "a" field.
Immediate focus produces wrongly-sized text box on Linux. Also restore the focus to the original holder.
1 parent bab5d13 commit 9523c87

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

diffpy/pdfgui/gui/phaseconfigurepanel.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,10 @@ def refresh(self):
264264
# normally after receiving focus once.
265265
# Workaround: do explicit focus here for the first rendering.
266266
if self.__this_is_first_refresh:
267-
self.textCtrlA.SetFocus()
268267
self.__this_is_first_refresh = False
268+
focusowner = self.textCtrlA.FindFocus()
269+
wx.CallAfter(self.textCtrlA.SetFocus)
270+
wx.CallAfter(focusowner.SetFocus)
269271
return
270272

271273
def restrictConstrainedParameters(self):

0 commit comments

Comments
 (0)