keyboard: don't catch Ctrl+Alt-C if encomsp is not activated

This commit is contained in:
David Fort 2019-08-22 22:17:35 +02:00 committed by akallabeth
parent 067b7dfd1c
commit 96aeb8512d
3 changed files with 6 additions and 5 deletions

View File

@ -726,14 +726,14 @@ void xf_toggle_fullscreen(xfContext* xfc)
PubSub_OnWindowStateChange(context->pubSub, context, &e);
}
void xf_toggle_control(xfContext* xfc)
BOOL xf_toggle_control(xfContext* xfc)
{
EncomspClientContext* encomsp;
ENCOMSP_CHANGE_PARTICIPANT_CONTROL_LEVEL_PDU pdu;
encomsp = xfc->encomsp;
if (!encomsp)
return;
return FALSE;
pdu.ParticipantId = 0;
pdu.Flags = ENCOMSP_REQUEST_VIEW;
@ -743,6 +743,7 @@ void xf_toggle_control(xfContext* xfc)
encomsp->ChangeParticipantControlLevel(encomsp, &pdu);
xfc->controlToggle = !xfc->controlToggle;
return TRUE;
}
/**

View File

@ -516,8 +516,8 @@ BOOL xf_keyboard_handle_special_keys(xfContext* xfc, KeySym keysym)
if (mod.Ctrl && mod.Alt)
{
/* Ctrl-Alt-C: toggle control */
xf_toggle_control(xfc);
return TRUE;
if (xf_toggle_control(xfc))
return TRUE;
}
}

View File

@ -238,7 +238,7 @@ struct xf_context
BOOL xf_create_window(xfContext* xfc);
void xf_toggle_fullscreen(xfContext* xfc);
void xf_toggle_control(xfContext* xfc);
BOOL xf_toggle_control(xfContext* xfc);
void xf_encomsp_init(xfContext* xfc, EncomspClientContext* encomsp);
void xf_encomsp_uninit(xfContext* xfc, EncomspClientContext* encomsp);