aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/winmultiwindowwm.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-07-24 14:25:51 +0200
committermarha <marha@users.sourceforge.net>2013-07-25 08:25:18 +0200
commitde54c5b749b3eefb75d420840c889533a58aa342 (patch)
tree6502771c9dd5a0d455388734060469b18f2e4011 /xorg-server/hw/xwin/winmultiwindowwm.c
parent0606cba5be2dab08f0b4de540d7b278fa6273daf (diff)
downloadvcxsrv-de54c5b749b3eefb75d420840c889533a58aa342.tar.gz
vcxsrv-de54c5b749b3eefb75d420840c889533a58aa342.tar.bz2
vcxsrv-de54c5b749b3eefb75d420840c889533a58aa342.zip
64-bit compilation now compiles and runs
Diffstat (limited to 'xorg-server/hw/xwin/winmultiwindowwm.c')
-rw-r--r--xorg-server/hw/xwin/winmultiwindowwm.c116
1 files changed, 6 insertions, 110 deletions
diff --git a/xorg-server/hw/xwin/winmultiwindowwm.c b/xorg-server/hw/xwin/winmultiwindowwm.c
index 3187f2172..e8fbf08c0 100644
--- a/xorg-server/hw/xwin/winmultiwindowwm.c
+++ b/xorg-server/hw/xwin/winmultiwindowwm.c
@@ -65,9 +65,6 @@ typedef int pid_t;
#include "windowstr.h"
#include "winmultiwindowclass.h"
-#include <shlwapi.h>
-#include "taskbar.h"
-
#ifdef XWIN_MULTIWINDOWEXTWM
#define _WINDOWSWM_SERVER_
#include <X11/extensions/windowswmstr.h>
@@ -207,10 +204,6 @@ static pthread_t g_winMultiWindowXMsgProcThread;
static Bool g_shutdown = FALSE;
static Bool redirectError = FALSE;
static Bool g_fAnotherWMRunning = FALSE;
-static HMODULE g_hmodShell32Dll = NULL;
-static HMODULE g_hmodOle32Dll = NULL;
-static SHGETPROPERTYSTOREFORWINDOWPROC g_pSHGetPropertyStoreForWindow = NULL;
-static PROPVARIANTCLEARPROC g_pPropVariantClear = NULL;
/*
* PushMessage - Push a message onto the queue
@@ -458,7 +451,7 @@ getHwnd(WMInfoPtr pWMInfo, Window iWindow)
iWindow,
pWMInfo->atmPrivMap,
0,
- 1,
+ sizeof(HWND)/4,
False,
XA_INTEGER,
&atmType,
@@ -701,7 +694,7 @@ winMultiWindowWMProc(void *pArg)
XChangeProperty(pWMInfo->pDisplay, pNode->msg.iWindow, pWMInfo->atmPrivMap, XA_INTEGER, //pWMInfo->atmPrivMap,
32,
PropModeReplace,
- (unsigned char *) &(pNode->msg.hwndWindow), 1);
+ (unsigned char *) &(pNode->msg.hwndWindow), sizeof(HWND)/4);
UpdateName(pWMInfo, pNode->msg.iWindow);
UpdateIcon(pWMInfo, pNode->msg.iWindow);
break;
@@ -712,7 +705,7 @@ winMultiWindowWMProc(void *pArg)
XChangeProperty(pWMInfo->pDisplay, pNode->msg.iWindow, pWMInfo->atmPrivMap, XA_INTEGER, //pWMInfo->atmPrivMap,
32,
PropModeReplace,
- (unsigned char *) &(pNode->msg.hwndWindow), 1);
+ (unsigned char *) &(pNode->msg.hwndWindow), sizeof(HWND)/4);
break;
case WM_WM_MAP3:
@@ -722,7 +715,7 @@ winMultiWindowWMProc(void *pArg)
XChangeProperty(pWMInfo->pDisplay, pNode->msg.iWindow, pWMInfo->atmPrivMap, XA_INTEGER, //pWMInfo->atmPrivMap,
32,
PropModeReplace,
- (unsigned char *) &(pNode->msg.hwndWindow), 1);
+ (unsigned char *) &(pNode->msg.hwndWindow), sizeof(HWND)/4);
UpdateName(pWMInfo, pNode->msg.iWindow);
UpdateIcon(pWMInfo, pNode->msg.iWindow);
UpdateStyle(pWMInfo, pNode->msg.iWindow);
@@ -1006,14 +999,14 @@ winMultiWindowXMsgProc(void *pArg)
(pProcArg->pDisplay, pProcArg->dwScreen, TRUE)) {
if (!g_fAnotherWMRunning) {
g_fAnotherWMRunning = TRUE;
- SendMessage(*(HWND *) pProcArg->hwndScreen, WM_UNMANAGE, 0,
+ SendMessage(pProcArg->hwndScreen, WM_UNMANAGE, 0,
0);
}
}
else {
if (g_fAnotherWMRunning) {
g_fAnotherWMRunning = FALSE;
- SendMessage(*(HWND *) pProcArg->hwndScreen, WM_MANAGE, 0,
+ SendMessage(pProcArg->hwndScreen, WM_MANAGE, 0,
0);
}
}
@@ -1857,100 +1850,3 @@ winUpdateWindowPosition(HWND hWnd, HWND * zstyle)
rcNew.right - rcNew.left, rcNew.bottom - rcNew.top, 0);
}
-
-void
-winTaskbarInit (void)
-{
- /*
- Load libraries and get function pointers to SHGetPropertyStoreForWindow
- and PropVariantClear for winSetAppID()
- */
-
- /*
- SHGetPropertyStoreForWindow is only supported since Windows 7. On previous
- versions the pointer will be NULL and taskbar grouping is not supported.
- winSetAppID() will do nothing in this case.
- */
- g_hmodShell32Dll = LoadLibrary ("shell32.dll");
- if (g_hmodShell32Dll == NULL)
- {
- ErrorF ("winTaskbarInit - Could not load shell32.dll\n");
- return;
- }
-
- g_pSHGetPropertyStoreForWindow = (SHGETPROPERTYSTOREFORWINDOWPROC) GetProcAddress (g_hmodShell32Dll, "SHGetPropertyStoreForWindow");
- if (g_pSHGetPropertyStoreForWindow == NULL)
- {
- ErrorF ("winTaskbarInit - Could not get SHGetPropertyStoreForWindow address\n");
- return;
- }
-
- /*
- PropVariantClear is supported since NT4, but we have no propidl.h to
- provide a prototype for it
- */
- g_hmodOle32Dll = LoadLibrary ("ole32.dll");
- if (g_hmodOle32Dll == NULL)
- {
- ErrorF ("winTaskbarInit - Could not load ole32.dll\n");
- return;
- }
-
- g_pPropVariantClear = (PROPVARIANTCLEARPROC) GetProcAddress (g_hmodOle32Dll, "PropVariantClear");
- if (g_pPropVariantClear == NULL)
- {
- ErrorF ("winTaskbarInit - Could not get g_pPropVariantClear address\n");
- return;
- }
-}
-
-void
-winTaskbarDestroy (void)
-{
- if (g_hmodOle32Dll != NULL)
- {
- FreeLibrary (g_hmodOle32Dll);
- g_hmodOle32Dll = NULL;
- g_pPropVariantClear = NULL;
- }
- if (g_hmodShell32Dll != NULL)
- {
- FreeLibrary (g_hmodShell32Dll);
- g_hmodShell32Dll = NULL;
- g_pSHGetPropertyStoreForWindow = NULL;
- }
-}
-
-void
-winSetAppID (HWND hWnd, const char* AppID)
-{
- PROPVARIANT pv;
- IPropertyStore *pps = NULL;
- HRESULT hr;
-
- if (g_pSHGetPropertyStoreForWindow == NULL ||
- g_pPropVariantClear == NULL)
- {
- return;
- }
-
- winDebug ("winSetAppID - hwnd 0x%08x appid '%s'\n", hWnd, AppID);
-
- hr = g_pSHGetPropertyStoreForWindow (hWnd, &IID_IPropertyStore, (void**)&pps);
- if(SUCCEEDED(hr) && pps)
- {
- memset(&pv, 0, sizeof(PROPVARIANT));
- if(AppID)
- {
- pv.vt = VT_LPWSTR;
- hr = SHStrDupA(AppID, &pv.pwszVal);
- }
-
- if(SUCCEEDED(hr))
- {
- hr = pps->lpVtbl->SetValue(pps, &PKEY_AppUserModel_ID, &pv);
- g_pPropVariantClear(&pv);
- }
- pps->lpVtbl->Release(pps);
- }
-}