feat: add force option to app.focus() (#22612)

This commit is contained in:
Shelley Vohr 2020-03-11 16:07:01 +00:00 committed by GitHub
parent 75cef84877
commit b724fbc0ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 6 deletions

View file

@ -163,7 +163,7 @@ Browser::UserTask::UserTask() = default;
Browser::UserTask::UserTask(const UserTask&) = default;
Browser::UserTask::~UserTask() = default;
void Browser::Focus() {
void Browser::Focus(gin_helper::Arguments* args) {
// On Windows we just focus on the first window found for this process.
DWORD pid = GetCurrentProcessId();
EnumWindows(&WindowsEnumerationHandler, reinterpret_cast<LPARAM>(&pid));