Using dual monitors, Firefox/Thunderbird always opens in wrong monitor, does not remember correct monitor location when maximized

RESOLVED WORKSFORME

Status

()

--
major
RESOLVED WORKSFORME
14 years ago
7 months ago

People

(Reporter: bristols, Unassigned)

Tracking

(Depends on: 2 bugs, Blocks: 3 bugs, {meta, polish})

Trunk
x86
All
meta, polish
Points:
---
Dependency tree / graph
Bug Flags:
blocking1.9.2 -

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [gs][duptome][Australis:P?][tpi:-], URL)

Attachments

(2 attachments)

(Reporter)

Description

14 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.2; rv:1.7.3) Gecko/20041001 Firefox/0.10.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.2; rv:1.7.3) Gecko/20041001 Firefox/0.10.1

When using two monitors Firefox always opens in the left (main) monitor. It
never remembers the last location (which is always the right monitor). It never
opens in the right (secondary) monitor.

This does not happen when only using one monitor ;-).

Reproducible: Always
Steps to Reproduce:
1. Using two monitors. Open firefox.
2. Move browser to right (secondary) monitor.
3. Close Firefox.
4. Open Firefox. It opens in left (main) monitor.



Expected Results:  
Firefox should remember the last closed position and reopen there, even if it is
in the secondary monitor.
Comment hidden (obsolete)
Comment hidden (me-too)
Comment hidden (off-topic)
Comment hidden (off-topic)
Comment hidden (obsolete)
Comment hidden (obsolete)
Assignee: firefox → nobody
Comment hidden (obsolete)
Comment hidden (obsolete)
Comment hidden (obsolete)
Comment hidden (obsolete)

Updated

12 years ago
Duplicate of this bug: 333966

Updated

12 years ago
Duplicate of this bug: 336595

Comment 13

12 years ago
important
Note: In the above two duped bugs, bug 333966 and bug 336595, the reports said the window had to be maximized in the secondary monitor for the error to occur.
Comment hidden (obsolete)
Comment hidden (me-too)
Duplicate of this bug: 417960
Duplicate of this bug: 392312
Duplicate of this bug: 421845
Comment hidden (obsolete)
Comment hidden (obsolete)
Duplicate of this bug: 426385
Comment hidden (me-too)
Comment hidden (me-too)
Comment hidden (me-too)
Comment hidden (me-too)
Comment hidden (obsolete)
Comment hidden (me-too)
Comment hidden (me-too)
Comment hidden (me-too)
Comment hidden (me-too)

Updated

10 years ago
Duplicate of this bug: 438835
Duplicate of this bug: 470749

Updated

10 years ago
Duplicate of this bug: 474331

Comment 34

10 years ago
Bug Bug 474331 was marked a duplicate of this bug, but I'm not sure that it is.  I'm describing remembering virtual desktops, whereas this bug is discussing remembering different monitors.  Here is my original bug description:

When Firefox restarts, all browser windows appear on the current desktop (or
space on the Mac).  Firefox remembers what tabs it has open, which mostly
restores the previous state of the browser.  But if you have browser windows
open on multiple virtual desktops, you currently have to manually figure out
which one went where and place them back where they were before.  It would be
amazingly helpful if Firefox remembered which virtual desktop or space each
window was in and opened those windows on the correct desktop, in the correct
position.

Comment 35

10 years ago
I have got the problem with firefox and thunderbird, so this might be a core problem. Should/Could this be marked here somehow?

Updated

10 years ago
OS: Windows Server 2003 → All
Comment hidden (advocacy)

Updated

10 years ago
Blocks: 236647

Updated

10 years ago
Component: General → General
Flags: blocking-firefox3.6?
Flags: blocking-firefox3.5?
Product: Firefox → Core
QA Contact: general → general
Version: unspecified → Trunk

Updated

10 years ago
Flags: blocking1.9.2?

Comment 37

