fix loss of Keyboard::current_window tracking when leaving a dialog by clicking a button

git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4191 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2008-11-17 15:48:51 +00:00
parent 6e78630e5a
commit c2cc784829
2 changed files with 23 additions and 18 deletions

View File

@ -76,6 +76,7 @@ ArdourDialog::on_leave_notify_event (GdkEventCrossing *ev)
void
ArdourDialog::on_unmap ()
{
Keyboard::the_keyboard().leave_window (0, this);
Dialog::on_unmap ();
}

View File

@ -301,25 +301,29 @@ Keyboard::enter_window (GdkEventCrossing *ev, Gtk::Window* win)
bool
Keyboard::leave_window (GdkEventCrossing *ev, Gtk::Window* win)
{
switch (ev->detail) {
case GDK_NOTIFY_INFERIOR:
if (debug_keyboard) {
cerr << "INFERIOR crossing ... out\n";
if (ev) {
switch (ev->detail) {
case GDK_NOTIFY_INFERIOR:
if (debug_keyboard) {
cerr << "INFERIOR crossing ... out\n";
}
break;
case GDK_NOTIFY_VIRTUAL:
if (debug_keyboard) {
cerr << "VIRTUAL crossing ... out\n";
}
/* fallthru */
default:
if (debug_keyboard) {
cerr << "REAL CROSSING ... out\n";
cerr << "clearing current target\n";
}
state.clear ();
current_window = 0;
}
break;
case GDK_NOTIFY_VIRTUAL:
if (debug_keyboard) {
cerr << "VIRTUAL crossing ... out\n";
}
/* fallthru */
default:
if (debug_keyboard) {
cerr << "REAL CROSSING ... out\n";
cerr << "clearing current target\n";
}
state.clear ();
} else {
current_window = 0;
}