Merge remote-tracking branch 'whot/two-screen-coordinates'
This commit is contained in:
@@ -665,6 +665,30 @@ point_on_screen(ScreenPtr pScreen, int x, int y)
|
||||
}
|
||||
|
||||
/**
|
||||
* Update desktop dimensions on the screenInfo struct.
|
||||
*/
|
||||
void
|
||||
update_desktop_dimensions(void)
|
||||
{
|
||||
int i;
|
||||
int x1 = INT_MAX, y1 = INT_MAX; /* top-left */
|
||||
int x2 = INT_MIN, y2 = INT_MIN; /* bottom-right */
|
||||
|
||||
for (i = 0; i < screenInfo.numScreens; i++) {
|
||||
ScreenPtr screen = screenInfo.screens[i];
|
||||
x1 = min(x1, screen->x);
|
||||
y1 = min(y1, screen->y);
|
||||
x2 = max(x2, screen->x + screen->width);
|
||||
y2 = max(y2, screen->y + screen->height);
|
||||
}
|
||||
|
||||
screenInfo.x = x1;
|
||||
screenInfo.y = y1;
|
||||
screenInfo.width = x2 - x1;
|
||||
screenInfo.height = y2 - y1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Delete the element with the key from the list, freeing all memory
|
||||
* associated with the element..
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user