More SetFocus() work.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14545
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
if ( !m_focus->RemoveEventHandler(m_handlerFocus) )
{
// see above
m_handlerFocus = NULL;
}
if ( !m_focus->RemoveEventHandler(m_handlerFocus) )
{
// see above
m_handlerFocus = NULL;
}
m_focus = winFocus ? winFocus : this;
m_focus->SetFocus();
m_focus = winFocus ? winFocus : this;
m_focus->SetFocus();
#ifdef __WXMSW__
// MSW doesn't allow to set focus to the popup window, but we need to
// subclass the window which has the focus, and not winFocus passed in or
#ifdef __WXMSW__
// MSW doesn't allow to set focus to the popup window, but we need to
// subclass the window which has the focus, and not winFocus passed in or
m_focus->PushEventHandler(m_handlerFocus);
}
m_focus->PushEventHandler(m_handlerFocus);
}
}
void wxPopupTransientWindow::Dismiss()
}
void wxPopupTransientWindow::Dismiss()
{
wxWindow *win = control->GetInputWindow();
{
wxWindow *win = control->GetInputWindow();
- if ( wxWindow::FindFocus() != control->GetInputWindow() )
+ if (( wxWindow::FindFocus() != control->GetInputWindow() ) &&
+ ( win->AcceptsFocus() ) )
g_nextFocus = win;
win->SetFocus();
g_nextFocus = win;
win->SetFocus();
Window xwindow = (Window) GetMainWindow();
wxCHECK_RET( xwindow, wxT("invalid window") );
Window xwindow = (Window) GetMainWindow();
wxCHECK_RET( xwindow, wxT("invalid window") );
+
+ wxCHECK_RET( AcceptsFocus(), wxT("set focus on window that doesn't accept the focus") );
+
+#if 0
+ if (GetName() == "scrollBar")
+ {
+ char *crash = NULL;
+ *crash = 0;
+ }
+#endif
+
if (wxWindowIsVisible(xwindow))
{
XSetInputFocus( wxGlobalDisplay(), xwindow, RevertToParent, CurrentTime );
if (wxWindowIsVisible(xwindow))
{
XSetInputFocus( wxGlobalDisplay(), xwindow, RevertToParent, CurrentTime );