Hackfix some cases the IME on windows locks up
Asking the IME to cancel when the canvas takes focus fixes the case where: - Windows input lang set to Chinese - Input mode set to english instead of chinese - You spam the M key while launching a sch/pcb from the kicad.exe until the editor opens - The windows would then normally be frozen
This commit is contained in:
parent
3065ae1f01
commit
7dee29f70a
|
@ -186,6 +186,7 @@ EDA_DRAW_PANEL_GAL::~EDA_DRAW_PANEL_GAL()
|
||||||
|
|
||||||
void EDA_DRAW_PANEL_GAL::SetFocus()
|
void EDA_DRAW_PANEL_GAL::SetFocus()
|
||||||
{
|
{
|
||||||
|
KIPLATFORM::UI::ImeNotifyCancelComposition( this );
|
||||||
wxScrolledCanvas::SetFocus();
|
wxScrolledCanvas::SetFocus();
|
||||||
m_lostFocus = false;
|
m_lostFocus = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -321,6 +321,11 @@ void KIPLATFORM::UI::ImmControl( wxWindow* aWindow, bool aEnable )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void KIPLATFORM::UI::ImeNotifyCancelComposition( wxWindow* aWindow )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void KIPLATFORM::UI::SetFloatLevel( wxWindow* aWindow )
|
void KIPLATFORM::UI::SetFloatLevel( wxWindow* aWindow )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,6 +158,11 @@ namespace KIPLATFORM
|
||||||
*/
|
*/
|
||||||
void ImmControl( wxWindow* aWindow, bool aEnable );
|
void ImmControl( wxWindow* aWindow, bool aEnable );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Asks the IME to cancel
|
||||||
|
*/
|
||||||
|
void ImeNotifyCancelComposition( wxWindow* aWindow );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* On Wayland, restricts the pointer movement to a rectangle slightly bigger than the given `wxWindow`.
|
* On Wayland, restricts the pointer movement to a rectangle slightly bigger than the given `wxWindow`.
|
||||||
* This way, the cursor doesn't exit the (bigger) application window and we retain control on it.
|
* This way, the cursor doesn't exit the (bigger) application window and we retain control on it.
|
||||||
|
|
|
@ -184,6 +184,14 @@ void KIPLATFORM::UI::ImmControl( wxWindow* aWindow, bool aEnable )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void KIPLATFORM::UI::ImeNotifyCancelComposition( wxWindow* aWindow )
|
||||||
|
{
|
||||||
|
const HIMC himc = ImmGetContext( aWindow->GetHWND() );
|
||||||
|
ImmNotifyIME( himc, NI_COMPOSITIONSTR, CPS_CANCEL, 0 );
|
||||||
|
ImmReleaseContext( aWindow->GetHWND(), himc );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool KIPLATFORM::UI::InfiniteDragPrepareWindow( wxWindow* aWindow )
|
bool KIPLATFORM::UI::InfiniteDragPrepareWindow( wxWindow* aWindow )
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -184,6 +184,11 @@ void KIPLATFORM::UI::ImmControl( wxWindow* aWindow, bool aEnable )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void KIPLATFORM::UI::ImeNotifyCancelComposition( wxWindow* aWindow )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool KIPLATFORM::UI::InfiniteDragPrepareWindow( wxWindow* aWindow )
|
bool KIPLATFORM::UI::InfiniteDragPrepareWindow( wxWindow* aWindow )
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue