Backport change to block IME on the canvas itself

This commit is contained in:
Mark Roszko 2023-07-17 02:07:07 +00:00
parent e1c6f4f58f
commit e016fa913f
5 changed files with 29 additions and 0 deletions

View File

@ -110,6 +110,7 @@ EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin
EnableScrolling( false, false ); // otherwise Zoom Auto disables GAL canvas
KIPLATFORM::UI::SetOverlayScrolling( this, false ); // Prevent excessive repaint on GTK
KIPLATFORM::UI::ImmControl( this, false ); // Ensure our panel can't suck in IME events
Connect( wxEVT_SIZE, wxSizeEventHandler( EDA_DRAW_PANEL_GAL::onSize ), nullptr, this );
Connect( wxEVT_ENTER_WINDOW, wxMouseEventHandler( EDA_DRAW_PANEL_GAL::onEnter ), nullptr,

View File

@ -216,3 +216,8 @@ void KIPLATFORM::UI::WarpPointer( wxWindow* aWindow, int aX, int aY )
gdk_window_set_cursor( win, cur_cursor );
}
}
void KIPLATFORM::UI::ImmControl( wxWindow* aWindow, bool aEnable )
{
}

View File

@ -143,6 +143,11 @@ namespace KIPLATFORM
* @param aY destination y position
*/
void WarpPointer( wxWindow* aWindow, int aX, int aY );
/**
* Configures the IME mode of a given control handle
*/
void ImmControl( wxWindow* aWindow, bool aEnable );
}
}

View File

@ -156,3 +156,16 @@ void KIPLATFORM::UI::WarpPointer( wxWindow* aWindow, int aX, int aY )
{
aWindow->WarpPointer( aX, aY );
}
void KIPLATFORM::UI::ImmControl( wxWindow* aWindow, bool aEnable )
{
if ( !aEnable )
{
ImmAssociateContext( aWindow->GetHWND(), NULL );
}
else
{
ImmAssociateContextEx( aWindow->GetHWND(), 0, IACE_DEFAULT );
}
}

View File

@ -157,3 +157,8 @@ void KIPLATFORM::UI::WarpPointer( wxWindow* aWindow, int aX, int aY )
{
aWindow->WarpPointer( aX, aY );
}
void KIPLATFORM::UI::ImmControl( wxWindow* aWindow, bool aEnable )
{
}