Refactor deactivation of seamless mode

Toggling out of seamless mode is piggy backed on toggle fullscreen.
This introduces a broken behaviour were you get out of seamless mode
and subsequent calls to toggle fullscreen will not take you back.
Just toggle the window between windowed and fullscreen mode.

This refactoring will disable toggle between fullscreen and windowed
mode when rdesktop is started in seamless mode. Still there is a
problem were you can not go back into seamless mode when deactivated.

Signed-off-by: Henrik Andersson <hean01@cendio.com>
Signed-off-by: Thomas Nilefalk <thoni56@cendio.se>
This commit is contained in:
Cendio 2017-11-21 16:36:57 +01:00
parent 5961aabc00
commit 4ea0e06713
2 changed files with 21 additions and 5 deletions

View File

@ -44,6 +44,8 @@ extern int g_keyboard_subtype;
extern int g_keyboard_functionkeys;
extern int g_win_button_size;
extern RD_BOOL g_enable_compose;
extern RD_BOOL g_seamless_rdp;
extern RD_BOOL g_seamless_active;
extern RDP_VERSION g_rdp_version;
extern RD_BOOL g_numlock_sync;
@ -644,7 +646,21 @@ handle_special_keys(uint32 keysym, unsigned int state, uint32 ev_time, RD_BOOL p
{
/* Ctrl-Alt-Enter: toggle full screen */
if (pressed)
xwin_toggle_fullscreen();
{
if (!g_seamless_rdp)
{
/* only allow toggle fullscreen when not running
rdesktop in seamless mode */
xwin_toggle_fullscreen();
}
else
{
/* deactivate seamless mode for debug purpose, one can
not activate seamless mode again */
if (g_seamless_active)
ui_seamless_toggle();
}
}
return True;
}
break;

8
xwin.c
View File

@ -101,7 +101,7 @@ typedef struct _seamless_window
static seamless_window *g_seamless_windows = NULL;
static unsigned long g_seamless_focused = 0;
static RD_BOOL g_seamless_started = False; /* Server end is up and running */
static RD_BOOL g_seamless_active = False; /* We are currently in seamless mode */
RD_BOOL g_seamless_active = False; /* We are currently in seamless mode */
static RD_BOOL g_seamless_hidden = False; /* Desktop is hidden on server */
static RD_BOOL g_seamless_broken_restack = False; /* WM does not properly restack */
extern RD_BOOL g_seamless_rdp;
@ -2257,9 +2257,9 @@ xwin_toggle_fullscreen(void)
{
Pixmap contents = 0;
if (g_seamless_active)
/* Turn off SeamlessRDP mode */
ui_seamless_toggle();
/* When running rdesktop in seamless mode, toggling of fullscreen is not allowed */
if (g_seamless_rdp)
return;
if (!g_ownbackstore)
{