Fix cursor flicker after popup menu in rich wxTextCtrl
Afterbd650ec
andcad2b9c
, showing a popup menu in wxTextCtrl with wxTE_RICH2 and then dismissing it without choosing a command would result in the cursor flickering between arrow and beam cursors until another context menu was shown. See https://github.com/vslavik/poedit/issues/483 Fixed by checking if the popup menu is still valid (and so shown) in the cursor handling code.
This commit is contained in:
committed by
Václav Slavík
parent
74904281e4
commit
dcac98d7e8
@@ -2262,9 +2262,14 @@ wxTextCtrl::MSWHandleMessage(WXLRESULT *rc,
|
|||||||
// for plain EDIT controls though), so explicitly work around this
|
// for plain EDIT controls though), so explicitly work around this
|
||||||
if ( IsRich() )
|
if ( IsRich() )
|
||||||
{
|
{
|
||||||
|
// wxCurrentPopupMenu stores the popup menu that will receive
|
||||||
|
// WM_COMMAND, but it may be non-NULL even when the underlying
|
||||||
|
// native menu is no longer shown. Use ::IsMenu() to check whether
|
||||||
|
// the menu still exists.
|
||||||
extern wxMenu *wxCurrentPopupMenu;
|
extern wxMenu *wxCurrentPopupMenu;
|
||||||
if ( wxCurrentPopupMenu &&
|
if ( wxCurrentPopupMenu &&
|
||||||
wxCurrentPopupMenu->GetInvokingWindow() == this )
|
wxCurrentPopupMenu->GetInvokingWindow() == this &&
|
||||||
|
::IsMenu(GetHmenuOf(wxCurrentPopupMenu)) )
|
||||||
::SetCursor(GetHcursorOf(*wxSTANDARD_CURSOR));
|
::SetCursor(GetHcursorOf(*wxSTANDARD_CURSOR));
|
||||||
}
|
}
|
||||||
#endif // wxUSE_MENUS
|
#endif // wxUSE_MENUS
|
||||||
|
Reference in New Issue
Block a user