10 years ago
workaround
As noted in bug 465240 comment 4, you should resize the window a little bit. That seems to save the current monitor in localstore.rdf, not the moving of the window. Note that maximizing a window isn't the same as resizing it (see bug 465240)

Updated

10 years ago
Flags: blocking1.9.2? → blocking1.9.2-
Keywords: polish
Comment hidden (me-too)
Comment hidden (obsolete)

Updated

9 years ago
Duplicate of this bug: 464428

Updated

9 years ago
Duplicate of this bug: 457544
Duplicate of this bug: 476632
Duplicate of this bug: 528481
Comment hidden (advocacy)

Comment 45

9 years ago
workaround
Here is also a good description of this bug:
http://forums.whirlpool.net.au/forum-replies-archive.cfm/847096.html

Quote from ghulp:
--------------------------------------------------------------------------------
The latest versions of Firefox only remember which monitor they are on if you close Firefox while it is not maximised.

So procedure to get firefox to open maximised on the monitor of your choice in dual monitor setup:

1) Un-maximise Firefox window
2) Position un-maximised window on monitor of you choice
3) Close Firefox window
4) Reopen Firefox window
5) Maximise Firefox window
6) Close Firefox window

Now Firefox will open maximised on the screen you chose.
-----------------------------------------------------------------------------

When will this annoying bug fixed?
Duplicate of this bug: 553264
Duplicate of this bug: 555716

Updated

9 years ago
Duplicate of this bug: 575091
Comment hidden (off-topic)
Comment hidden (off-topic)

Updated

8 years ago
Whiteboard: [gs]

Comment 51

8 years ago
windows
I have the opposite problem: Firefox always opens on my right-most (primary) monitor, even though I always close it (maximized) on my secondary (left-most) monitor.

Multi-monitor application bugs are one of my pet peeves, partially because Windows has two functions (GetWindowPlacement/SetWindowPlacement) that will do it correctly for you (and handles all the corner cases).  Don't try to reinvent the wheel, you'll most likely screw it up.  If you're not using GetWindowPlacement/SetWindowPlacement (which apparently Firefox isn't), then you've probably (in this case, definitely) overlooked something.

Updated

8 years ago
Duplicate of this bug: 537425

Updated

8 years ago
Duplicate of this bug: 510736

Updated

8 years ago
Duplicate of this bug: 465240

Updated

8 years ago
Blocks: 462743
Component: General → Widget: Win32
QA Contact: general → win32
Summary: Using dual monitors, Firefox always opens in left monitor, does not remember right monitor location. → Using dual monitors, Firefox/Thunderbird always opens in wrong monitor, does not remember correct monitor location when maximized
Whiteboard: [gs] → [gs][duptome]

Updated

8 years ago
Duplicate of this bug: 431653

Updated

8 years ago
Blocks: 359875
Comment hidden (advocacy)
Comment hidden (me-too)
Comment hidden (obsolete)
Comment hidden (obsolete)
Comment hidden (spam)
Comment hidden (obsolete)
Comment hidden (advocacy)
Comment hidden (me-too)

Updated

8 years ago
Duplicate of this bug: 660168

Updated

8 years ago
Duplicate of this bug: 656931
Duplicate of this bug: 668094

Comment 67

8 years ago
osx
Created attachment 543486 [details] [diff] [review]
Patch v1 (WIP)

I think this patch fixes the problem on OS X. I'm not sure whether it breaks other platforms though -- it's undoing the changes made in rev 1.23, which points to bug 30116, which was a bug filed against windows 98. Will be checking the effect of these changes on other platforms next week.
Assignee: nobody → netzen

Updated

7 years ago
Assignee: netzen → jezreel
Comment hidden (me-too)
Comment hidden (me-too)
Comment hidden (me-too)
Comment hidden (me-too)
Comment hidden (obsolete)
Comment hidden (me-too)

Comment 74

7 years ago
osx
Sorry, I'm no longer working on this bug. I don't have access to the necessary platforms to test if the patch works.

Updated

