Permalink
Browse files

Fix client sometimes losing focus on linux

  • Loading branch information...
UnknownShadow200 committed Nov 7, 2018
1 parent 8447c1f commit 79803313c198a6f10132caa98423f5593d8d5699
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/NixWindow.c
View
@@ -545,6 +545,9 @@ void Window_ProcessEvents(void) {
case FocusIn:
case FocusOut:
{
/* Don't lose focus when another app grabs key or mouse */
if (e.xfocus.mode == NotifyGrab || e.xfocus.mode == NotifyUngrab) break;
bool wasFocused = Window_Focused;
Window_Focused = e.type == FocusIn;
if (Window_Focused != wasFocused) {
@@ -553,8 +556,7 @@ void Window_ProcessEvents(void) {
} break;
case MappingNotify:
/* 0 == MappingModifier, 1 == MappingKeyboard */
if (e.xmapping.request == 0 || e.xmapping.request == 1) {
if (e.xmapping.request == MappingModifier || e.xmapping.request == MappingKeyboard) {
Platform_LogConst("keybard mapping refreshed");
XRefreshKeyboardMapping(&e.xmapping);
}

0 comments on commit 7980331

Please sign in to comment.