8000 [BUG] Cursor Position Loss after ALT+TAB Context Switch on WSL2 · Issue #3279 · pbek/QOwnNotes · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[BUG] Cursor Position Loss after ALT+TAB Context Switch on WSL2 #3279

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

Closed
pkeir opened this issue May 20, 2025 · 7 comments
Closed

[BUG] Cursor Position Loss after ALT+TAB Context Switch on WSL2 #3279

pkeir opened this issue May 20, 2025 · 7 comments

Comments

@pkeir
Copy link
pkeir commented May 20, 2025

As QOwnNotes is not on my employer's approved software list, on my Windows machine I build it under WSL2. (I use WSL2 a lot.) I've done this for a few years, and I'm happy with it. I have a shortcut I can click to launch it. Something like "C:\Program Files\WSL\wslg.exe" -d Ubuntu --cd "~" -- /home/XXXXXXXX/QOwnNotes/install/bin/QOwnNotes. It's QOwnNotes 25.4.3 btw. There is one small issue:

Expected behaviour

When I switch back to QOwnNotes from another application (via ALT+TAB or clicking the taskbar icon with the mouse), the program should remember my last window panel, and cursor position. e.g. If I start typing, text should appear at the last place my cursor was.

Actual behaviour

When I switch back to QOwnNotes from another application (e.g. by using ALT+TAB twice), the program has lost track of my last cursor position. I have to use the mouse, and click in the main note window, and try to remember where/what I was last writing.

I expect relatively few people are using WSL2 for GUI apps, so I was also curious if this is a WSL2 issue. I tried Evince (installed via APT as in sudo apt-get install evince), and identified that Evince does not have this issue. One can open a pdf with Evince, and click the top left button to show the side pane. By clicking in the side pane one can press UP/DOWN to move from page to page. The side pane is still active after a pair of ALT+TAB keypresses. Clicking instead in Evince's main pdf view, lets UP/DOWN now traverse the pdf with finer granularity (almost line-by-line); and a pair of ALT+TAB keypresses causes no problem here either

Steps to reproduce

  1. Type some letters in a QOwnNotes note under WSL2.
  2. Press ALT+TAB twice.
  3. Type again ... no letters appear.
@pkeir pkeir changed the title [BUG] [BUG] Cursor Position Loss after ALT+TAB Context Switch on WSL2 May 20, 2025
@pbek
Copy link
Owner
pbek commented May 20, 2025

Hm, I haven't seen that behavior on any platform. 🤔
Unfortunately, I don't own a Pro license of Windows to test with WSL2.
(But nice idea to sideload applications in WSL2. 😂)

So where does Windows put the focus in the application? On which widget...

@pbek
Copy link
Owner
pbek commented May 20, 2025

How did you install QOwnNotes, you never shared the debug output (see issue template)...

And I wonder what happens if you are using the Nix package of QOwnNotes on WLS with https://github.com/nix-community/NixOS-WSL. 😊

@pkeir
Copy link
Author
pkeir commented May 21, 2025

I can't see any focus in the Window at all. The keyboard does absolutely nothing. I Googled for common Windows menu shortcuts like CTRL+F10 and SHIFT+F10. Both work with Evince, but do nothing with QOwnNotes.

(Btw. WSL2 is now open source; and included in all versions of Windows 11.)

If an APT package is unavailable, I tend to build from source. For QOwnNotes (with Qt6 already installed):

export QT_SELECT=qt6     #   ... otherwise fails to find Qt5 (the default)
cd QOwnNotes && mkdir build && cd build
qmake ../src/QOwnNotes.pro PREFIX=../install
make -j 16 && make install
../install/bin/QOwnNotes

I thought now that maybe it's Qt, so I tried:

sudo apt-get install qt6-base-examples
/usr/lib/x86_64-linux-gnu/qt6/examples/widgets/richtext/orderform/orderform

...and the same issue is there.

@pbek
Copy link
Owner
pbek commented May 21, 2025

I guess you are using Ubuntu Linux? There is a Qt6 repository, see https://www.qownnotes.org/installation/ubuntu.html.
What happens if you press F4 (to jump to the note edit panel)?

@pkeir
Copy link
Author
pkeir commented May 21, 2025

If even the Qt examples have this issue (and Qt Creator too) I'm sure the version in that repo will be the same.

F4 works.

@pbek
Copy link
Owner
pbek commented May 21, 2025

So I guess there is not much I can do about it...

@pkeir pkeir closed this as completed May 22, 2025
@pbek
Copy link
Owner
pbek commented May 22, 2025

As QOwnNotes is not on my employer's approved software list

Btw. is your employer monitoring running processes or just not allowing to install software?
QOwnNotes doesn't need to be installed under Windows...

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

No branches or pull requests

2 participants
0