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

Fix global Auto-Type when database locked #3138

Merged
merged 1 commit into from May 12, 2019

Conversation

4 participants
@droidmonkey
Copy link
Member

commented May 11, 2019

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Description and Context

  • Store the currently active window right when the global keyboard shortcut is triggered
  • Eliminate unnecessary window raise/lower and delays on macOS
  • Remove duplicate addition of macutils symbols from mac Auto-Type plugin
  • Fixes #1216 and fixes #3068 and fixes #3003 and fixes #2547

Testing strategy

Tested on Windows and macOS

Checklist:

  • I have read the CONTRIBUTING document. [REQUIRED]
  • My code follows the code style of this project. [REQUIRED]
  • All new and existing tests passed. [REQUIRED]
  • I have compiled and verified my code with -DWITH_ASAN=ON. [REQUIRED]
  • My change requires a change to the documentation, and I have updated it accordingly.
  • I have added tests to cover my changes.

@droidmonkey droidmonkey added this to the v2.4.2 milestone May 11, 2019

@droidmonkey droidmonkey requested review from weslly and phoerious May 11, 2019

@phoerious
Copy link
Member

left a comment

🎉

@veysiertekin

This comment has been minimized.

Copy link

commented May 11, 2019

Hi @droidmonkey ,

I got a build from the branch, and tested. Problem #1216 seems still exists when database is locked ☹️

Screen Shot 2019-05-11 at 18 48 50

Also, if database is not locked, auto-type window does not get any focus. When i click the entry, immediately auto-type window get closed and does not type anything.

Screen Shot 2019-05-11 at 18 46 14

@droidmonkey

This comment has been minimized.

Copy link
Member Author

commented May 11, 2019

I cannot fix the main window appearing.... That is a mac "feature". You have to be careful not to click anything after you unlock and (maybe) select an entry. You might have to increase your auto type delay to make sure things settle before typing begins.

@veysiertekin

This comment has been minimized.

Copy link

commented May 11, 2019

I cannot fix the main window appearing.... That is a mac "feature".

Ok, that is an understandable reason ☺️


After unlocking the database, auto-type window gets open, but when i select any entry via keyword, does not type anything. I have tested with "Auto-type start delay" -> "1000ms" or "3000ms", and "Auto-type typing delay" with "100ms" nothing changed ☹️

Also when database is not locked and pressed global auto-type, like i mentioned above; auto-type window does not get focused there for i can not select any entry.

@weslly

This comment has been minimized.

Copy link
Member

commented May 11, 2019

I cannot fix the main window appearing.... That is a mac "feature". You have to be careful not to click anything after you unlock and (maybe) select an entry. You might have to increase your auto type delay to make sure things settle before typing begins.

Wouldn't it be better to just disable the additional popup on macOS? I already tried to hide the main window before but I don't think it is possible at all to do that with Qt on macOS

@weslly

weslly approved these changes May 11, 2019

Copy link
Member

left a comment

works great!

@droidmonkey

This comment has been minimized.

Copy link
Member Author

commented May 11, 2019

Disabling the popup would require a big refactor. I'm saving that for 2.5.0

@droidmonkey droidmonkey force-pushed the hotfix/autotype-mac branch from 288f1ad to 6c8eb79 May 12, 2019

Fix global Auto-Type when database locked
* Store the currently active window right when the global keyboard shortcut is triggered
* Eliminate unnecessary window raise/lower and delays on macOS
* Remove duplicate addition of macutils symbols from mac Auto-Type plugin
* Fix tests to fake trigger a global autotype sequence

@droidmonkey droidmonkey force-pushed the hotfix/autotype-mac branch from 6c8eb79 to cdc51f3 May 12, 2019

@droidmonkey

This comment has been minimized.

Copy link
Member Author

commented May 12, 2019

@veysiertekin I see what you mean, once the database was unlocked subsequent presses of the global auto-type shortcut causes the sequence selection dialog to not have focus. I have fixed this issue with the latest push, please try it again. I also lowered the activation delays so it feels a little more responsive.

@veysiertekin

This comment has been minimized.

Copy link

commented May 12, 2019

Hi @droidmonkey,

I have tested with your latest changes. Seems focusing problem has been fixed, but after selection of an entry, it goes back the application (in this case my browser), and keepassxc does not type anything like i mentioned above 😞 Not even a single character. (By the way i have build with qt/5.12.3, and tested on macOS 10.14.3)

@droidmonkey

This comment has been minimized.

Copy link
Member Author

commented May 12, 2019

You probably have to disable/enable the accessibility access for your custom built application. You do that in macOS settings

@veysiertekin

This comment has been minimized.

Copy link

commented May 12, 2019

After addition to accessibility controls, worked as expected!
Thanks @droidmonkey

@droidmonkey droidmonkey merged commit 6385534 into release/2.4.2 May 12, 2019

3 checks passed

MacOS (KeepassXC) TeamCity build finished
Details
Ubuntu Linux (KeepassXC) TeamCity build finished
Details
Windows 10 (KeepassXC) TeamCity build finished
Details

@droidmonkey droidmonkey deleted the hotfix/autotype-mac branch May 12, 2019

droidmonkey added a commit that referenced this pull request May 31, 2019

Release 2.4.2
- Improve resilience against memory attacks - overwrite memory before free [#3020]
- Prevent infinite save loop when location is unavailable [#3026]
- Attempt to fix quitting application when shutdown or logout issued [#3199]
- Support merging database custom data [#3002]
- Fix opening URL's with non-http schemes [#3153]
- Fix data loss due to not reading all database attachments if duplicates exist [#3180]
- Fix entry context menu disabling when using keyboard navigation [#3199]
- Fix behaviors when canceling an entry edit [#3199]
- Fix processing of tray icon click and doubleclick [#3112]
- Update group in preview widget when focused [#3199]
- Prefer DuckDuckGo service over direct icon download (increases resolution) [#2996]
- Remove apply button in application settings [#3019]
- Use winqtdeploy on Windows to correct deployment issues [#3025]
- Don't mark entry edit as modified when attribute selection changes [#3041]
- Use console code page CP_UTF8 on Windows if supported [#3050]
- Snap: Fix locking database with session lock [#3046]
- Snap: Fix theming across Linux distributions [#3057]
- Snap: Use SNAP_USER_COMMON and SNAP_USER_DATA directories [#3131]
- KeeShare: Automatically enable WITH_XC_KEESHARE_SECURE if quazip is found [#3088]
- macOS: Fix toolbar text when in dark mode [#2998]
- macOS: Lock database on switching user [#3097]
- macOS: Fix global Auto-Type when the database is locked [#3138]
- Browser: Close popups when database is locked [#3093]
- Browser: Add tests [#3016]
- Browser: Don't create default group if custom group is enabled [#3127]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.