[client,x11] add minimize shortcut
This commit is contained in:
parent
d93d9765b3
commit
215f798665
@ -40,6 +40,8 @@ static void xfreerdp_print_help(void)
|
|||||||
printf("\t\ttoggles fullscreen state of the application\n");
|
printf("\t\ttoggles fullscreen state of the application\n");
|
||||||
printf("\t<CTRL>+<ALT>+c\n");
|
printf("\t<CTRL>+<ALT>+c\n");
|
||||||
printf("\t\ttoggles remote control in a remote assistance session\n");
|
printf("\t\ttoggles remote control in a remote assistance session\n");
|
||||||
|
printf("\t<CTRL>+<ALT>+m\n");
|
||||||
|
printf("\t\tminimizes the application\n");
|
||||||
printf("\tAction Script\n");
|
printf("\tAction Script\n");
|
||||||
printf("\t\tExecutes a predefined script on key press.\n");
|
printf("\t\tExecutes a predefined script on key press.\n");
|
||||||
printf("\t\tShould the script not exist it is ignored.\n");
|
printf("\t\tShould the script not exist it is ignored.\n");
|
||||||
|
@ -10,6 +10,10 @@
|
|||||||
<listitem><para>toggles fullscreen state of the application</para></listitem>
|
<listitem><para>toggles fullscreen state of the application</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
|
<term><CTRL>+<ALT>+<m></term>
|
||||||
|
<listitem><para>Minimizes the application</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
<term><CTRL>+<ALT>+c</term>
|
<term><CTRL>+<ALT>+c</term>
|
||||||
<listitem><para>toggles remote control in a remote assistance session</para></listitem>
|
<listitem><para>toggles remote control in a remote assistance session</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -762,7 +762,7 @@ static void xf_window_free(xfContext* xfc)
|
|||||||
|
|
||||||
void xf_toggle_fullscreen(xfContext* xfc)
|
void xf_toggle_fullscreen(xfContext* xfc)
|
||||||
{
|
{
|
||||||
WindowStateChangeEventArgs e;
|
WindowStateChangeEventArgs e = { 0 };
|
||||||
rdpContext* context = (rdpContext*)xfc;
|
rdpContext* context = (rdpContext*)xfc;
|
||||||
rdpSettings* settings = context->settings;
|
rdpSettings* settings = context->settings;
|
||||||
|
|
||||||
@ -782,6 +782,28 @@ void xf_toggle_fullscreen(xfContext* xfc)
|
|||||||
PubSub_OnWindowStateChange(context->pubSub, context, &e);
|
PubSub_OnWindowStateChange(context->pubSub, context, &e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void xf_minimize(xfContext* xfc)
|
||||||
|
{
|
||||||
|
WindowStateChangeEventArgs e = { 0 };
|
||||||
|
rdpContext* context = (rdpContext*)xfc;
|
||||||
|
WINPR_ASSERT(context);
|
||||||
|
|
||||||
|
rdpSettings* settings = context->settings;
|
||||||
|
WINPR_ASSERT(settings);
|
||||||
|
|
||||||
|
/*
|
||||||
|
when debugging, ungrab keyboard when toggling fullscreen
|
||||||
|
to allow keyboard usage on the debugger
|
||||||
|
*/
|
||||||
|
if (xfc->debug)
|
||||||
|
xf_ungrab(xfc);
|
||||||
|
|
||||||
|
xf_SetWindowMinimized(xfc, xfc->window);
|
||||||
|
|
||||||
|
e.state = xfc->fullscreen ? FREERDP_WINDOW_STATE_FULLSCREEN : 0;
|
||||||
|
PubSub_OnWindowStateChange(context->pubSub, context, &e);
|
||||||
|
}
|
||||||
|
|
||||||
void xf_lock_x11_(xfContext* xfc, const char* fkt)
|
void xf_lock_x11_(xfContext* xfc, const char* fkt)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -588,24 +588,37 @@ BOOL xf_keyboard_handle_special_keys(xfContext* xfc, KeySym keysym)
|
|||||||
|
|
||||||
if (!xfc->remote_app && xfc->fullscreen_toggle)
|
if (!xfc->remote_app && xfc->fullscreen_toggle)
|
||||||
{
|
{
|
||||||
if (keysym == XK_Return)
|
switch (keysym)
|
||||||
{
|
{
|
||||||
if (mod.Ctrl && mod.Alt)
|
case XK_Return:
|
||||||
{
|
if (mod.Ctrl && mod.Alt)
|
||||||
/* Ctrl-Alt-Enter: toggle full screen */
|
{
|
||||||
xf_toggle_fullscreen(xfc);
|
/* Ctrl-Alt-Enter: toggle full screen */
|
||||||
return TRUE;
|
xf_toggle_fullscreen(xfc);
|
||||||
}
|
return TRUE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((keysym == XK_c) || (keysym == XK_C))
|
if (mod.Ctrl && mod.Alt)
|
||||||
{
|
{
|
||||||
if (mod.Ctrl && mod.Alt)
|
switch (keysym)
|
||||||
{
|
{
|
||||||
/* Ctrl-Alt-C: toggle control */
|
case XK_m:
|
||||||
if (freerdp_client_encomsp_toggle_control(xfc->common.encomsp))
|
case XK_M:
|
||||||
|
xf_minimize(xfc);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
case XK_c:
|
||||||
|
case XK_C:
|
||||||
|
/* Ctrl-Alt-C: toggle control */
|
||||||
|
if (freerdp_client_encomsp_toggle_control(xfc->common.encomsp))
|
||||||
|
return TRUE;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -312,6 +312,7 @@ struct xf_context
|
|||||||
BOOL xf_create_window(xfContext* xfc);
|
BOOL xf_create_window(xfContext* xfc);
|
||||||
BOOL xf_create_image(xfContext* xfc);
|
BOOL xf_create_image(xfContext* xfc);
|
||||||
void xf_toggle_fullscreen(xfContext* xfc);
|
void xf_toggle_fullscreen(xfContext* xfc);
|
||||||
|
void xf_minimize(xfContext* xfc);
|
||||||
|
|
||||||
enum XF_EXIT_CODE
|
enum XF_EXIT_CODE
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user