public void when_key_release (KeyRelease event) {
    keycode = event.detail ();
    int keystate = event.state ();
    keysym = display.input.keycode_to_keysym (keycode, keystate);

    if (!focus_key_pressed
      || !(keysym == Misc.META_L
	|| keysym == Misc.META_R
	|| keysym == Misc.ALT_L
	|| keysym == Misc.ALT_R
	|| keysym == Misc.SUPER_L
	|| keysym == Misc.SUPER_R)) return;

    display.input.ungrab_keyboard ();
    focus_key_pressed = false;

    // finally user has chosen a new active window
    update_client_order (focus);
  }