Disable IME input on the gal canvas

Fixes #9719
This commit is contained in:
Marek Roszko 2023-05-09 20:30:15 -04:00
parent 6e4de18e15
commit 5d93487607
6 changed files with 39 additions and 1 deletions

View File

@ -111,6 +111,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

@ -33,6 +33,7 @@ elseif( WIN32 )
"Shlwapi"
"winhttp"
"wintrust"
"Imm32"
)
elseif( UNIX )
set( PLATFORM_SRCS

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

@ -118,7 +118,7 @@ namespace KIPLATFORM
double GetContentScaleFactor( const wxWindow* aWindow );
/**
* Tries to determine the size of the viewport of a scrollable widget (wxDataViewCtrl, wxGrid)
* Tries to determine the size of the viewport of a scrollable widget (wxDataViewCtrl, wxGrid)
* that won't be obscured by scrollbars.
* @param aWindow pointer to the scrollable widget to check
* @return Viewport size that won't be obscured by scrollbars
@ -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,24 @@ void KIPLATFORM::UI::WarpPointer( wxWindow* aWindow, int aX, int aY )
{
aWindow->WarpPointer( aX, aY );
}
void KIPLATFORM::UI::ImmControl( wxWindow* aWindow, bool aEnable )
{
static HIMC origHIMC = (HIMC) 0;
if ( !aEnable )
{
if( origHIMC == (HIMC) 0 )
{
origHIMC = ImmGetContext( aWindow->GetHWND() );
if( origHIMC )
ImmAssociateContext( aWindow->GetHWND(), NULL );
}
}
else if( origHIMC != (HIMC) 0 )
{
ImmAssociateContext( aWindow->GetHWND(), origHIMC );
origHIMC = (HIMC) 0;
}
}

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 )
{
}