From 5d190c3ae47aef32c1f1fe48f36dd27cec721cf3 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 8 Mar 2018 01:43:04 +0300 Subject: Focus previous window after pin code accepted by server. --- src/progs/dyecmd/client.cpp | 8 ++++++++ src/progs/dyecmd/client.h | 2 ++ src/progs/manaplus/client.cpp | 8 ++++++++ src/progs/manaplus/client.h | 2 ++ 4 files changed, 20 insertions(+) (limited to 'src/progs') diff --git a/src/progs/dyecmd/client.cpp b/src/progs/dyecmd/client.cpp index 9c43b18bf..40b2ad48f 100644 --- a/src/progs/dyecmd/client.cpp +++ b/src/progs/dyecmd/client.cpp @@ -801,6 +801,14 @@ void Client::windowRemoved(const Window *const window) mCurrentDialog = nullptr; } +void Client::focusWindow() +{ + if (mCurrentDialog != nullptr) + { + mCurrentDialog->requestFocus(); + } +} + void Client::logVars() { #ifdef ANDROID diff --git a/src/progs/dyecmd/client.h b/src/progs/dyecmd/client.h index 88522e49a..89dd82e11 100644 --- a/src/progs/dyecmd/client.h +++ b/src/progs/dyecmd/client.h @@ -74,6 +74,8 @@ class Client final : public ActionListener void windowRemoved(const Window *const window); + void focusWindow(); + void slowLogic(); static bool isTmw(); diff --git a/src/progs/manaplus/client.cpp b/src/progs/manaplus/client.cpp index bc5007884..504916ea7 100644 --- a/src/progs/manaplus/client.cpp +++ b/src/progs/manaplus/client.cpp @@ -1853,6 +1853,14 @@ void Client::windowRemoved(const Window *const window) mCurrentDialog = nullptr; } +void Client::focusWindow() +{ + if (mCurrentDialog != nullptr) + { + mCurrentDialog->requestFocus(); + } +} + void Client::logVars() { #ifdef ANDROID diff --git a/src/progs/manaplus/client.h b/src/progs/manaplus/client.h index 20ac722a5..28ab7323e 100644 --- a/src/progs/manaplus/client.h +++ b/src/progs/manaplus/client.h @@ -88,6 +88,8 @@ class Client final : public ConfigListener, void windowRemoved(const Window *const window); + void focusWindow(); + void slowLogic(); ServerInfo &getCurrentServer() -- cgit v1.2.3-70-g09d2