7 years ago
Assignee: jezreel → nobody

Comment 75

7 years ago
(In reply to Jez Ng [:int3] from comment #74)
> Sorry, I'm no longer working on this bug. I don't have access to the
> necessary platforms to test if the patch works.

VirtualBox allows you to emulate several monitors even if running on a single monitor system. Have you considered this as a potential test platform?
Duplicate of this bug: 730611

Comment 77

7 years ago
linux
Because this bug also appears on Mac OS X and on Linux (see 730611), selected component must be wrong.
Duplicate of this bug: 731355
Comment hidden (off-topic)
Comment hidden (off-topic)
Comment hidden (off-topic)

Updated

7 years ago
Component: Widget: Win32 → Widget
QA Contact: win32 → general

Updated

7 years ago
Duplicate of this bug: 717273
Comment hidden (off-topic)
Comment hidden (off-topic)
Comment hidden (advocacy)
Comment hidden (advocacy)
Comment hidden (obsolete)
Comment hidden (off-topic)
Comment hidden (obsolete)
Comment hidden (obsolete)
Comment hidden (off-topic)

Comment 92

7 years ago
osx
(In reply to guzzy from comment #90)
> doh.  Perhaps people can post which platforms have been tested to work with
> the patch, so that people with the remaining platforms can test and post
> results.

I tested it on OS X. I suspect that the changes in nsCocoaWindow.mm should be similarly applied to the window objects for other platforms as well, but as I couldn't test on them I didn't actually make the changes. There's also the issue of possible regressions -- IIRC the changes in nsXULWindow.cpp are reverting changes made way back in the past for WindowsCE (!). But I think if no regressions show up on the major modern platforms then it should be fine. If anyone wants to step up to port the patch & test on other platforms I'd be grateful.

(In reply to joel from comment #91)
> Would someone tell me how to install the patch on OSX Lion 10.7.3?

Download it and do `hg qimport`. If you haven't built Firefox yet, read https://developer.mozilla.org/en/Introduction and ask questions in #introduction. Thanks!

Updated

7 years ago
Duplicate of this bug: 750537
Comment hidden (off-topic)
Comment hidden (off-topic)
Duplicate of this bug: 750999

Updated

7 years ago
Duplicate of this bug: 754255
Duplicate of this bug: 633851
Duplicate of this bug: 704803
Comment hidden (off-topic)
Comment hidden (advocacy)

Updated

7 years ago
Duplicate of this bug: 750055
Comment hidden (off-topic)
Comment hidden (advocacy)
Comment hidden (off-topic)
Comment hidden (advocacy)

Comment 107

7 years ago
osx
(In reply to joel from comment #106)
> I don't think it is on anyone's radar as this new high speed progression of
> Firefox and Thunderbird is all that is on the mind of the developers.  As
> You can see no one has picked this up after all this time.
Many bugs related to Fx 12 (bug 750055, bug 750537, bug 750999, and bug 754255 - see also comment 79 and above) have been wrongly dupe to this bug and should have been dupe to bug 752149 (was on Paul O'Shannessy's radar), which is fixed from Fx 14.
Comment hidden (off-topic)
Comment hidden (off-topic)
Comment hidden (off-topic)
Comment hidden (off-topic)
Comment hidden (off-topic)
Duplicate of this bug: 782921
Comment hidden (advocacy)
Comment hidden (advocacy)

Comment 116

6 years ago
workaround that I have been using for a decade : comment 37
Comment hidden (off-topic)
Duplicate of this bug: 796901

Comment 119

6 years ago
osx
This was fixed until the latest update to 16.0, now it's back again, even after maximimsing, minimising, relaunching, deleting then re-adding tabs.

My OS Mac Lion is 10.7.5 and I have two 30" Apple Cinema Display monitors.
Comment hidden (me-too)
Comment hidden (me-too)
Comment hidden (me-too)

Comment 123

6 years ago
linux
I am not versed in cpp or GTK or anything like that, but I just noticed:

There are a bunch of gdk_window_get_screen() and friends in mozilla-central/widget/gtk2, but in the whole directory, not a single file calls gtk_window_set_screen(). So, it looks to me as if someone forgot to add this line, and maybe someone should check the source and add the command whereever it would be required.

As I said, I have never coded cpp, so I can't do it myself, but I hope this info helps.

For the record: Firefox 16.0.1 on Linux Mint, two screens, same problem. 

Also really annoying as it even overrides default workspace settings on the window manager "awesome", so you can't even force it to a specific tab with it.
Comment hidden (me-too)

Comment 125

6 years ago
osx
This becomes more critical with Retina displays due to font display problems when switching between Retina displays and external monitors described in bug 764083.

Comment #37 does help (resizing to less than maximum size on the monitor I want, quit, then start again).

Comment 126

6 years ago
Copied steps to reproduce and workaround from duplicated bug 704803. Maybe an adapted workaround works also on non Windows platforms.

Problem occurs (steps to reproduce):
- Open Firefox maximized(1st monitor)
- Press WindowsKey+Shift+Right to move Firefox to 2nd monitor
- Close Firefox
- Reopen it --> opens on 1st monitor

Problem does not occur (workaround):
- Open Firefox maximized (1st monitor)
- Press the "Restore Down" icon upper right (so Firefox is not maximized anymore)
- Press WindowsKey+Shift+Right to move Firefox to 2nd monitor
- Maximize Firefox
- Close Firefox
- Reopen it --> opens on *SECOND* monitor
Duplicate of this bug: 836015
Comment hidden (advocacy)
Comment hidden (advocacy)
Comment hidden (advocacy)
Comment hidden (advocacy)
Comment hidden (advocacy)
Comment hidden (obsolete)

Comment 134

6 years ago
linux
tobias: That workaround seems to only work for Windows, on my Linux machine, it will still open on the wrong screen every single time.
Comment hidden (advocacy)
Comment hidden (advocacy)
Comment hidden (me-too)
Comment hidden (me-too)

Comment 139

6 years ago
Problem still occurs for me as well, It got so annoying that I hacked together a quick vbscript to modify the localstore.rdf and shift the window back to the main screen (I always end up with the window stuck on the second screen). All you'd need to do is change the pixel position that it is writing from 2,2 (the lines with screenX and screenY) to whatever you want it to be and change the sizemode to what you want. I'm going to attempt to attach it to this ticket. It only works for Windows 7 currently, but would be fairly trivial to make work on XP. If you've got the same problem as me, then you can just run the vbs file and it will sort the issue temporarily.

Comment 140

6 years ago
Created attachment 750788 [details]
Vbscript to reset the window position on Windows 7

No idea if I'm attaching this correctly
Comment hidden (off-topic)
Comment hidden (me-too)

Comment 143

6 years ago
linux
I have a dual boot system (Win7 Home & Fedora 18/Gnome 3.4)  and I don't have a problem with Win7 but for several versions of Fedora, FF has always opened in the primary screen and I have to move it to the secondary screen were I prefer to use it.  So just wanted to put my vote in to get some attention to correcting this annoyance.
DM
Comment hidden (obsolete)

Comment 145

5 years ago
linux
#144: As it has been said multiple times in the comments, this does not always work, and does not work under Linux at all.
Comment hidden (advocacy)

Comment 147

5 years ago
osx
"There is a quick work around for that. Open firefox, un-maximized it, move it to the other screen, close it. It will be on that screen next time you open it. You can now maximize it without any problem."

This doesn't do anything at all. Still have the problem with OS X 10.8.4, FF 23.0.1 running on an early 2008 Mac Pro 3,1

I deleted the preferences but still no joy.

Comment 148

5 years ago
The workaround is for the Windows issue. Issues in Linux/OS X may not have the same underlying cause.
Not the case when restarting after updating, it will always open in the wrong one.
Comment hidden (advocacy)
Comment hidden (me-too)

Updated

5 years ago
Whiteboard: [gs][duptome] → [gs][duptome][Australis:P?]
Comment hidden (advocacy)
Comment hidden (advocacy)
Comment hidden (advocacy)
Comment hidden (advocacy)
Comment hidden (advocacy)

Updated

5 years ago
Duplicate of this bug: 674187
Comment hidden (me-too)
Comment hidden (advocacy)
Comment hidden (advocacy)
Hi, sorry this bug hasn't found an owner so far.  Since it looks like it'll need separate platform-specific fixes on Linux, Windows, and Mac OS X, I suggest the following to help to get things moving finally:

1) File three new bugs, one for Widget:Gtk (linux), one for Widget:Cocoa (mac), and for under Windget:Win32 (windows).  Mark each of them as "blocking" this original bug.

2) Copy Jez's patch (attachment 543486 [details] [diff] [review]) to the Widget:Cocoa bug and update it if necessary.

3) Copy the information in comment 123 to the Widget:Gtk bug.

Then we can use this bug as a meta/tracking bug, while actual work takes place in the three platform-specific bugs.  The platform-specific bugs are more likely to be seen by people working or searching in those separate components, and will be easier to read since they will (I hope!) remain free of advocacy comments.  If people who want to help test the bug on each platform would like to start filing these bugs now, that'd be great; otherwise I will do it in the next few days.  I'll also try to locate owners for each of the platform specific bugs.

Comment 162

5 years ago
Don't forget comment 51 for the Widget:Win32 bug!
Storing the window position for windows and it's not in a WINDOWPLACEMENT struct (or analog thereof)? shameful!
Depends on: 1005618
Depends on: 1005619
Depends on: 1005620

Comment 163

5 years ago
Thank you Matt, i hope that this will help.

But how do we get the votes from this ticket to its children?
I unterstood from earlier comments that only with votes there is a chance that someone starts working on it.

Comment 164

5 years ago
Votes are almost completely ignored, this is not a democracy. They might be used to decide what is a popular bug or not, but they don't directly influence the decision process.

But that's all off-topic.

Comment 165

5 years ago
So what is voting for then?

Comment 166

5 years ago
50 cents: 

as it works on windows, and remebering where you are on screen is a build-in feature, it's clearly a bug.

O= How you find out where your windows are : xwininfo


First one is NOT maximised : 

xwininfo: Please select the window about which you
          would like information by clicking the
          mouse in that window.

xwininfo: Window id: 0x12000a0 "264030 – Using dual monitors, Firefox/Thunderbird always opens in wrong monitor, does not remember correct monitor location when maximized - Mozilla Firefox"

  Absolute upper-left X:  1504
  Absolute upper-left Y:  118
  Relative upper-left X:  10
  Relative upper-left Y:  42
  Width: 1144
  Height: 803
  Depth: 24
  Visual: 0x21
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x20 (installed)
  Bit Gravity State: NorthWestGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +1504+118  -72+118  -72-103  +1504-103
  -geometry 1144x803-62+76


This one IS maximised : 

xwininfo: Please select the window about which you
          would like information by clicking the
          mouse in that window.

xwininfo: Window id: 0x12000a0 "264030 – Using dual monitors, Firefox/Thunderbird always opens in wrong monitor, does not remember correct monitor location when maximized - Mozilla Firefox"

  Absolute upper-left X:  1440
  Absolute upper-left Y:  34
  Relative upper-left X:  0
  Relative upper-left Y:  34
  Width: 1280
  Height: 990
  Depth: 24
  Visual: 0x21
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x20 (installed)
  Bit Gravity State: NorthWestGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +1440+34  -0+34  -0-0  +1440-0
  -geometry 1280x990-0+0


Possible solution:

AS thunderbird and firefox with x11 decide the position on the fact where the mousepointer is at startup, a fix could be to "overwrite" that information on purpose.

Comment 167

5 years ago
O== Workaround: HOW TO FIX for Fedora & Gnome

1)  install xdotool 

