Skip to content

Commit

Permalink
SQ -> Fix weird race condition on Linux, for test: test_given_url_inp…
Browse files Browse the repository at this point in the history
…ut_is_unfocused_and_spinner_is_visible_when_focus_url_input_then_spinner_disappears
  • Loading branch information
davidfstr committed Dec 31, 2023
1 parent 177eabc commit baa9177
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/crystal/util/wx_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ def SetFocus(window: wx.Window, previously_focused: Optional[wx.Window]) -> wx.W
# Simulate focus and blur events,
# since wxGTK's SetFocus() doesn't appear to have any effect

# Keep focus state in UI up-to-date so that UI doesn't issue
# its own focus/blur events unexpectedly later
window.SetFocus()

# Simulate blur event
if previously_focused is not None:
event = wx.FocusEvent(wx.EVT_KILL_FOCUS.typeId, previously_focused.GetId())
Expand Down

0 comments on commit baa9177

Please sign in to comment.