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:
Norbert Federa 2015-04-14 17:03:53 +02:00
parent b3b8306724
commit 98505a0234
4 changed files with 19 additions and 31 deletions

View File

@ -503,8 +503,6 @@ BOOL xf_create_window(xfContext* xfc)
ZeroMemory(&xevent, sizeof(xevent));
xf_detect_monitors(xfc);
width = xfc->sessionWidth;
height = xfc->sessionHeight;
@ -541,12 +539,6 @@ BOOL xf_create_window(xfContext* xfc)
sprintf(windowTitle, "FreeRDP: %s:%i", settings->ServerHostname, settings->ServerPort);
}
if (xfc->fullscreen)
{
width = xfc->desktopWidth;
height = xfc->desktopHeight;
}
#ifdef WITH_XRENDER
if (settings->SmartSizing)
{
@ -1016,9 +1008,7 @@ BOOL xf_pre_connect(freerdp* instance)
xf_keyboard_init(xfc);
xf_detect_monitors(xfc);
settings->DesktopWidth = xfc->desktopWidth;
settings->DesktopHeight = xfc->desktopHeight;
xf_detect_monitors(xfc, &settings->DesktopWidth, &settings->DesktopHeight);
xfc->fullscreen = settings->Fullscreen;
xfc->decorations = settings->Decorations;

View File

@ -115,7 +115,7 @@ BOOL xf_is_monitor_id_active(xfContext* xfc, UINT32 id)
return FALSE;
}
BOOL xf_detect_monitors(xfContext* xfc)
BOOL xf_detect_monitors(xfContext* xfc, UINT32* pWidth, UINT32* pHeight)
{
int i;
int nmonitors = 0;
@ -134,8 +134,8 @@ BOOL xf_detect_monitors(xfContext* xfc)
#endif
vscreen = &xfc->vscreen;
xfc->desktopWidth = settings->DesktopWidth;
xfc->desktopHeight = settings->DesktopHeight;
*pWidth = settings->DesktopWidth;
*pHeight = settings->DesktopHeight;
/* get mouse location */
if (!XQueryPointer(xfc->display, DefaultRootWindow(xfc->display),
@ -194,26 +194,26 @@ BOOL xf_detect_monitors(xfContext* xfc)
if (settings->Fullscreen)
{
xfc->desktopWidth = WidthOfScreen(xfc->screen);
xfc->desktopHeight = HeightOfScreen(xfc->screen);
*pWidth = WidthOfScreen(xfc->screen);
*pHeight = HeightOfScreen(xfc->screen);
}
else if (settings->Workarea)
{
xfc->desktopWidth = xfc->workArea.width;
xfc->desktopHeight = xfc->workArea.height;
*pWidth = xfc->workArea.width;
*pHeight = xfc->workArea.height;
}
else if (settings->PercentScreen)
{
xfc->desktopWidth = (xfc->workArea.width * settings->PercentScreen) / 100;
xfc->desktopHeight = (xfc->workArea.height * settings->PercentScreen) / 100;
*pWidth = (xfc->workArea.width * settings->PercentScreen) / 100;
*pHeight = (xfc->workArea.height * settings->PercentScreen) / 100;
/* If we have specific monitor information then limit the PercentScreen value
* to only affect the current monitor vs. the entire desktop
*/
if (vscreen->nmonitors > 0)
{
settings->DesktopWidth = ((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;
*pWidth = ((vscreen->monitors[current_monitor].area.right - vscreen->monitors[current_monitor].area.left + 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].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].height = MIN(vscreen->monitors[i].area.bottom - vscreen->monitors[i].area.top + 1, xfc->desktopHeight);
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, *pHeight);
settings->MonitorDefArray[nmonitors].orig_screen = i;
nmonitors++;
@ -257,8 +257,8 @@ BOOL xf_detect_monitors(xfContext* xfc)
{
settings->MonitorDefArray[0].x = vscreen->monitors[current_monitor].area.left;
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].height = MIN(vscreen->monitors[current_monitor].area.bottom - vscreen->monitors[current_monitor].area.top + 1, xfc->desktopHeight);
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, *pHeight);
settings->MonitorDefArray[0].orig_screen = current_monitor;
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 */
xfc->desktopWidth = vscreen->area.right - vscreen->area.left + 1;
xfc->desktopHeight = vscreen->area.bottom - vscreen->area.top + 1;
*pWidth = vscreen->area.right - vscreen->area.left + 1;
*pHeight = vscreen->area.bottom - vscreen->area.top + 1;
}
return TRUE;

View File

@ -44,7 +44,7 @@ typedef struct _VIRTUAL_SCREEN VIRTUAL_SCREEN;
#include "xfreerdp.h"
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);
#endif /* __XF_MONITOR_H */

View File

@ -171,8 +171,6 @@ struct xf_context
wArrayList* xevents;
char* actionScript;
UINT32 desktopWidth;
UINT32 desktopHeight;
XSetWindowAttributes attribs;
BOOL complex_regions;
VIRTUAL_SCREEN vscreen;