Work around wxGTK issues with time edits

Modifying the contents of a text control after IM processing happens in
the same cycle of the event loop seems to be seriously broken. Work
around this by disabling IM processing for time edits, as it should
never be relevant for them anyway.

Closes #1679. Closes #1680.
This commit is contained in:
Thomas Goyne 2014-01-02 11:47:15 -08:00
parent 5298634721
commit 1cbf20f8ab

View file

@ -69,6 +69,14 @@ class TimeEdit : public wxTextCtrl {
void OnChar(wxKeyEvent &event);
void OnModified(wxCommandEvent &event);
#ifdef __WXGTK__
// IM processing completely breaks modifying a text ctrl's in response to
// wxEVT_CHAR (changing the value clears it and modifying the insertion
// point does nothing). IM processing should never be relevant here, so
// just disable it.
int GTKIMFilterKeypress(GdkEventKey *) const override { return 0; }
#endif
public:
/// Get the current time as an AssTime object
AssTime GetTime() const { return time; }