protected override bool OnKeyReleaseEvent(Gdk.EventKey evnt) { if (initialKey.IsEmpty) { Gdk.Key key; Gdk.ModifierType mod; KeyboardShortcut [] accels; GtkWorkarounds.MapKeys(evnt, out key, out mod, out accels); initialKey = new KeyboardShortcut(key, mod); } var releaseMods = GtkWorkarounds.KeysForMod(initialKey.Modifier); if ((releaseMods.Length == 0 && (evnt.Key == Gdk.Key.Control_L || evnt.Key == Gdk.Key.Control_R)) || releaseMods.Contains(evnt.Key)) { OnRequestClose(new RequestActionEventArgs(true)); } return(base.OnKeyReleaseEvent(evnt)); }