sudo yum install xdotool

2) edit the startparameter of your desktop/menuentry to:

bash -c "xdotool mousemove 1540 134;firefox %u"

where 1540 134 are the Left-Top Coordinates inside your secondary screen. You can move the mouse anywhere you like inside the screen. I suggest to use resonable positions, so that you don't need to search for your mousepointer.

For this example my primary screen is 1440x900, so i choosed 1540 as it's 100px away from the left side of the sccreen. 

If you need a graphical hint, check this out: 

http://marius.bloggt-in-braunschweig.de/2014/06/01/thunderbird-und-firesfox-auf-dem-zweiten-screen-oeffnen/
Duplicate of this bug: 1035435

Comment 169

4 years ago
Not anymore repro for me on FF branch 31, Win7 x64 (same environment when I saw it).
Duplicate of this bug: 1025468
This just started happening for me with Thunderbird 31.6 on Windows 7.
(In reply to Martin Giger from comment #171)
> This just started happening for me with Thunderbird 31.6 on Windows 7.

Could you open a new bug report for that in the "Thunderbird" product, please?  Make sure to mention this bug in the new report, and the fact that the behavior has started occurring again in a new version.  Thanks!
(In reply to Matt Brubeck (:mbrubeck) from comment #172)
> (In reply to Martin Giger from comment #171)
> > This just started happening for me with Thunderbird 31.6 on Windows 7.
> 
> Could you open a new bug report for that in the "Thunderbird" product,
> please?  Make sure to mention this bug in the new report, and the fact that
> the behavior has started occurring again in a new version.  Thanks!

I'll wait another week, since I can't reproduce it on windows anymore, but it now happens on Linux, which was a fresh install.

Comment 174

4 years ago
just checked:

Linux Thunderbird => does open where the mouse pointer is
Linux Firefox     => does open where the mouse pointer is

FireFox: 37.0.1-1 FC20
Thunderbird: 31.5.0-1 FC20

Comment 175

4 years ago
BTW: there are a few bugs open with this dual monitors problem, opening a new one won't help IMHO.
Comment hidden (advocacy)

Updated

3 years ago
Keywords: meta
Whiteboard: [gs][duptome][Australis:P?] → [gs][duptome][Australis:P?][tpi:-]

Comment 177

2 years ago
FF 47 on Linux... New window (activated via JavaScript I think) opens on wrong monitor.

Windows activated via "New Window" or "Open Link in New Window" work as expected.
Problem still exists 13 years later. My setup:

* Ubuntu Linux 16.04
* 3 monitors
* Firefox 52.0 (64-bit)
This bug is already fixed on Windows.

For other platforms, someone has to implement nsIWidget::GetRestoredBounds() on the platform. (I can't because I have only Windows box.)

Comment 180

2 years ago
With FF 52.0.1 on Windows 7 64 Bit the bug seems to be fixed.

Comment 181

2 years ago
in Windows it was fixed long ago. It's a *nix problem as stated in #179

Comment 182

a year ago
Facing this problem again and again,

2 Monitors
Thunderbird 52.1.1 (64-bit)
Linux Mint 18.1 Serena

Comment 183

9 months ago
On windows this is fixed. we have individual bugs for osx and linux on file.
Status: NEW → RESOLVED
Last Resolved: 9 months ago
Resolution: --- → WORKSFORME

Comment 184

9 months ago
This always happens when using remote desktop.
If you minimize Firefox or Thunderbird windows - bringing them to the foreground is mission impossible.

Comment 185

9 months ago
(In reply to Dobri from comment #184)
> This always happens when using remote desktop.
> If you minimize Firefox or Thunderbird windows - bringing them to the
> foreground is mission impossible.

Also, the same thing happens with Telegram, so something in common?

Comment 186

7 months ago
It's not a "nix problem.

Note that Chrome and Opera on *nix has no such issue.

Only FF does.
You need to log in before you can comment on or make changes to this bug.