xfreerdp: removed desktopWidth/desktopHeight vars
These were basically unused (from the contexts's point of view) and only served as temporary storage
This commit is contained in:
parent
b3b8306724
commit
98505a0234
@ -503,8 +503,6 @@ BOOL xf_create_window(xfContext* xfc)
|
|||||||
|
|
||||||
ZeroMemory(&xevent, sizeof(xevent));
|
ZeroMemory(&xevent, sizeof(xevent));
|
||||||
|
|
||||||
xf_detect_monitors(xfc);
|
|
||||||
|
|
||||||
width = xfc->sessionWidth;
|
width = xfc->sessionWidth;
|
||||||
height = xfc->sessionHeight;
|
height = xfc->sessionHeight;
|
||||||
|
|
||||||
@ -541,12 +539,6 @@ BOOL xf_create_window(xfContext* xfc)
|
|||||||
sprintf(windowTitle, "FreeRDP: %s:%i", settings->ServerHostname, settings->ServerPort);
|
sprintf(windowTitle, "FreeRDP: %s:%i", settings->ServerHostname, settings->ServerPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xfc->fullscreen)
|
|
||||||
{
|
|
||||||
width = xfc->desktopWidth;
|
|
||||||
height = xfc->desktopHeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef WITH_XRENDER
|
#ifdef WITH_XRENDER
|
||||||
if (settings->SmartSizing)
|
if (settings->SmartSizing)
|
||||||
{
|
{
|
||||||
@ -1016,9 +1008,7 @@ BOOL xf_pre_connect(freerdp* instance)
|
|||||||
|
|
||||||
xf_keyboard_init(xfc);
|
xf_keyboard_init(xfc);
|
||||||
|
|
||||||
xf_detect_monitors(xfc);
|
xf_detect_monitors(xfc, &settings->DesktopWidth, &settings->DesktopHeight);
|
||||||
settings->DesktopWidth = xfc->desktopWidth;
|
|
||||||
settings->DesktopHeight = xfc->desktopHeight;
|
|
||||||
|
|
||||||
xfc->fullscreen = settings->Fullscreen;
|
xfc->fullscreen = settings->Fullscreen;
|
||||||
xfc->decorations = settings->Decorations;
|
xfc->decorations = settings->Decorations;
|
||||||
|
@ -115,7 +115,7 @@ BOOL xf_is_monitor_id_active(xfContext* xfc, UINT32 id)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL xf_detect_monitors(xfContext* xfc)
|
BOOL xf_detect_monitors(xfContext* xfc, UINT32* pWidth, UINT32* pHeight)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int nmonitors = 0;
|
int nmonitors = 0;
|
||||||
@ -134,8 +134,8 @@ BOOL xf_detect_monitors(xfContext* xfc)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
vscreen = &xfc->vscreen;
|
vscreen = &xfc->vscreen;
|
||||||
xfc->desktopWidth = settings->DesktopWidth;
|
*pWidth = settings->DesktopWidth;
|
||||||
xfc->desktopHeight = settings->DesktopHeight;
|
*pHeight = settings->DesktopHeight;
|
||||||
|
|
||||||
/* get mouse location */
|
/* get mouse location */
|
||||||
if (!XQueryPointer(xfc->display, DefaultRootWindow(xfc->display),
|
if (!XQueryPointer(xfc->display, DefaultRootWindow(xfc->display),
|
||||||
@ -194,26 +194,26 @@ BOOL xf_detect_monitors(xfContext* xfc)
|
|||||||
|
|
||||||
if (settings->Fullscreen)
|
if (settings->Fullscreen)
|
||||||
{
|
{
|
||||||
xfc->desktopWidth = WidthOfScreen(xfc->screen);
|
*pWidth = WidthOfScreen(xfc->screen);
|
||||||
xfc->desktopHeight = HeightOfScreen(xfc->screen);
|
*pHeight = HeightOfScreen(xfc->screen);
|
||||||
}
|
}
|
||||||
else if (settings->Workarea)
|
else if (settings->Workarea)
|
||||||
{
|
{
|
||||||
xfc->desktopWidth = xfc->workArea.width;
|
*pWidth = xfc->workArea.width;
|
||||||
xfc->desktopHeight = xfc->workArea.height;
|
*pHeight = xfc->workArea.height;
|
||||||
}
|
}
|
||||||
else if (settings->PercentScreen)
|
else if (settings->PercentScreen)
|
||||||
{
|
{
|
||||||
xfc->desktopWidth = (xfc->workArea.width * settings->PercentScreen) / 100;
|
*pWidth = (xfc->workArea.width * settings->PercentScreen) / 100;
|
||||||
xfc->desktopHeight = (xfc->workArea.height * settings->PercentScreen) / 100;
|
*pHeight = (xfc->workArea.height * settings->PercentScreen) / 100;
|
||||||
|
|
||||||
/* If we have specific monitor information then limit the PercentScreen value
|
/* If we have specific monitor information then limit the PercentScreen value
|
||||||
* to only affect the current monitor vs. the entire desktop
|
* to only affect the current monitor vs. the entire desktop
|
||||||
*/
|
*/
|
||||||
if (vscreen->nmonitors > 0)
|
if (vscreen->nmonitors > 0)
|
||||||
{
|
{
|
||||||
settings->DesktopWidth = ((vscreen->monitors[current_monitor].area.right - vscreen->monitors[current_monitor].area.left + 1) * settings->PercentScreen) / 100;
|
*pWidth = ((vscreen->monitors[current_monitor].area.right - vscreen->monitors[current_monitor].area.left + 1) * settings->PercentScreen) / 100;
|
||||||
settings->DesktopHeight = ((vscreen->monitors[current_monitor].area.bottom - vscreen->monitors[current_monitor].area.top + 1) * settings->PercentScreen) / 100;
|
*pHeight = ((vscreen->monitors[current_monitor].area.bottom - vscreen->monitors[current_monitor].area.top + 1) * settings->PercentScreen) / 100;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -245,8 +245,8 @@ BOOL xf_detect_monitors(xfContext* xfc)
|
|||||||
|
|
||||||
settings->MonitorDefArray[nmonitors].x = vscreen->monitors[i].area.left;
|
settings->MonitorDefArray[nmonitors].x = vscreen->monitors[i].area.left;
|
||||||
settings->MonitorDefArray[nmonitors].y = vscreen->monitors[i].area.top;
|
settings->MonitorDefArray[nmonitors].y = vscreen->monitors[i].area.top;
|
||||||
settings->MonitorDefArray[nmonitors].width = MIN(vscreen->monitors[i].area.right - vscreen->monitors[i].area.left + 1, xfc->desktopWidth);
|
settings->MonitorDefArray[nmonitors].width = MIN(vscreen->monitors[i].area.right - vscreen->monitors[i].area.left + 1, *pWidth);
|
||||||
settings->MonitorDefArray[nmonitors].height = MIN(vscreen->monitors[i].area.bottom - vscreen->monitors[i].area.top + 1, xfc->desktopHeight);
|
settings->MonitorDefArray[nmonitors].height = MIN(vscreen->monitors[i].area.bottom - vscreen->monitors[i].area.top + 1, *pHeight);
|
||||||
settings->MonitorDefArray[nmonitors].orig_screen = i;
|
settings->MonitorDefArray[nmonitors].orig_screen = i;
|
||||||
|
|
||||||
nmonitors++;
|
nmonitors++;
|
||||||
@ -257,8 +257,8 @@ BOOL xf_detect_monitors(xfContext* xfc)
|
|||||||
{
|
{
|
||||||
settings->MonitorDefArray[0].x = vscreen->monitors[current_monitor].area.left;
|
settings->MonitorDefArray[0].x = vscreen->monitors[current_monitor].area.left;
|
||||||
settings->MonitorDefArray[0].y = vscreen->monitors[current_monitor].area.top;
|
settings->MonitorDefArray[0].y = vscreen->monitors[current_monitor].area.top;
|
||||||
settings->MonitorDefArray[0].width = MIN(vscreen->monitors[current_monitor].area.right - vscreen->monitors[current_monitor].area.left + 1, xfc->desktopWidth);
|
settings->MonitorDefArray[0].width = MIN(vscreen->monitors[current_monitor].area.right - vscreen->monitors[current_monitor].area.left + 1, *pWidth);
|
||||||
settings->MonitorDefArray[0].height = MIN(vscreen->monitors[current_monitor].area.bottom - vscreen->monitors[current_monitor].area.top + 1, xfc->desktopHeight);
|
settings->MonitorDefArray[0].height = MIN(vscreen->monitors[current_monitor].area.bottom - vscreen->monitors[current_monitor].area.top + 1, *pHeight);
|
||||||
settings->MonitorDefArray[0].orig_screen = current_monitor;
|
settings->MonitorDefArray[0].orig_screen = current_monitor;
|
||||||
|
|
||||||
nmonitors = 1;
|
nmonitors = 1;
|
||||||
@ -355,8 +355,8 @@ BOOL xf_detect_monitors(xfContext* xfc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Set the desktop width and height according to the bounding rectangle around the active monitors */
|
/* Set the desktop width and height according to the bounding rectangle around the active monitors */
|
||||||
xfc->desktopWidth = vscreen->area.right - vscreen->area.left + 1;
|
*pWidth = vscreen->area.right - vscreen->area.left + 1;
|
||||||
xfc->desktopHeight = vscreen->area.bottom - vscreen->area.top + 1;
|
*pHeight = vscreen->area.bottom - vscreen->area.top + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -44,7 +44,7 @@ typedef struct _VIRTUAL_SCREEN VIRTUAL_SCREEN;
|
|||||||
#include "xfreerdp.h"
|
#include "xfreerdp.h"
|
||||||
|
|
||||||
FREERDP_API int xf_list_monitors(xfContext* xfc);
|
FREERDP_API int xf_list_monitors(xfContext* xfc);
|
||||||
FREERDP_API BOOL xf_detect_monitors(xfContext* xfc);
|
FREERDP_API BOOL xf_detect_monitors(xfContext* xfc, UINT32* pWidth, UINT32* pHeight);
|
||||||
FREERDP_API void xf_monitors_free(xfContext* xfc);
|
FREERDP_API void xf_monitors_free(xfContext* xfc);
|
||||||
|
|
||||||
#endif /* __XF_MONITOR_H */
|
#endif /* __XF_MONITOR_H */
|
||||||
|
@ -171,8 +171,6 @@ struct xf_context
|
|||||||
wArrayList* xevents;
|
wArrayList* xevents;
|
||||||
char* actionScript;
|
char* actionScript;
|
||||||
|
|
||||||
UINT32 desktopWidth;
|
|
||||||
UINT32 desktopHeight;
|
|
||||||
XSetWindowAttributes attribs;
|
XSetWindowAttributes attribs;
|
||||||
BOOL complex_regions;
|
BOOL complex_regions;
|
||||||
VIRTUAL_SCREEN vscreen;
|
VIRTUAL_SCREEN vscreen;
|
||||||
|
Loading…
Reference in New Issue
Block a user