Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Window off screen when monitors change #3558

Closed
aljachimiak opened this issue Aug 30, 2016 · 18 comments
Closed

Window off screen when monitors change #3558

aljachimiak opened this issue Aug 30, 2016 · 18 comments

Comments

@aljachimiak
Copy link

aljachimiak commented Aug 30, 2016

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

@Sh1d0w Sh1d0w added the bug label Aug 30, 2016
@Sh1d0w Sh1d0w self-assigned this Aug 30, 2016
@Sh1d0w
Copy link

Sh1d0w commented Aug 31, 2016

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)

@bsclifton
Copy link
Member

bsclifton commented Sep 6, 2016

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

@jonathansampson
Copy link
Collaborator

jonathansampson commented Feb 26, 2017

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).

@bsclifton bsclifton added this to the Backlog milestone Mar 14, 2017
@bsclifton bsclifton assigned jonathansampson and unassigned Sh1d0w Mar 14, 2017
@bsclifton
Copy link
Member

It sounded like this issue was mostly solved with #7396, there were just a few things which needed to be worked out 😄

Assigned over to @jonathansampson

@jonathansampson
Copy link
Collaborator

jonathansampson commented Apr 10, 2017

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 bsclifton changed the title When opening Brave, could not locate the ui window. Window off screen when monitors change Aug 21, 2017
@NejcZdovc
Copy link
Contributor

@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?

@NejcZdovc
Copy link
Contributor

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

@bsclifton
Copy link
Member

@NejcZdovc let's do it 😄 👍 Assigning to 0.20.x

@NejcZdovc
Copy link
Contributor

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

@NejcZdovc
Copy link
Contributor

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

@bryan-learn
Copy link

bryan-learn commented Sep 25, 2017

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: 7ab85e9
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

@NejcZdovc
Copy link
Contributor

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

@bblaha
Copy link

bblaha commented Oct 17, 2017

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).

@jonathansampson
Copy link
Collaborator

@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.

@aliakyurek
Copy link

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.

@srirambv
Copy link
Collaborator

srirambv commented Jan 9, 2018

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

@shortstuffsushi
Copy link

shortstuffsushi commented Mar 15, 2018

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).

@kjozwiak
Copy link
Member

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.