Merge remote-tracking branch 'jturney/master'
This commit is contained in:
commit
227015d654
|
@ -160,6 +160,8 @@ XWin_LDFLAGS = -mwindows -static
|
||||||
.rc.o:
|
.rc.o:
|
||||||
$(AM_V_GEN)$(WINDRES) --use-temp-file -i $< --input-format=rc -o $@ -O coff -I $(top_builddir)/include
|
$(AM_V_GEN)$(WINDRES) --use-temp-file -i $< --input-format=rc -o $@ -O coff -I $(top_builddir)/include
|
||||||
|
|
||||||
|
XWin.o: XWin.rc XWin.exe.manifest X.ico
|
||||||
|
|
||||||
winprefsyacc.h: winprefsyacc.c
|
winprefsyacc.h: winprefsyacc.c
|
||||||
winprefslex.c: winprefslex.l winprefsyacc.c winprefsyacc.h
|
winprefslex.c: winprefslex.l winprefsyacc.c winprefsyacc.h
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
type="win32"
|
type="win32"
|
||||||
name="Microsoft.Windows.Common-Controls"
|
name="Microsoft.Windows.Common-Controls"
|
||||||
version="6.0.0.0"
|
version="6.0.0.0"
|
||||||
processorArchitecture="X86"
|
processorArchitecture="*"
|
||||||
publicKeyToken="6595b64144ccf1df"
|
publicKeyToken="6595b64144ccf1df"
|
||||||
language="*"
|
language="*"
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -33,9 +33,6 @@
|
||||||
#include <xwin-config.h>
|
#include <xwin-config.h>
|
||||||
#endif
|
#endif
|
||||||
#include "win.h"
|
#include "win.h"
|
||||||
#ifdef __CYGWIN__
|
|
||||||
#include <sys/cygwin.h>
|
|
||||||
#endif
|
|
||||||
#include <shellapi.h>
|
#include <shellapi.h>
|
||||||
#include "winprefs.h"
|
#include "winprefs.h"
|
||||||
|
|
||||||
|
@ -50,13 +47,13 @@ extern Bool g_fClipboardStarted;
|
||||||
* Local function prototypes
|
* Local function prototypes
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static wBOOL CALLBACK
|
static INT_PTR CALLBACK
|
||||||
winExitDlgProc(HWND hDialog, UINT message, WPARAM wParam, LPARAM lParam);
|
winExitDlgProc(HWND hDialog, UINT message, WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
static wBOOL CALLBACK
|
static INT_PTR CALLBACK
|
||||||
winChangeDepthDlgProc(HWND hDialog, UINT message, WPARAM wParam, LPARAM lParam);
|
winChangeDepthDlgProc(HWND hDialog, UINT message, WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
static wBOOL CALLBACK
|
static INT_PTR CALLBACK
|
||||||
winAboutDlgProc(HWND hDialog, UINT message, WPARAM wParam, LPARAM lParam);
|
winAboutDlgProc(HWND hDialog, UINT message, WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -288,7 +285,7 @@ winDisplayExitDialog(winPrivScreenPtr pScreenPriv)
|
||||||
g_hDlgExit = CreateDialogParam(g_hInstance,
|
g_hDlgExit = CreateDialogParam(g_hInstance,
|
||||||
"EXIT_DIALOG",
|
"EXIT_DIALOG",
|
||||||
pScreenPriv->hwndScreen,
|
pScreenPriv->hwndScreen,
|
||||||
winExitDlgProc, (int) pScreenPriv);
|
winExitDlgProc, (LPARAM) pScreenPriv);
|
||||||
|
|
||||||
/* Show the dialog box */
|
/* Show the dialog box */
|
||||||
ShowWindow(g_hDlgExit, SW_SHOW);
|
ShowWindow(g_hDlgExit, SW_SHOW);
|
||||||
|
@ -307,7 +304,7 @@ winDisplayExitDialog(winPrivScreenPtr pScreenPriv)
|
||||||
* Exit dialog window procedure
|
* Exit dialog window procedure
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static wBOOL CALLBACK
|
static INT_PTR CALLBACK
|
||||||
winExitDlgProc(HWND hDialog, UINT message, WPARAM wParam, LPARAM lParam)
|
winExitDlgProc(HWND hDialog, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
static winPrivScreenPtr s_pScreenPriv = NULL;
|
static winPrivScreenPtr s_pScreenPriv = NULL;
|
||||||
|
@ -407,14 +404,13 @@ winDisplayDepthChangeDialog(winPrivScreenPtr pScreenPriv)
|
||||||
"DEPTH_CHANGE_BOX",
|
"DEPTH_CHANGE_BOX",
|
||||||
pScreenPriv->hwndScreen,
|
pScreenPriv->hwndScreen,
|
||||||
winChangeDepthDlgProc,
|
winChangeDepthDlgProc,
|
||||||
(int) pScreenPriv);
|
(LPARAM) pScreenPriv);
|
||||||
/* Show the dialog box */
|
/* Show the dialog box */
|
||||||
ShowWindow(g_hDlgDepthChange, SW_SHOW);
|
ShowWindow(g_hDlgDepthChange, SW_SHOW);
|
||||||
|
|
||||||
ErrorF("winDisplayDepthChangeDialog - DialogBox returned: %d\n",
|
if (!g_hDlgDepthChange)
|
||||||
(int) g_hDlgDepthChange);
|
ErrorF("winDisplayDepthChangeDialog - GetLastError: %d\n",
|
||||||
ErrorF("winDisplayDepthChangeDialog - GetLastError: %d\n",
|
(int) GetLastError());
|
||||||
(int) GetLastError());
|
|
||||||
|
|
||||||
/* Minimize the display window */
|
/* Minimize the display window */
|
||||||
ShowWindow(pScreenPriv->hwndScreen, SW_MINIMIZE);
|
ShowWindow(pScreenPriv->hwndScreen, SW_MINIMIZE);
|
||||||
|
@ -425,7 +421,7 @@ winDisplayDepthChangeDialog(winPrivScreenPtr pScreenPriv)
|
||||||
* disruptive screen depth changes.
|
* disruptive screen depth changes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static wBOOL CALLBACK
|
static INT_PTR CALLBACK
|
||||||
winChangeDepthDlgProc(HWND hwndDialog, UINT message,
|
winChangeDepthDlgProc(HWND hwndDialog, UINT message,
|
||||||
WPARAM wParam, LPARAM lParam)
|
WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
|
@ -539,7 +535,7 @@ winDisplayAboutDialog(winPrivScreenPtr pScreenPriv)
|
||||||
g_hDlgAbout = CreateDialogParam(g_hInstance,
|
g_hDlgAbout = CreateDialogParam(g_hInstance,
|
||||||
"ABOUT_BOX",
|
"ABOUT_BOX",
|
||||||
pScreenPriv->hwndScreen,
|
pScreenPriv->hwndScreen,
|
||||||
winAboutDlgProc, (int) pScreenPriv);
|
winAboutDlgProc, (LPARAM) pScreenPriv);
|
||||||
|
|
||||||
/* Show the dialog box */
|
/* Show the dialog box */
|
||||||
ShowWindow(g_hDlgAbout, SW_SHOW);
|
ShowWindow(g_hDlgAbout, SW_SHOW);
|
||||||
|
@ -556,7 +552,7 @@ winDisplayAboutDialog(winPrivScreenPtr pScreenPriv)
|
||||||
* Process messages for the about dialog.
|
* Process messages for the about dialog.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static wBOOL CALLBACK
|
static INT_PTR CALLBACK
|
||||||
winAboutDlgProc(HWND hwndDialog, UINT message, WPARAM wParam, LPARAM lParam)
|
winAboutDlgProc(HWND hwndDialog, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
static winPrivScreenPtr s_pScreenPriv = NULL;
|
static winPrivScreenPtr s_pScreenPriv = NULL;
|
||||||
|
@ -621,26 +617,17 @@ winAboutDlgProc(HWND hwndDialog, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
case ID_ABOUT_CHANGELOG:
|
case ID_ABOUT_CHANGELOG:
|
||||||
{
|
{
|
||||||
int iReturn;
|
INT_PTR iReturn;
|
||||||
|
|
||||||
#ifdef __CYGWIN__
|
|
||||||
const char *pszCygPath = "/usr/X11R6/share/doc/"
|
|
||||||
"xorg-x11-xwin/changelog.html";
|
|
||||||
char pszWinPath[MAX_PATH + 1];
|
|
||||||
|
|
||||||
/* Convert the POSIX path to a Win32 path */
|
|
||||||
cygwin_conv_to_win32_path(pszCygPath, pszWinPath);
|
|
||||||
#else
|
|
||||||
const char *pszWinPath = "http://x.cygwin.com/"
|
const char *pszWinPath = "http://x.cygwin.com/"
|
||||||
"devel/server/changelog.html";
|
"devel/server/changelog.html";
|
||||||
#endif
|
|
||||||
|
|
||||||
iReturn = (int) ShellExecute(NULL,
|
iReturn = (INT_PTR) ShellExecute(NULL,
|
||||||
"open",
|
"open",
|
||||||
pszWinPath, NULL, NULL, SW_MAXIMIZE);
|
pszWinPath, NULL, NULL, SW_MAXIMIZE);
|
||||||
if (iReturn < 32) {
|
if (iReturn < 32) {
|
||||||
ErrorF("winAboutDlgProc - WM_COMMAND - ID_ABOUT_CHANGELOG - "
|
ErrorF("winAboutDlgProc - WM_COMMAND - ID_ABOUT_CHANGELOG - "
|
||||||
"ShellExecute failed: %d\n", iReturn);
|
"ShellExecute failed: %d\n", (int)iReturn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -648,14 +635,15 @@ winAboutDlgProc(HWND hwndDialog, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
case ID_ABOUT_WEBSITE:
|
case ID_ABOUT_WEBSITE:
|
||||||
{
|
{
|
||||||
const char *pszPath = __VENDORDWEBSUPPORT__;
|
const char *pszPath = __VENDORDWEBSUPPORT__;
|
||||||
int iReturn;
|
INT_PTR iReturn;
|
||||||
|
|
||||||
iReturn = (int) ShellExecute(NULL,
|
iReturn = (INT_PTR) ShellExecute(NULL,
|
||||||
"open",
|
"open",
|
||||||
pszPath, NULL, NULL, SW_MAXIMIZE);
|
pszPath, NULL, NULL, SW_MAXIMIZE);
|
||||||
if (iReturn < 32) {
|
if (iReturn < 32) {
|
||||||
ErrorF("winAboutDlgProc - WM_COMMAND - ID_ABOUT_WEBSITE - "
|
ErrorF("winAboutDlgProc - WM_COMMAND - ID_ABOUT_WEBSITE - "
|
||||||
"ShellExecute failed: %d\n", iReturn);
|
"ShellExecute failed: %d\n", (int)iReturn);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -663,14 +651,14 @@ winAboutDlgProc(HWND hwndDialog, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
case ID_ABOUT_UG:
|
case ID_ABOUT_UG:
|
||||||
{
|
{
|
||||||
const char *pszPath = "http://x.cygwin.com/docs/ug/";
|
const char *pszPath = "http://x.cygwin.com/docs/ug/";
|
||||||
int iReturn;
|
INT_PTR iReturn;
|
||||||
|
|
||||||
iReturn = (int) ShellExecute(NULL,
|
iReturn = (INT_PTR) ShellExecute(NULL,
|
||||||
"open",
|
"open",
|
||||||
pszPath, NULL, NULL, SW_MAXIMIZE);
|
pszPath, NULL, NULL, SW_MAXIMIZE);
|
||||||
if (iReturn < 32) {
|
if (iReturn < 32) {
|
||||||
ErrorF("winAboutDlgProc - WM_COMMAND - ID_ABOUT_UG - "
|
ErrorF("winAboutDlgProc - WM_COMMAND - ID_ABOUT_UG - "
|
||||||
"ShellExecute failed: %d\n", iReturn);
|
"ShellExecute failed: %d\n", (int)iReturn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -678,14 +666,14 @@ winAboutDlgProc(HWND hwndDialog, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
case ID_ABOUT_FAQ:
|
case ID_ABOUT_FAQ:
|
||||||
{
|
{
|
||||||
const char *pszPath = "http://x.cygwin.com/docs/faq/";
|
const char *pszPath = "http://x.cygwin.com/docs/faq/";
|
||||||
int iReturn;
|
INT_PTR iReturn;
|
||||||
|
|
||||||
iReturn = (int) ShellExecute(NULL,
|
iReturn = (INT_PTR) ShellExecute(NULL,
|
||||||
"open",
|
"open",
|
||||||
pszPath, NULL, NULL, SW_MAXIMIZE);
|
pszPath, NULL, NULL, SW_MAXIMIZE);
|
||||||
if (iReturn < 32) {
|
if (iReturn < 32) {
|
||||||
ErrorF("winAboutDlgProc - WM_COMMAND - ID_ABOUT_FAQ - "
|
ErrorF("winAboutDlgProc - WM_COMMAND - ID_ABOUT_FAQ - "
|
||||||
"ShellExecute failed: %d\n", iReturn);
|
"ShellExecute failed: %d\n", (int)iReturn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
@ -213,7 +213,7 @@ winMultiWindowGetWMNormalHints(WindowPtr pWin, WinXSizeHints * hints)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
winMultiWindowGetTransientFor(WindowPtr pWin, WindowPtr *ppDaddy)
|
winMultiWindowGetTransientFor(WindowPtr pWin, Window *pDaddyId)
|
||||||
{
|
{
|
||||||
struct _Window *pwin;
|
struct _Window *pwin;
|
||||||
struct _Property *prop;
|
struct _Property *prop;
|
||||||
|
@ -230,13 +230,13 @@ winMultiWindowGetTransientFor(WindowPtr pWin, WindowPtr *ppDaddy)
|
||||||
else
|
else
|
||||||
prop = NULL;
|
prop = NULL;
|
||||||
|
|
||||||
if (ppDaddy)
|
if (pDaddyId)
|
||||||
*ppDaddy = NULL;
|
*pDaddyId = 0;
|
||||||
|
|
||||||
while (prop) {
|
while (prop) {
|
||||||
if (prop->propertyName == XA_WM_TRANSIENT_FOR) {
|
if (prop->propertyName == XA_WM_TRANSIENT_FOR) {
|
||||||
if (ppDaddy)
|
if (pDaddyId)
|
||||||
memcpy(ppDaddy, prop->data, sizeof(WindowPtr));
|
memcpy(pDaddyId, prop->data, sizeof(Window));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -118,6 +118,6 @@ int
|
||||||
winMultiWindowGetWMName(WindowPtr pWin, char **wmName);
|
winMultiWindowGetWMName(WindowPtr pWin, char **wmName);
|
||||||
|
|
||||||
int
|
int
|
||||||
winMultiWindowGetTransientFor(WindowPtr pWin, WindowPtr *ppDaddy);
|
winMultiWindowGetTransientFor(WindowPtr pWin, Window *ppDaddy);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -624,7 +624,7 @@ winDestroyIcon(HICON hIcon)
|
||||||
/* Delete the icon if its not one of the application defaults or an override */
|
/* Delete the icon if its not one of the application defaults or an override */
|
||||||
if (hIcon &&
|
if (hIcon &&
|
||||||
hIcon != g_hIconX &&
|
hIcon != g_hIconX &&
|
||||||
hIcon != g_hSmallIconX && !winIconIsOverride((unsigned long) hIcon))
|
hIcon != g_hSmallIconX && !winIconIsOverride(hIcon))
|
||||||
DestroyIcon(hIcon);
|
DestroyIcon(hIcon);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -486,7 +486,7 @@ winCreateWindowsWindow(WindowPtr pWin)
|
||||||
winWindowPriv(pWin);
|
winWindowPriv(pWin);
|
||||||
winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv;
|
winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv;
|
||||||
WinXSizeHints hints;
|
WinXSizeHints hints;
|
||||||
WindowPtr pDaddy;
|
Window daddyId;
|
||||||
DWORD dwStyle, dwExStyle;
|
DWORD dwStyle, dwExStyle;
|
||||||
RECT rc;
|
RECT rc;
|
||||||
|
|
||||||
|
@ -516,10 +516,10 @@ winCreateWindowsWindow(WindowPtr pWin)
|
||||||
winDebug("winCreateWindowsWindow - %dx%d @ %dx%d\n", iWidth, iHeight, iX,
|
winDebug("winCreateWindowsWindow - %dx%d @ %dx%d\n", iWidth, iHeight, iX,
|
||||||
iY);
|
iY);
|
||||||
|
|
||||||
if (winMultiWindowGetTransientFor(pWin, &pDaddy)) {
|
if (winMultiWindowGetTransientFor(pWin, &daddyId)) {
|
||||||
if (pDaddy) {
|
if (daddyId) {
|
||||||
hFore = GetForegroundWindow();
|
hFore = GetForegroundWindow();
|
||||||
if (hFore && (pDaddy != (WindowPtr) GetProp(hFore, WIN_WID_PROP)))
|
if (hFore && (daddyId != (Window) (INT_PTR) GetProp(hFore, WIN_WID_PROP)))
|
||||||
hFore = NULL;
|
hFore = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -593,7 +593,7 @@ winCreateWindowsWindow(WindowPtr pWin)
|
||||||
/* Cause any .XWinrc menus to be added in main WNDPROC */
|
/* Cause any .XWinrc menus to be added in main WNDPROC */
|
||||||
PostMessage(hWnd, WM_INIT_SYS_MENU, 0, 0);
|
PostMessage(hWnd, WM_INIT_SYS_MENU, 0, 0);
|
||||||
|
|
||||||
SetProp(hWnd, WIN_WID_PROP, (HANDLE) winGetWindowID(pWin));
|
SetProp(hWnd, WIN_WID_PROP, (HANDLE) (INT_PTR) winGetWindowID(pWin));
|
||||||
|
|
||||||
/* Flag that this Windows window handles its own activation */
|
/* Flag that this Windows window handles its own activation */
|
||||||
SetProp(hWnd, WIN_NEEDMANAGE_PROP, (HANDLE) 0);
|
SetProp(hWnd, WIN_NEEDMANAGE_PROP, (HANDLE) 0);
|
||||||
|
|
|
@ -343,7 +343,7 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
/* */
|
/* */
|
||||||
wmMsg.msg = 0;
|
wmMsg.msg = 0;
|
||||||
wmMsg.hwndWindow = hwnd;
|
wmMsg.hwndWindow = hwnd;
|
||||||
wmMsg.iWindow = (Window) GetProp(hwnd, WIN_WID_PROP);
|
wmMsg.iWindow = (Window) (INT_PTR) GetProp(hwnd, WIN_WID_PROP);
|
||||||
|
|
||||||
wmMsg.iX = pDraw->x;
|
wmMsg.iX = pDraw->x;
|
||||||
wmMsg.iY = pDraw->y;
|
wmMsg.iY = pDraw->y;
|
||||||
|
@ -391,8 +391,8 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
/* */
|
/* */
|
||||||
SetProp(hwnd,
|
SetProp(hwnd,
|
||||||
WIN_WID_PROP,
|
WIN_WID_PROP,
|
||||||
(HANDLE) winGetWindowID(((LPCREATESTRUCT) lParam)->
|
(HANDLE) (INT_PTR) winGetWindowID(((LPCREATESTRUCT) lParam)->
|
||||||
lpCreateParams));
|
lpCreateParams));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Make X windows' Z orders sync with Windows windows because
|
* Make X windows' Z orders sync with Windows windows because
|
||||||
|
|
|
@ -181,7 +181,7 @@ ReloadEnumWindowsProc(HWND hwnd, LPARAM lParam)
|
||||||
|
|
||||||
wmMsg.msg = WM_WM_ICON_EVENT;
|
wmMsg.msg = WM_WM_ICON_EVENT;
|
||||||
wmMsg.hwndWindow = hwnd;
|
wmMsg.hwndWindow = hwnd;
|
||||||
wmMsg.iWindow = (Window) GetProp(hwnd, WIN_WID_PROP);
|
wmMsg.iWindow = (Window) (INT_PTR) GetProp(hwnd, WIN_WID_PROP);
|
||||||
|
|
||||||
winSendMessageToWM(s_pScreenPriv->pWMInfo, &wmMsg);
|
winSendMessageToWM(s_pScreenPriv->pWMInfo, &wmMsg);
|
||||||
}
|
}
|
||||||
|
@ -617,13 +617,10 @@ winOverrideIcon(char *res_name, char *res_class, char *wmName)
|
||||||
* ICONS{} overrides)?
|
* ICONS{} overrides)?
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
winIconIsOverride(unsigned hiconIn)
|
winIconIsOverride(HICON hicon)
|
||||||
{
|
{
|
||||||
HICON hicon;
|
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
hicon = (HICON) hiconIn;
|
|
||||||
|
|
||||||
if (!hicon)
|
if (!hicon)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
|
@ -162,7 +162,7 @@ Bool
|
||||||
HandleCustomWM_COMMAND(unsigned long hwndIn, int command);
|
HandleCustomWM_COMMAND(unsigned long hwndIn, int command);
|
||||||
|
|
||||||
int
|
int
|
||||||
winIconIsOverride(unsigned hiconIn);
|
winIconIsOverride(HICON hicon);
|
||||||
|
|
||||||
HICON winOverrideIcon(char *res_name, char *res_class, char *wmName);
|
HICON winOverrideIcon(char *res_name, char *res_class, char *wmName);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue