aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/wincreatewnd.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xwin/wincreatewnd.c')
-rw-r--r--xorg-server/hw/xwin/wincreatewnd.c115
1 files changed, 58 insertions, 57 deletions
diff --git a/xorg-server/hw/xwin/wincreatewnd.c b/xorg-server/hw/xwin/wincreatewnd.c
index 0580421ae..597f6bc4e 100644
--- a/xorg-server/hw/xwin/wincreatewnd.c
+++ b/xorg-server/hw/xwin/wincreatewnd.c
@@ -42,7 +42,7 @@ static Bool
winGetWorkArea(RECT * prcWorkArea, winScreenInfo * pScreenInfo);
static Bool
- winAdjustForAutoHide (RECT *prcWorkArea, winScreenInfo *pScreenInfo);
+ winAdjustForAutoHide(RECT * prcWorkArea, winScreenInfo * pScreenInfo);
/*
* Create a full screen window
@@ -60,8 +60,8 @@ winCreateBoundingWindowFullScreen(ScreenPtr pScreen)
HWND *phwnd = &pScreenPriv->hwndScreen;
WNDCLASSEX wc;
char szTitle[256];
- char HostName[256];
- gethostname(HostName,256);
+ char HostName[256];
+ gethostname(HostName,256);
winDebug("winCreateBoundingWindowFullScreen\n");
@@ -93,11 +93,11 @@ winCreateBoundingWindowFullScreen(ScreenPtr pScreen)
WINDOW_TITLE_XDMCP,
g_pszQueryHost, HostName, display, (int) pScreenInfo->dwScreen);
else
- {
+ {
snprintf(szTitle,
sizeof(szTitle),
WINDOW_TITLE, HostName, display, (int) pScreenInfo->dwScreen);
- }
+ }
/* Create the window */
*phwnd = CreateWindowExA(0, /* Extended styles */
WINDOW_CLASS, /* Class name */
@@ -154,9 +154,9 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen)
DWORD dwWindowStyle;
BOOL fForceShowWindow = FALSE;
char szTitle[256];
- char HostName[256];
+ char HostName[256];
- gethostname(HostName,256);
+ gethostname(HostName,256);
winDebug("winCreateBoundingWindowWindowed - User w: %d h: %d\n",
(int) pScreenInfo->dwUserWidth, (int) pScreenInfo->dwUserHeight);
@@ -218,7 +218,7 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen)
winGetWorkArea(&rcWorkArea, pScreenInfo);
/* Adjust for auto-hide taskbars */
- winAdjustForAutoHide (&rcWorkArea, pScreenInfo);
+ winAdjustForAutoHide(&rcWorkArea, pScreenInfo);
/* Did the user specify a position? */
if (pScreenInfo->fUserGavePosition) {
@@ -489,33 +489,32 @@ winGetWorkArea(RECT * prcWorkArea, winScreenInfo * pScreenInfo)
int iLeft, iTop;
int iPrimaryNonWorkAreaWidth, iPrimaryNonWorkAreaHeight;
- /* Use GetMonitorInfo to get work area for monitor */
- if (!pScreenInfo->fMultipleMonitors)
- {
- MONITORINFO mi;
- mi.cbSize = sizeof(MONITORINFO);
- if (GetMonitorInfo(pScreenInfo->hMonitor, &mi))
- {
- *prcWorkArea = mi.rcWork;
-
- winDebug ("winGetWorkArea - Monitor %d WorkArea: %d %d %d %d\n",
- pScreenInfo->iMonitor,
- (int) prcWorkArea->top, (int) prcWorkArea->left,
- (int) prcWorkArea->bottom, (int) prcWorkArea->right);
- }
- else
- {
- ErrorF ("winGetWorkArea - GetMonitorInfo() failed for monitor %d\n", pScreenInfo->iMonitor);
- }
+ /* Use GetMonitorInfo to get work area for monitor */
+ if (!pScreenInfo->fMultipleMonitors) {
+ MONITORINFO mi;
- /* Bail out here if we aren't using multiple monitors */
+ mi.cbSize = sizeof(MONITORINFO);
+ if (GetMonitorInfo(pScreenInfo->hMonitor, &mi)) {
+ *prcWorkArea = mi.rcWork;
+
+ winDebug("winGetWorkArea - Monitor %d WorkArea: %d %d %d %d\n",
+ pScreenInfo->iMonitor,
+ (int) prcWorkArea->top, (int) prcWorkArea->left,
+ (int) prcWorkArea->bottom, (int) prcWorkArea->right);
+ }
+ else {
+ ErrorF("winGetWorkArea - GetMonitorInfo() failed for monitor %d\n",
+ pScreenInfo->iMonitor);
+ }
+
+ /* Bail out here if we aren't using multiple monitors */
return TRUE;
- }
+ }
- /* SPI_GETWORKAREA only gets the work area of the primary screen. */
- SystemParametersInfo (SPI_GETWORKAREA, 0, prcWorkArea, 0);
-
- winDebug ("winGetWorkArea - Primary Monitor WorkArea: %d %d %d %d\n",
+ /* SPI_GETWORKAREA only gets the work area of the primary screen. */
+ SystemParametersInfo(SPI_GETWORKAREA, 0, prcWorkArea, 0);
+
+ winDebug("winGetWorkArea - Primary Monitor WorkArea: %d %d %d %d\n",
(int) prcWorkArea->top, (int) prcWorkArea->left,
(int) prcWorkArea->bottom, (int) prcWorkArea->right);
@@ -564,34 +563,36 @@ winGetWorkArea(RECT * prcWorkArea, winScreenInfo * pScreenInfo)
}
static Bool
-winTaskbarOnScreenEdge(unsigned int uEdge, winScreenInfo *pScreenInfo)
+winTaskbarOnScreenEdge(unsigned int uEdge, winScreenInfo * pScreenInfo)
{
- APPBARDATA abd;
- HWND hwndAutoHide;
+ APPBARDATA abd;
+ HWND hwndAutoHide;
- ZeroMemory (&abd, sizeof (abd));
- abd.cbSize = sizeof (abd);
- abd.uEdge = uEdge;
+ ZeroMemory(&abd, sizeof(abd));
+ abd.cbSize = sizeof(abd);
+ abd.uEdge = uEdge;
- hwndAutoHide = (HWND) SHAppBarMessage (ABM_GETAUTOHIDEBAR, &abd);
- if (hwndAutoHide != NULL)
- {
- /*
- Found an autohide taskbar on that edge, but is it on the
- same monitor as the screen window?
- */
- if (pScreenInfo->fMultipleMonitors || (MonitorFromWindow(hwndAutoHide, MONITOR_DEFAULTTONULL) == pScreenInfo->hMonitor))
- return TRUE;
+ hwndAutoHide = (HWND) SHAppBarMessage(ABM_GETAUTOHIDEBAR, &abd);
+ if (hwndAutoHide != NULL) {
+ /*
+ Found an autohide taskbar on that edge, but is it on the
+ same monitor as the screen window?
+ */
+ if (pScreenInfo->fMultipleMonitors ||
+ (MonitorFromWindow(hwndAutoHide, MONITOR_DEFAULTTONULL) ==
+ pScreenInfo->hMonitor))
+ return TRUE;
}
- return FALSE;
+ return FALSE;
}
+
/*
* Adjust the client area so that any auto-hide toolbars
* will work correctly.
*/
static Bool
-winAdjustForAutoHide (RECT *prcWorkArea, winScreenInfo *pScreenInfo)
+winAdjustForAutoHide(RECT * prcWorkArea, winScreenInfo * pScreenInfo)
{
APPBARDATA abd;
@@ -605,31 +606,31 @@ winAdjustForAutoHide (RECT *prcWorkArea, winScreenInfo *pScreenInfo)
if (SHAppBarMessage(ABM_GETSTATE, &abd) & ABS_AUTOHIDE)
winDebug("winAdjustForAutoHide - Taskbar is auto hide\n");
- /*
- Despite the forgoing, we are checking for any AppBar
- hiding along a monitor edge, not just the Windows TaskBar.
- */
+ /*
+ Despite the forgoing, we are checking for any AppBar
+ hiding along a monitor edge, not just the Windows TaskBar.
+ */
/* Look for a TOP auto-hide taskbar */
- if (winTaskbarOnScreenEdge(ABE_TOP, pScreenInfo)) {
+ if (winTaskbarOnScreenEdge(ABE_TOP, pScreenInfo)) {
winDebug("winAdjustForAutoHide - Found TOP auto-hide taskbar\n");
prcWorkArea->top += 1;
}
/* Look for a LEFT auto-hide taskbar */
- if (winTaskbarOnScreenEdge(ABE_LEFT, pScreenInfo)) {
+ if (winTaskbarOnScreenEdge(ABE_LEFT, pScreenInfo)) {
winDebug("winAdjustForAutoHide - Found LEFT auto-hide taskbar\n");
prcWorkArea->left += 1;
}
/* Look for a BOTTOM auto-hide taskbar */
- if (winTaskbarOnScreenEdge(ABE_BOTTOM, pScreenInfo)) {
+ if (winTaskbarOnScreenEdge(ABE_BOTTOM, pScreenInfo)) {
winDebug("winAdjustForAutoHide - Found BOTTOM auto-hide taskbar\n");
prcWorkArea->bottom -= 1;
}
/* Look for a RIGHT auto-hide taskbar */
- if (winTaskbarOnScreenEdge(ABE_RIGHT, pScreenInfo)) {
+ if (winTaskbarOnScreenEdge(ABE_RIGHT, pScreenInfo)) {
winDebug("winAdjustForAutoHide - Found RIGHT auto-hide taskbar\n");
prcWorkArea->right -= 1;
}