make it possible to disable VisibilityTracker's use of WM visibility
[ardour.git] / libs / gtkmm2ext / keyboard.cc
index 983edbd0cf0cde30bf4c4c52e2dc50af383aaeec..08b0393d49aab0b6c9103aee7d3dba27687beb15 100644 (file)
@@ -477,6 +477,7 @@ Keyboard::leave_window (GdkEventCrossing *ev, Gtk::Window* /*win*/)
                        current_window = 0;
                }
        } else {
+               DEBUG_TRACE (DEBUG::Keyboard, "LEAVE window without event\n");
                current_window = 0;
        }
 
@@ -498,7 +499,9 @@ Keyboard::focus_out_window (GdkEventFocus * ev, Gtk::Window* win)
                state.clear ();
                current_window = 0;
        }  else {
-               current_window = 0;
+               if (win == current_window) {
+                       current_window = 0;
+               }
        }
 
        DEBUG_TRACE (DEBUG::Keyboard, string_compose ("Foucusing out window, title = %1\n", win->get_title()));