Skip to content

Commit

Permalink
Hide window when performing entry auto-type on macOS
Browse files Browse the repository at this point in the history
* Instead of choosing the last active window, always hide the current window (ie, KeePassXC)
* Fixes #2883
  • Loading branch information
droidmonkey committed Apr 11, 2019
1 parent 29c79c9 commit 17a13e3
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/autotype/AutoType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ void AutoType::executeAutoTypeActions(const Entry* entry, QWidget* hideWindow, c

if (hideWindow) {
#if defined(Q_OS_MACOS)
m_plugin->raiseLastActiveWindow();
m_plugin->hideOwnWindow();
#else
hideWindow->showMinimized();
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/autotype/AutoTypePlatformPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class AutoTypePlatformInterface
virtual AutoTypeExecutor* createExecutor() = 0;

#if defined(Q_OS_MACOS)
virtual bool raiseLastActiveWindow() = 0;
virtual bool hideOwnWindow() = 0;
virtual bool raiseOwnWindow() = 0;
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/autotype/mac/AutoTypeMac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ bool AutoTypePlatformMac::raiseWindow(WId pid)
//
// Activate last active window
//
bool AutoTypePlatformMac::raiseLastActiveWindow()
bool AutoTypePlatformMac::hideOwnWindow()
{
return macUtils()->raiseLastActiveWindow();
return macUtils()->hideOwnWindow();
}

//
Expand Down
2 changes: 1 addition & 1 deletion src/autotype/mac/AutoTypeMac.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class AutoTypePlatformMac : public QObject, public AutoTypePlatformInterface
bool raiseWindow(WId pid) override;
AutoTypeExecutor* createExecutor() override;

bool raiseLastActiveWindow() override;
bool hideOwnWindow() override;
bool raiseOwnWindow() override;

void sendChar(const QChar& ch, bool isKeyDown);
Expand Down
2 changes: 1 addition & 1 deletion src/autotype/test/AutoTypeTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ bool AutoTypePlatformTest::raiseWindow(WId window)
}

#if defined(Q_OS_MACOS)
bool AutoTypePlatformTest::raiseLastActiveWindow()
bool AutoTypePlatformTest::hideOwnWindow()
{
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/autotype/test/AutoTypeTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class AutoTypePlatformTest : public QObject, public AutoTypePlatformInterface, p
AutoTypeExecutor* createExecutor() override;

#if defined(Q_OS_MACOS)
bool raiseLastActiveWindow() override;
bool hideOwnWindow() override;
bool raiseOwnWindow() override;
#endif

Expand Down

0 comments on commit 17a13e3

Please sign in to comment.