Menu

#277 TMDIClient::EvMDIDestroy steals focus and causes flicker

unspecified
open
nobody
GUI (65)
1
2015-05-24
2014-11-12
No

Reported by Erwin Lotter (elotter):

A problem I face thereby occurs when the last TMDIChild of the active layer is closed. Then, severel of the hidden TMDIChilds get visible (blink up) for a short time (which depends on the number of the hidden TMDIChilds) and one of these hidden windows is activated (and receives the keyboard focus) [discussion:ff4f6b0b].

Related

Discussion: Window list incomplete in MDI application
Discussion: Window list incomplete in MDI application
Discussion: ff4f6b0b
Discussion: TMDIClient::EvMDIDestroy()
Discussion: TMDIClient::EvMDIDestroy()

Discussion

  • Vidar Hasfjord

    Vidar Hasfjord - 2014-11-12
    • status: open --> pending

    This issue has been fixed in [r2766].

     

    Related

    Commit: [r2766]


    Last edit: Vidar Hasfjord 2014-11-12
  • Vidar Hasfjord

    Vidar Hasfjord - 2015-05-19
    • status: pending --> open
    • assigned_to: Vidar Hasfjord --> nobody
    • Group: 7 --> unspecified

    This ticket has been reopened. The code removed in [r2766], to fix the MDI child focus and flicker issues, is still needed in current day Windows to circumvent MDI bugs (erratic Window list). Hence, the code has been reverted to its original state [r3161].

    Erwin Lotter (elotter) in [discussion:847c1b13]:

    After removing the workarounds [for bug #277] from both locations, [Windows] behaves normal. This means that the [MDI bugs are] still present also in Windows 7 (and probably will be in any future version of [Windows]). Thus, hidden TMDIChild still need to be temporarily unhidden in TMDIClient::EvMDIDestroy and also TMDIChild::EvNCActivate is still needed.

     

    Related

    Commit: [r2766]
    Commit: [r3161]


    Last edit: Vidar Hasfjord 2015-05-19
  • Erwin Lotter

    Erwin Lotter - 2015-05-24

    When the last visible MDI child is removed, TMDIChild::EvNCActivate() does not work as expected.
    In this case Windows forces the activation of a temporarily unhidden child and paints it's non-client area.
    It seems that this occurs repeatedly when the children are rehidden after Destroy() is done. As a consequence, all hidden children blink up.
    This can be prevented by implementing

    void TMyMDIChild::EvNCPaint(HRGN hrgn) 
    {
      if (!IsFlagSet(wfUnHidden)) {
        TMDIChild::EvNCPaint(hrgn);
      }
    }
    

    Alternatively, TMDIChild could be extended this way - with the risk of new side effects unknown yet.
    Therefore, it might be the better strategy to document the problem and suggest this solution to those who hide MDI child windows.

     
  • Erwin Lotter

    Erwin Lotter - 2015-05-24

    ..., and EV_WM_NCPAINT needs to be added to the response table.

     
  • Vidar Hasfjord

    Vidar Hasfjord - 2015-05-24

    Hi Erwin, thanks for the feedback on this issue. You are welcome to implement your fix on the trunk, so that we can gain experience with it in practice. We can then make a judgement on the robustness of your approach as we get closer to the release of version 7.

    If you do decide to implement your fix, please take ownership of this ticket and set the milestone to version 7.

     
    • Erwin Lotter

      Erwin Lotter - 2015-05-26

      Hi Vidar,

      I'm not involved in the mysteries of trunks and branches. Could you
      please handle this part?

      Erwin


      Moderator: Removed quoted content.

       

      Last edit: Vidar Hasfjord 2017-02-09

Log in to post a comment.