Issue 2987

Summary: document window sometimes doesn't open in front
Product: General Reporter: simonbr
Component: codeAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Trivial    
Priority: P5 (lowest) CC: christian.jansen, fhaem2, issues, mux2005, oooforum, stp
Version: 641   
Target Milestone: AOO Later   
Hardware: PC   
OS: Windows XP   
Issue Type: ENHANCEMENT Latest Confirmation in: ---
Developer Difficulty: ---

Description simonbr 2002-02-01 20:58:32 UTC
When I open a Writer window by double clicking a document on my desktop, it 
does not open in front of any windows already there, but stays behind them. An 
inappropriate display of modesty ;)
Comment 1 thorsten.martens 2002-02-04 09:49:58 UTC
This is not a bug ! It`s the normal behaviour of the MS-window manager in Win2000 and Win XP ! Example... 
open a document via doubleclick from "my computer" - the document will open in front of the "my computer - 
window", then click on the "my computer - window" again - it comes to the foreground. Now doubleclick again 
on a document - it will open in the background, where the other document stays and the "my computer - window" 
remains in the foreground ! Not a bug ! A MS-feature !
Comment 2 thorsten.martens 2002-02-04 09:50:19 UTC
Not a bug -> closed !
Comment 3 simonbr 2002-02-04 19:47:45 UTC
Hi Thorsten, 
I beg to differ! This is not the "normal" behaviour of W2000/XP 
windows manager.
Try this with e.g. Notepad or Windows picture viewer, and you will 
see that they always open in front. I'm pretty sure the same with MS 
Office (I could install it just to check, but I'd rather stick with 
OOo as the only office suite on my system). 
It may be MS to blame for the differences between W9x and 2000/XP 
that makes OOo not working correctly, but that does not mean there is 
no need to fix it. Although it's certainly no high priority issue, 
small details like this detract from (potential) user's impression of 
the software.
Please reopen!
Comment 4 Mathias_Bauer 2002-02-05 08:41:01 UTC
Sorry Simon, but OO.o does is correct. It does not change the default
behaviour of the "window manager" concerning task window activation
and in the sense of being a "good" application this is right.
There is an important difference between Notepad or the picture viewer
compared with OO.o: both start a new process for every new window,
OO.o does not, same as Internet Explorer if you open new windows by
opening html documents (not by executing iexplore.exe directly). 
Try the following: open the IE, then go to your windows explorer,
doubleclick any html document and you will see that the IE does the
same as OO.o: it opens a window that does not come to front but
flashes in the taskbar instead. Both applications (IE and OO.o) would
open their window to the front on Win98 or WinNT, but not  on Win2000
or WinXP, that's the system compatible behaviour.
Comment 5 simonbr 2002-02-05 20:27:02 UTC
Hi Mathias, Thorsten, 

What version of Windows and IE did you try this with? On my system 
(XP Home and IE 6.0), when following your instructions, IE opens the 
new window in front!!!

BTW, is it clear from my description that I observe this behaviour 
with the very first OOo window opened? If it were only the subsequent 
ones like you describe, then I wouldn't have such a problem with it. 

Apart from this, from the user's standpoint this behaviour remains 
strange and undesirable (even with subsequent windows). The only 
reason for double clicking a document is that you want to work with 
it, and the extra action to bring the window to front should not be 
necessary.

It may be that no new process is started for the OOo window (I assume 
this is because it is opened by the quick loader which already 
runs?), but this fact is not at all apparent, and should not be 
relevant, to a user. The behaviour is simply perceived as annoying. 
Why should OOo meekly conform to default window manager policies? I 
can't imagine MS Office being this "modest".

I agree that this is not strictly a bug, so I'd like to propose 
reopening the issue as an enhancement/feature request ("force OOo 
window to the front if it's the first one opened").

Please reopen! 
Comment 6 Mathias_Bauer 2002-02-07 13:18:22 UTC
Oh yes, indeed I didn't recognize that you are talking about the
*first* window. While my arguments are also valid for this case (from
a technical point of view), I agree that this is very unsatisfying
from the users perspective. So we should really check out, if this is
what we want.

The problem is that Win2000/XP never puts a window to front if it is
opened from a running process that is not active. I assume that you
are using the quickstarter, right? So you will exactly get the
flashing window. If you doubleclick an OO.o document without using the
quickstarter, it should be OK (for the first document).
I just talked to a guy from our gsl team and I was told that it is
possible to force windows to bring the window to front. But because
this is "naughty" behaviour for a windows app, it's still under
discussion if we really should do this.
Comment 7 Mathias_Bauer 2002-02-07 13:21:17 UTC
Stefan, would you please take over?
Comment 8 stephan_schaefer 2002-02-07 13:31:02 UTC
I don't see any problems to force new top-level windows to the 
foreground. I'll give it a try.
Comment 9 stephan_schaefer 2003-01-06 07:51:34 UTC
ssa->cj: please decide if we want a change in our window placement policy.
Comment 10 christian.jansen 2003-01-06 08:24:10 UTC
I agree, we should give it a try.
Comment 11 christian.jansen 2003-01-06 09:44:06 UTC
To clarify my statement, I'm currently writing on a "window behavior"
specification and this Bug is a good topic to add. The specification
will take effect on OpenOffice.org 2.0.
Comment 12 stephan_schaefer 2003-01-06 10:02:46 UTC
Will be started once the specification is finished.
Comment 13 stephan_schaefer 2003-02-05 17:54:52 UTC
please verify.
Comment 14 stefan.baltzer 2003-04-01 12:35:37 UTC
I don't know why I became owner of this one...
SBA->CJ: I don't know if you already have a task for that. At least
now you do :-)
Comment 15 christian.jansen 2003-09-11 15:08:56 UTC
Reassigned to Bettina.
Comment 16 bettina.haberer 2004-01-30 19:38:15 UTC
Hello Christian, there is no spec existing on OO.o named "Window behaviour" and
so I cannot get any state about. Please take this issue to your ownership and
close it, when the specification is available. Thank you.
Comment 17 Martin Hollmichel 2004-05-28 15:11:17 UTC
according to the announcement on releases
(http://www.openoffice.org/servlets/ReadMsg?list=releases&msgNo=7503) this issue
will be re-targeted to OOo Later.
Comment 18 simonbr 2004-08-29 23:31:29 UTC
Hi, 

Please retarget this issue to OOo 2.0 (at the latest). 

Recently I opened a new document, and thought that *nothing* had happened, as
the new window opened behind a bigger window that was already on the screen and
therefore wasn't visible at all. It's confusing, and not what a user expects. If
you open a new document you should be able to start typing right away.

If this is not too difficult to implement, resolution should not have to wait
until after OOo 2.0.
Comment 19 cbrunet 2007-03-16 16:27:42 UTC
*** Issue 72455 has been marked as a duplicate of this issue. ***
Comment 20 timsoft 2007-03-16 17:05:41 UTC
one (or both) of the following functions from the win32 api should be all that's
needed to be called to fix this.

Public Declare Function SetForegroundWindow Lib "user32" Alias
"SetForegroundWindow" (ByVal hwnd As Long) As Long

Public Declare Function SetFocus Lib "user32" Alias "SetFocus" (ByVal hwnd As
Long) As Long
Comment 21 mux2005 2009-03-11 13:52:20 UTC
Ping.
This issue still exists in OOo 3.0.1. The first window opens in the foreground,
any further windows open in the background. Very annoying and different from the
other programs I've tested (Word, IE, Notepad).
Comment 22 wmcnxen 2009-06-10 19:51:06 UTC
This aggravating bug still exists in 3.0.1 on Windows 2000 & XP.  I'd like to
switch my business over to using OOo, but this been a large impediment with
initial end-user testing.

To Reproduce:  open an OOo document from an explorer window.  If there are no
other OOo apps/documents running, it usually gets focus and opens in front of
other windows, like things usually do in windows.

If another OOo app/document is open and minimized or in the background
(non-focused) and user opens another, is also opens behind or minimized. 
sometimes the OOo taskbar icon flashes to give a hint, but sometimes does not.

This is not consistent with other windoze apps or what users expect.
Comment 23 lleroy 2009-09-28 12:03:36 UTC
I hacked together a solution for this problem... you can find the diff at
http://lleroy.webs.com/BringToFront/
Since the diff probably makes little chance to be incorporated in the official
version, I have posted a patched .dll on my page
Comment 24 oooforum (fr) 2016-07-27 15:00:33 UTC
(In reply to lleroy from comment #23)
> I hacked together a solution for this problem... you can find the diff at
This URL is no longer available.
Could you attach this .diff file directly here?
Maybe this hack should be updated to be compatible with AOO 4 :-(
Comment 25 Behache 2016-07-28 09:20:55 UTC
Remain true for Vista and Win10.