Issue 97494 - XTopWindow.toFront does not always move the window to the front
Summary: XTopWindow.toFront does not always move the window to the front
Status: UNCONFIRMED
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: Unknown All
: P3 Trivial
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-22 13:47 UTC by odd_bloke
Modified: 2013-02-24 21:07 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description odd_bloke 2008-12-22 13:47:19 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]
Comment 1 jsc 2009-01-05 09:25:07 UTC
jsc -> cd: a toolkit issue. I am not sure but i assume it's more a VCL issue.   
Comment 2 Mathias_Bauer 2009-06-08 10:57:54 UTC
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.