- // FIXME_DFB: do this at all?
- if ( show && AcceptsFocus() )
- SetFocus();
- // FIXME_DFB -- don't do this for popup windows?
+ // make sure the window is fully painted, with all pending updates, before
+ // DFB WM shows it, otherwise it would attempt to show either empty (=
+ // black) window surface (if shown for the first time) or it would show
+ // window with outdated content; note that the window was already refreshed
+ // in the wxTopLevelWindowBase::Show() call above:
+ if ( show )
+ Update();
+
+ // hide/show the window by setting its opacity to 0/full:
+ m_dfbwin->SetOpacity(show ? m_opacity : 0);
+
+ if ( show )
+ {
+ wxWindow *focused = wxWindow::FindFocus();
+ if ( focused && focused->GetTLW() == this )
+ {
+ SetDfbFocus();
+ }
+ else if ( AcceptsFocus() )
+ {
+ // FIXME: we should probably always call SetDfbFocus instead
+ // and call SetFocus() from wxActivateEvent/DWET_GOTFOCUS
+ // handler
+ SetFocus();
+ }
+ }