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

Hotkey CTRL + W on last tab of many closes the entire browser #9364

Closed
hoffination opened this issue Jun 9, 2017 · 9 comments
Closed

Hotkey CTRL + W on last tab of many closes the entire browser #9364

hoffination opened this issue Jun 9, 2017 · 9 comments
Labels
duplicate Issue has already been reported

Comments

@hoffination
Copy link

hoffination commented Jun 9, 2017

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

  • Describe the issue you encountered:
    When I have multiple tabs open and press CTRL + W on the last tab the entire browser closes

  • Platform (Win7, 8, 10? macOS? Linux distro?): Win 10

  • Brave Version (revision SHA): 0.16.6

  • Steps to reproduce:

    1. Open more than one tab
    2. Navigate to the last tab
    3. Type CTRL + W
  • Actual result: Closes the Browser when hotkey closing the last tab

  • Expected result: Closes the Browser when hotkey closing the last tab

  • Will the steps above reproduce in a fresh profile? If not what other info can be added?
    Not Sure

  • Is this an issue in the currently released version?
    Yes

  • Can this issue be consistently reproduced?
    No

@bsclifton bsclifton added needs-investigation A bug not 100% confirmed/fixed that needs QA to better audit. OS/Windows and removed suggestion labels Jun 11, 2017
@bsclifton
Copy link
Member

@hoffination do you have more information about this? I've tried to reproduce and haven't had any luck. I did notice if you hold Ctrl + W down for a few seconds, it will quickly close the tabs and once none are left, it closes the browser

@hoffination
Copy link
Author

@bsclifton I reproduced it this morning on the last tab when I navigate to an nginx hosted website on localhost:80. I also was able to reproduce it on the produced about:error page when the server was shutdown.

When closing that tab and trying to make another tab to reproduce it I am unable to. Anyway for me to grab a stacktrace from a log file or something if it happens again?

@kroppt
Copy link

kroppt commented Jun 13, 2017

I was able to reproduce it.

  1. Open tabs, turn on "tabs from last time" startup
  2. Close the window.
  3. Open Brave again.
  4. Ctrl+W or close out the tab.
  5. Window closes.

On startup again, the tab was never closed, just the window. So, close tab was replaced with close window.

@alexkillen
Copy link

I have this issue as well, and it also happens if I close the last tab when clicking the X.

One thing I did note is that the tab before it needs to NOT be loaded to reproduce the bug. If you switch between the last few tabs to ensure they are all loaded and then close the last tab it works fine.

@Gleiphnir
Copy link

Can confirm that the bug can be reproduced
-when 'tabs from last time' is enabled
-upon opening Brave, if there are any tabs that are not loaded, closing the current tab will close brave.

Seems like it's not checking the unloaded tabs and closes because it 'thinks' that there are no more tabs.

@kroppt
Copy link

kroppt commented Jun 15, 2017

It looks like it could be related to whether or not the other tabs are loaded. I.e. it only checks loaded tabs upon tab closing.

@GreenRecycleBin
Copy link
Contributor

Relevant code is at

state = windows.closeWindow(state, windowId)
.

Inactive pinned/non-pinned tabs have windowId set to -1. Therefore, they're not counted in tabState#getNonPinnedTabsByWindowId or tabState#getPinnedTabsByWindowId.

I've been looking for a way to count the number of all tabs that belong to a window but couldn't find any existing code that does this.

I'm not sure how to add this functionality (preferably via a minimal change).

@bsclifton I'd appreciate some pointers. Thank you.

@credej
Copy link

credej commented Jun 26, 2017

Also having this issue on macOS with closing the last tab. Has happened both with ctrl + w, and just clicking the close button. However I'm fairly certain my windows had already loaded.

When reopening after this bug, all previously opened tabs are lost even if you have the option ticked to open tabs from last time.

@bsclifton
Copy link
Member

@GreenRecycleBin sorry for not responding sooner- you nailed it 😄 The windowId needed to be set in the tabState in order for that method to return the proper number of results

I'm going to close this issue as a duplicate of #9506 which was closed by e261b9e and brave/muon@4189da5... but if anyone is still encountering it after our next release, please comment and/or reopen this issue 😄

@bsclifton bsclifton added the duplicate Issue has already been reported label Jun 27, 2017
@luixxiul luixxiul removed needs-investigation A bug not 100% confirmed/fixed that needs QA to better audit. OS/Windows labels Jun 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate Issue has already been reported
Projects
None yet
Development

No branches or pull requests

8 participants