pubpub-zz / ppInk

Fork from Gink
MIT License
855 stars 76 forks source link

Pointer mode ending on ppInk get focus after application close #321

Open kbh81 opened 1 month ago

kbh81 commented 1 month ago

I have found what I believe is an issue with the window management / pointer mode:

In brief: ppInk returns to drawing mode even when not wanted.

Occurs when: When I start pointer mode in ppInk, then change to an application to work in that, but then close that application. Then MSWindows will give ppInk the focus as it is the next in the window stack. ppInk then always immediately goes back in drawing mode, even if want to stay in Pointer mode (in order to click on a different background window after closing the first). This even happens if Hide_In_AltTab=True, independant of AltTab_Pointer, I have tried a ton of different ini value combinations in ppInk but can not get this problem to go away.

Desired behavior: Behavior (potentially via new ini flag) that will strictly ONLY change between pointer and drawing mode via the global Ctrl+Alt+G hotkey. Closing windows, changing focus, Alt+Tab should all not matter.

Thank you for your consideration.

pubpub-zz commented 1 month ago

can you try in the options to set them up as follow: image

and tell me if this is good or not ?

kbh81 commented 1 month ago

Thank you for that comment, I tried the combinations, but it did not resolve the issue. Actually I found a separate issue where I can't even get the Options Dialog to open when the first of the above is disabled and second is enabled, but I am not worried about that. The main problem remains, I am in pointer mode (for example just open a notepad.exe, draw in it, then pointer mode) and when closing that window, with Window reasssigning focus to ppInk the pointer mode is being ended and switched to drawing mode even though I don't want that.

pubpub-zz commented 1 month ago

Things look good in here: https://github.com/user-attachments/assets/4ea71a90-9c8f-4619-bed6-fb674b1f1c28

kbh81 commented 1 month ago

Thank you for your time to create that demonstration, I agree the behavior I am seeing on my system is not occurring for yours. I will reinstall ppInk and make sure to test some further to see whether I can narrow down more in detail, why it is not the same for me.

kbh81 commented 1 month ago

One more question if you allow: Does the same demonstration (without need for you taking video) work as well when you fold the ppInk window before? So clicks would be having notepad window open: In the ppInk window select Pointer mode, flick on fold ppInk window, click in notepad window, close notepad window. That ends the pointer mode on my system.

pubpub-zz commented 1 month ago

I see no difference

pubpub-zz commented 1 month ago

@kbh81 do you have any update ? else I will close it

kbh81 commented 1 month ago

I can still reproduce the issue on my machine, would it be helpful if I record the screen, too? Minimalized step by step for me to describe the issue:

  1. Open notepad.exe
  2. Open ppInk, activate draw mode.
  3. Fold/collapse the window and draw somewhere on the screen.
  4. Use Ctrl Alt G hotkey to change to Pointer.
  5. Click in Notepad window to give focus, and then press the window X to close notepad.
  6. Now the MS Windows focus stack gives focus back to ppInk and ppInk does open/unfold its window and go back to drawing mode without me wanting it to do that.

I don't really know what else to test and wonder why its not the same behavior for you.

pubpub-zz commented 1 month ago

Are you dure this is not the side effect of other programs running in background

pubpub-zz commented 1 month ago

Are you dure this is not the side effect of other programs running in background

kbh81 commented 1 month ago

I just tried it again, closed all other programs running. So Notepad is the only window open. The behavior/issue is the same. Of course I can not be sure whether any program in the background (like e.g. VPN/PowerToys or similar in Systray, not showing a window) would influence it, but I also would not see why it would do that.

kbh81 commented 1 month ago

I have also recorded the behavior for illustration purposes: https://github.com/user-attachments/assets/398c0488-d52e-48f1-805f-7a8b8ba80731

Only OBS had to be open for the screen recording but I tried the same without it, with Chrome instead of the notepad window etc. Everytime the same behavior occurs. When the only window on top of the focus queue of MSWindows is terminated, the ppInk window gets focus, unfolds and activates the pen instead of the pointer without me doing anything.