Skip to content

Commit

Permalink
tune console window restore from minimize
Browse files Browse the repository at this point in the history
  • Loading branch information
Joern Hinrichsen committed Dec 16, 2020
1 parent 83fcefd commit e7357e0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ build/
bld/
[Bb]in/
[Oo]bj/

enc_temp_folder/
# Roslyn cache directories
*.ide/

Expand Down
3 changes: 2 additions & 1 deletion capsicain/capsicain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

using namespace std;

const string VERSION = "62";
const string VERSION = "63alpha";

string SCANCODE_LABELS[256]; // contains e.g. [01]="ESC" instead of SC_ESCAPE

Expand Down Expand Up @@ -743,6 +743,7 @@ void processModifierState()
}
}

//handle all REWIRE configs
void processRewire()
{
if (option.flipAltWinOnAppleKeyboards && globalState.deviceIsAppleKeyboard)
Expand Down
10 changes: 9 additions & 1 deletion capsicain/traybar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,15 @@ bool ShowInTaskbar()
{
if (IsCapsicainInTray())
DeleteIconFromTraybar();
return ::ShowWindow(::GetConsoleWindow(), SW_SHOWDEFAULT);
HWND myWindow = ::GetConsoleWindow();
if (myWindow == NULL)
{
std::cout << std::endl << "BUG? GetConsoleWindow() failed";
return false;
}
ShowWindow(myWindow, SW_RESTORE);
SetForegroundWindow(myWindow);
return true;
}

bool ShowInTraybar()
Expand Down

0 comments on commit e7357e0

Please sign in to comment.