Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shortcuts ctrl+f4 and ctrl+w should close current tab #968

Closed
FractalU opened this issue Jul 30, 2023 · 9 comments · Fixed by #981
Closed

Shortcuts ctrl+f4 and ctrl+w should close current tab #968

FractalU opened this issue Jul 30, 2023 · 9 comments · Fixed by #981

Comments

@FractalU
Copy link

FractalU commented Jul 30, 2023

The shortcut ctrl + f4 only works immediately after a tab has been clicked. What I expect is that that shortcut always closes the current tab regardless of what has been clicked or what is in focus like in any other browser e.g. chrome or firefox. Furthermore, any other browser support ctrl + w along with ctrl + f4 to close the current tab.

Additional suggestion: Add ctrl + w to close the current tab.

Currently, I tested this issue on kiwix-desktop 2.3.1 on both windows 7 and 10.

@kelson42
Copy link
Collaborator

kelson42 commented Aug 3, 2023

Thank you for your bug report. To me it does not work at all and I confirm that ctrl+f4 and ctrl+w are shortcuts to close current tab in Chrome, FF and Edge. So we should implement it. Sounds easy.

@kelson42 kelson42 removed the bug label Aug 3, 2023
@kelson42 kelson42 changed the title Shortcut ctrl + f4 to close the current tab only works immediately after a tab has been clicked Shortcuts ctrl+f4 and ctrl+w should close current tab Aug 3, 2023
@FractalU
Copy link
Author

FractalU commented Aug 3, 2023

@kelson42 Thank you for your response. Actually, the bug turned out to be something else. If the mouse cursor is hovering over one of the tabs in the tab bar then ctrl + f4 closes that tab, otherwise ctrl + f4 does nothing. It only works for ctrl + f4. I thought it was the mouse click as reported above, but it turned out to be the mouse hover. I hope you can confirm that behavior.

@kelson42
Copy link
Collaborator

kelson42 commented Aug 4, 2023

If the mouse cursor is hovering over one of the tabs in the tab bar then ctrl + f4 closes that tab

Does not work for me that way.

@FractalU
Copy link
Author

FractalU commented Aug 4, 2023

That's weird. Did you test it on windows 10 or 7. Maybe it's windows specific. I definitely had that behavior on windows using kiwix-desktop 2.3.1. Maybe try again. The bug is very subtle.

@kelson42
Copy link
Collaborator

kelson42 commented Aug 4, 2023

@FractalU No, I test on Ubuntu... but at this stage, I propose we just implement the feature the right way and see if this is OK for you.

@FractalU
Copy link
Author

FractalU commented Aug 5, 2023

@kelson42 Yeah, I agree that you implement this feature the right way. I wanted to confirm whether there really is a buggy implementation already. If there is, then that implementation has to be replaced with this new one.

@kelson42
Copy link
Collaborator

kelson42 commented Aug 5, 2023

@juuz0 Is that something you could briefly implement?

@juuz0
Copy link
Collaborator

juuz0 commented Aug 8, 2023

We've a few things here

First we were getting the tab index from mouse position, which obviously was wrong.
Secondly, about the shortcuts, we used QKeySeqeuence::close which has inconsistent mappings

Both fixed in #981

@FractalU
Copy link
Author

FractalU commented Aug 8, 2023

Ah, ctrl + w does indeed work on Pop!_OS 20.04 but not ctrl + f4. That's because Pop!_OS 20.04 uses the gnome desktop environment. I wonder why ctrl + w doesn't work on Windows. It should according to QKeySequence::Close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants