Browser-laptop: Window off screen when monitors change

Created on 30 Aug 2016  路  18Comments  路  Source: brave/browser-laptop

Test plan

  1. Extend laptop display
  2. Launch Brave and move it to extended display
  3. Reboot the machine
  4. Launch Brave, should open in extended display where it was before

Did you search for similar issues before submitting this one?
Yes

Describe the issue you encountered:
Note: I've experienced this issue before.

  • Using Windows
  • From a laptop
  • Plugged into an external monitor
  • Using "Extended" desktop rather than "mirrored"
  • Has also happened in Chrome in the past

When opening Brave, I could not locate the ui window.

Expected behavior:
When Opening brave, I should be able to see the ui window.

  • Platform (Win7, 8, 10? macOS? Linux distro?):
    Win 10
  • Brave Version: 0.11.5
  • Steps to reproduce:

    1. Use a Laptop with Windows

    2. Plug in external monitors

    3. Leave Brave Open

    4. Reboot Laptop

    5. ???

    6. Attempt to open Brave

    7. Cannot see ui window

Related Symptoms for bug squashing:
To fix this issue temporarily, I did the following.
1.went to C:/Users/{username}/AppdData/Roaming/brave
2.opened session-store-1 in a text editor
3.saw this json:

...
        "ui": {
                "downloadsToolbar": {
                    "isVisible": false
                },
                "isMaximized": false,
                "mouseInTitlebar": true,
                "position": [
                    -15244,
                    7
                ],
                "tabs": {
                    "tabPageIndex": 0
                }
            }
        }
    ]
}

4.I changed the ui.position from [_-15244_, 7] to [0, 7]
5,Now when opening brave, I could see the ui window

  • Screenshot if needed:
  • Any related issues:
    I have experienced something similar on Chrome(desktop on windows) in the past.
  • Suggestion
    Maybe doing a check on the ui.position and making sure it isn't out of some sort of pre-defined range. If it is out of range, then set it to 0 on start.

-Al

Qchecked-Win64 Qchecked-macOS Qtest-plan-specified bug release-noteinclude settings

All 18 comments

I wasn't able to reproduce this with v0.11.6 on Linux. Maybe it is windows only issue and maybe it is related to #3543 .

I was never able to see a negative value for display position when moving the brave window to the second display, even if I tried to move the second display on the left or on the right and then shutdown the OS.

This need to be tested on Windows however to confirm that and maybe on macOS as well.

cc @luixxiul @alexwykoff

Edit: Even if I manage to set a negative value to the ui.position by dragging the window out of any visible monitor's bouns, after I close it and reopen it, it is correctly positioned in the visible area of the last monitor it was on (on Linux again)

This issue may happen w/ mirrored also, cc: @BrendanEich

I ran into this issue today as well, and resolve in the same manner. Somehow, my configuration was set to create a 960px-wide window, at more than -1400px off the screen. This may have something to do with my hi-DPI Surface Book being attached to my standard-DPI external monitor.

For now, I suspect a straight-forward fix/patch would be to calculate whether or not the window will be visible (given its dimensions, and offset). In the event that it isn't, default to 0, or some calculated offset that factors in the window index (1 is 0px, 2 is 10px, etc).

It sounded like this issue was mostly solved with https://github.com/brave/browser-laptop/pull/7396, there were just a few things which needed to be worked out 馃槃

Assigned over to @jonathansampson

I don't have a fix at this time, but switching your primary display temporarily appears to resolve the positioning. I connect a secondary monitor, and thus change my primary display from time to time. This apparently yields the undesired behavior above.

Temporary Work-around:

  1. Make another monitor your primary display
  2. Revert back to your initial arrangement

Alternative Work-around

  1. Close all _Brave.exe_ processes
  2. On Windows, open _%appdata%/brave/session-store-1_ in Notepad
  3. Locate "position":[x,y], where x and y are numbers
  4. Replace these numbers with 0,0 to read "position":[0,0] and save
  5. Start Brave

@bsclifton is ok to pull this into 0.20.x, because I already worked on #10458 and #10580 in 0.20.x and I have a fix for this one as well?

now that I think about it, maybe #10458 will fix this automatically. @jonathansampson I see that you can reproduce this problem, can you please checkout #10458 and see if this was fixed? Thank you

@NejcZdovc let's do it 馃槃 馃憤 Assigning to 0.20.x

@brave/qa can you please retest this with the latest master? Thank you

I tried this with the latest master and if I set values to top: -8000 and left: -8000 in session store, window is displayed correctly. Closing this as solved with #10458

Is the fix for this issue in version 0.18.36? I can still reproduce this issue on Windows 10 with the latest release of Brave:

Brave: 0.18.36
rev: 7ab85e97318fef041433b0c3d73b457205fae805
Muon: 4.3.22
libchromiumcontent: 61.0.3163.79
V8: 6.1.534.32
Node.js: 7.9.0
Update Channel: dev
OS Platform: Microsoft Windows
OS Release: 10.0.15063
OS Architecture: x64

@bryan-learn this will be fixed in release 0.20.x

Happened to me for the first time right now. Tried the temporary fix but did not work. Tried the alternative workaround but was not able to find the word "position" in session-store-1 at all.
I also tried unplugging all screens but the main screen and restarted the browser and PC multiple times. I have no way of getting brave to work again right now (Windows Key + Arrow keys do not work either).

@bblaha Temporarily setting a new main screen should resolve the issue. If it does not, we can hop on a Skype/Hangout call together (at your convenience) to take a closer look.

With v0.19.53, "position":[x,y] does not exist.

Instead I've found the current keys for ui positioning in 0.19.53:
"defaultWindowParams".
There I set x and y to 0. Now I can see window again.

Verified as fixed on Windows. Open Brave beta 0.20.16. Moved to extended display,reboot machine and launch brave-beta opens properly on extended display

This seems to have cropped up for me again on Windows 21.18. I can't find the session store file anymore to fix it either, so the browser is currently only usable in full screen.

Edit: was able to find the session file now, was in the wrong Brave folder in App Data (apparently both Local and Roaming have Brave files).

@shortstuffsushi would you mind creating a new issue if you're still seeing this happen and reference this one?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bbondy picture bbondy  路  3Comments

luixxiul picture luixxiul  路  3Comments

stevespringett picture stevespringett  路  3Comments

jonathansampson picture jonathansampson  路  3Comments

shortstuffsushi picture shortstuffsushi  路  3Comments