Apache OpenOffice (AOO) Bugzilla – Issue 97494
XTopWindow.toFront does not always move the window to the front
Last modified: 2013-02-24 21:07:37 UTC
If the XTopWindow doesn't have focus when the toFront() call is made, then it won't move at all. I would expect the toFront() call to send the window to the front whenever it is called. When calling XTopWindow.toFront, the API code calls Window::ToTop[0] which calls Window::ImplStartToTop[1] which in turn calls Window::ImplToTop[2]. Window::ImplToTop includes the following check: if ( !mpWindowImpl->mpFrameData->mbHasFocus && !mpWindowImpl->mpFrameData->mbSysObjFocus && !mpWindowImpl->mpFrameData->mbInSysObjFocusHdl && !mpWindowImpl->mpFrameData->mbInSysObjToTopHdl ) If this check is false, then the call is just ignored. Commenting out the first line of this check causes the issue to go away (and is what we've had to do, as we need this API call to work). There should probably be something like a TOTOP_IREALLYMEANIT flag (or perhaps TOTOP_IGNOREFOCUS would be more appropriate) which the API call could pass through which would bypass the above check. [Footnote 0: http://svn.services.openoffice.org/opengrok/xref/Current/vcl/source/window/window.cxx#6958] [Footnote 1: http://svn.services.openoffice.org/opengrok/xref/Current/vcl/source/window/window.cxx#ImplStartToTop] [Footnote 2: http://svn.services.openoffice.org/opengrok/xref/Current/vcl/source/window/window.cxx#ImplToTop]
jsc -> cd: a toolkit issue. I am not sure but i assume it's more a VCL issue.
I assume that the reason is that we don't allow to "steal" the focus here. So only when an OOo window already has the focus, toFront() will work. It is indeed questionable whether this is an exaggeration. If we change it we have to test how this influences the focus behavior of OOo wrt. opening new top level windows.