xserver: Branch 'master' - 8 commits

Keith Packard keithp at kemper.freedesktop.org
Tue Jun 18 10:53:35 PDT 2013


 hw/xwin/Makefile.am             |    2 +
 hw/xwin/XWin.exe.manifest       |    2 -
 hw/xwin/windialogs.c            |   62 ++++++++++++++++------------------------
 hw/xwin/winmultiwindowclass.c   |   10 +++---
 hw/xwin/winmultiwindowclass.h   |    2 -
 hw/xwin/winmultiwindowicons.c   |    2 -
 hw/xwin/winmultiwindowwindow.c  |   10 +++---
 hw/xwin/winmultiwindowwndproc.c |    6 +--
 hw/xwin/winprefs.c              |    7 +---
 hw/xwin/winprefs.h              |    2 -
 10 files changed, 46 insertions(+), 59 deletions(-)

New commits:
commit 227015d6544115258b74c31b700f9bd163540e24
Merge: d9005d5 80054fc
Author: Keith Packard <keithp at keithp.com>
Date:   Tue Jun 18 10:53:08 2013 -0700

    Merge remote-tracking branch 'jturney/master'

commit 80054fcafb095aff76f6df00d348c7fd85e8ddbc
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sat Mar 30 19:44:14 2013 +0000

    hw/xwin: Update manifest to target all architectures, not just x86
    
    Update manifest to target all architectures, not just x86
    
    Also: Write explicit dependencies for Xwin.rc.  XWin.exe.manifest and X.ico are
    included the resource compiler output, so add a dependency on them to cause it
    to be recompiled if they change.
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am
index 93ce570..f131975 100644
--- a/hw/xwin/Makefile.am
+++ b/hw/xwin/Makefile.am
@@ -160,6 +160,8 @@ XWin_LDFLAGS = -mwindows -static
 .rc.o:
 	$(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
 winprefslex.c: winprefslex.l winprefsyacc.c winprefsyacc.h
 
diff --git a/hw/xwin/XWin.exe.manifest b/hw/xwin/XWin.exe.manifest
index a0d4d7d..477334f 100755
--- a/hw/xwin/XWin.exe.manifest
+++ b/hw/xwin/XWin.exe.manifest
@@ -7,7 +7,7 @@
 	       type="win32"
 	       name="Microsoft.Windows.Common-Controls"
 	       version="6.0.0.0"
-	       processorArchitecture="X86"
+	       processorArchitecture="*"
 	       publicKeyToken="6595b64144ccf1df"
 	       language="*"
 	     />
commit 689e7ad9b0fccd582cd63796cc90a999f141f589
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sun Mar 31 18:36:37 2013 +0100

    hw/xwin: Win32 Windows properties are of pointer type HANDLE, not an integer type
    
    Win32 Windows properties are of pointer type HANDLE, not an integer type, but we
    use the Windows property WINDOW_WID_PROP to store the X window XID.
    
    Add appropriate casts to show it doesn't matter that an XID is smaller than a
    pointer on 64-bit build.
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
index dcbfaff..44ad193 100644
--- a/hw/xwin/winmultiwindowwindow.c
+++ b/hw/xwin/winmultiwindowwindow.c
@@ -519,7 +519,7 @@ winCreateWindowsWindow(WindowPtr pWin)
     if (winMultiWindowGetTransientFor(pWin, &daddyId)) {
         if (daddyId) {
             hFore = GetForegroundWindow();
-            if (hFore && (daddyId != (Window) GetProp(hFore, WIN_WID_PROP)))
+            if (hFore && (daddyId != (Window) (INT_PTR) GetProp(hFore, WIN_WID_PROP)))
                 hFore = NULL;
         }
     }
@@ -593,7 +593,7 @@ winCreateWindowsWindow(WindowPtr pWin)
     /* Cause any .XWinrc menus to be added in main WNDPROC */
     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 */
     SetProp(hWnd, WIN_NEEDMANAGE_PROP, (HANDLE) 0);
diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c
index 0e46ea7..3818187 100644
--- a/hw/xwin/winmultiwindowwndproc.c
+++ b/hw/xwin/winmultiwindowwndproc.c
@@ -343,7 +343,7 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
         /* */
         wmMsg.msg = 0;
         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.iY = pDraw->y;
@@ -391,8 +391,8 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
         /* */
         SetProp(hwnd,
                 WIN_WID_PROP,
-                (HANDLE) winGetWindowID(((LPCREATESTRUCT) lParam)->
-                                        lpCreateParams));
+                (HANDLE) (INT_PTR) winGetWindowID(((LPCREATESTRUCT) lParam)->
+                                                  lpCreateParams));
 
         /*
          * Make X windows' Z orders sync with Windows windows because
diff --git a/hw/xwin/winprefs.c b/hw/xwin/winprefs.c
index 05d8c87..8936aae 100644
--- a/hw/xwin/winprefs.c
+++ b/hw/xwin/winprefs.c
@@ -181,7 +181,7 @@ ReloadEnumWindowsProc(HWND hwnd, LPARAM lParam)
 
                 wmMsg.msg = WM_WM_ICON_EVENT;
                 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);
             }
commit e1a0945e8d4a3858838a14e64022524efd73c905
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sun Mar 31 18:35:35 2013 +0100

    hw/xwin: winMultiWindowGetTransientFor() returns an XID not a WindowPtr
    
    winMultiWindowGetTransientFor() accesses the WM_TRANSIENT_FOR property, which is
    an X window XID (which we compare with WINDOW_WID_PROP) and not a WindowPtr.
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winmultiwindowclass.c b/hw/xwin/winmultiwindowclass.c
index 1af104d..ced8f45 100644
--- a/hw/xwin/winmultiwindowclass.c
+++ b/hw/xwin/winmultiwindowclass.c
@@ -213,7 +213,7 @@ winMultiWindowGetWMNormalHints(WindowPtr pWin, WinXSizeHints * hints)
 }
 
 int
-winMultiWindowGetTransientFor(WindowPtr pWin, WindowPtr *ppDaddy)
+winMultiWindowGetTransientFor(WindowPtr pWin, Window *pDaddyId)
 {
     struct _Window *pwin;
     struct _Property *prop;
@@ -230,13 +230,13 @@ winMultiWindowGetTransientFor(WindowPtr pWin, WindowPtr *ppDaddy)
     else
         prop = NULL;
 
-    if (ppDaddy)
-        *ppDaddy = NULL;
+    if (pDaddyId)
+        *pDaddyId = 0;
 
     while (prop) {
         if (prop->propertyName == XA_WM_TRANSIENT_FOR) {
-            if (ppDaddy)
-                memcpy(ppDaddy, prop->data, sizeof(WindowPtr));
+            if (pDaddyId)
+                memcpy(pDaddyId, prop->data, sizeof(Window));
             return 1;
         }
         else
diff --git a/hw/xwin/winmultiwindowclass.h b/hw/xwin/winmultiwindowclass.h
index 0e3465c..3244f78 100644
--- a/hw/xwin/winmultiwindowclass.h
+++ b/hw/xwin/winmultiwindowclass.h
@@ -118,6 +118,6 @@ int
  winMultiWindowGetWMName(WindowPtr pWin, char **wmName);
 
 int
- winMultiWindowGetTransientFor(WindowPtr pWin, WindowPtr *ppDaddy);
+ winMultiWindowGetTransientFor(WindowPtr pWin, Window *ppDaddy);
 
 #endif
diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
index 0948156..dcbfaff 100644
--- a/hw/xwin/winmultiwindowwindow.c
+++ b/hw/xwin/winmultiwindowwindow.c
@@ -486,7 +486,7 @@ winCreateWindowsWindow(WindowPtr pWin)
     winWindowPriv(pWin);
     winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv;
     WinXSizeHints hints;
-    WindowPtr pDaddy;
+    Window daddyId;
     DWORD dwStyle, dwExStyle;
     RECT rc;
 
@@ -516,10 +516,10 @@ winCreateWindowsWindow(WindowPtr pWin)
     winDebug("winCreateWindowsWindow - %dx%d @ %dx%d\n", iWidth, iHeight, iX,
              iY);
 
-    if (winMultiWindowGetTransientFor(pWin, &pDaddy)) {
-        if (pDaddy) {
+    if (winMultiWindowGetTransientFor(pWin, &daddyId)) {
+        if (daddyId) {
             hFore = GetForegroundWindow();
-            if (hFore && (pDaddy != (WindowPtr) GetProp(hFore, WIN_WID_PROP)))
+            if (hFore && (daddyId != (Window) GetProp(hFore, WIN_WID_PROP)))
                 hFore = NULL;
         }
     }
commit be201ac257687355bf0916d7c525d598ed9b1282
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sat Mar 30 19:47:16 2013 +0000

    hw/xwin: Change winIconIsOverride() to take a HICON parameter
    
    Change winIconIsOverride() to take a HICON parameter, so some unneccessary
    casts, which weren't portable to 64-bit Cygwin, can be removed.
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/winmultiwindowicons.c b/hw/xwin/winmultiwindowicons.c
index 0322d98..bcc5688 100644
--- a/hw/xwin/winmultiwindowicons.c
+++ b/hw/xwin/winmultiwindowicons.c
@@ -624,7 +624,7 @@ winDestroyIcon(HICON hIcon)
     /* Delete the icon if its not one of the application defaults or an override */
     if (hIcon &&
         hIcon != g_hIconX &&
-        hIcon != g_hSmallIconX && !winIconIsOverride((unsigned long) hIcon))
+        hIcon != g_hSmallIconX && !winIconIsOverride(hIcon))
         DestroyIcon(hIcon);
 }
 #endif
diff --git a/hw/xwin/winprefs.c b/hw/xwin/winprefs.c
index 6cbd7ad..05d8c87 100644
--- a/hw/xwin/winprefs.c
+++ b/hw/xwin/winprefs.c
@@ -617,13 +617,10 @@ winOverrideIcon(char *res_name, char *res_class, char *wmName)
  * ICONS{} overrides)?
  */
 int
-winIconIsOverride(unsigned hiconIn)
+winIconIsOverride(HICON hicon)
 {
-    HICON hicon;
     int i;
 
-    hicon = (HICON) hiconIn;
-
     if (!hicon)
         return 0;
 
diff --git a/hw/xwin/winprefs.h b/hw/xwin/winprefs.h
index 5de5719..a4a6e7e 100644
--- a/hw/xwin/winprefs.h
+++ b/hw/xwin/winprefs.h
@@ -162,7 +162,7 @@ Bool
  HandleCustomWM_COMMAND(unsigned long hwndIn, int command);
 
 int
- winIconIsOverride(unsigned hiconIn);
+ winIconIsOverride(HICON hicon);
 
 HICON winOverrideIcon(char *res_name, char *res_class, char *wmName);
 
commit fc40f9a92cf5981bccc45bbc0b959cc06c5accc2
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sat Mar 30 19:41:06 2013 +0000

    hw/xwin: Fix uses of CreateDialogParam() for 64-bit builds
    
    Fix uses of CreateDialogParam() to be more strictly correct, for 64-bit builds
    
    dwInitParam parameter is LPARAM, not int
    Return type of DLGPROC is INT_PTR, not WINBOOL
    
    Also: Reporting the value of g_hDlgDepthChange is completely uninteresting, we
    are just interested in GetLastError() if it is NULL
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/windialogs.c b/hw/xwin/windialogs.c
index 16f7ba0..054ee95 100644
--- a/hw/xwin/windialogs.c
+++ b/hw/xwin/windialogs.c
@@ -47,13 +47,13 @@ extern Bool g_fClipboardStarted;
  * Local function prototypes
  */
 
-static wBOOL CALLBACK
+static INT_PTR CALLBACK
 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);
 
-static wBOOL CALLBACK
+static INT_PTR CALLBACK
 winAboutDlgProc(HWND hDialog, UINT message, WPARAM wParam, LPARAM lParam);
 
 static void
@@ -285,7 +285,7 @@ winDisplayExitDialog(winPrivScreenPtr pScreenPriv)
     g_hDlgExit = CreateDialogParam(g_hInstance,
                                    "EXIT_DIALOG",
                                    pScreenPriv->hwndScreen,
-                                   winExitDlgProc, (int) pScreenPriv);
+                                   winExitDlgProc, (LPARAM) pScreenPriv);
 
     /* Show the dialog box */
     ShowWindow(g_hDlgExit, SW_SHOW);
@@ -304,7 +304,7 @@ winDisplayExitDialog(winPrivScreenPtr pScreenPriv)
  * Exit dialog window procedure
  */
 
-static wBOOL CALLBACK
+static INT_PTR CALLBACK
 winExitDlgProc(HWND hDialog, UINT message, WPARAM wParam, LPARAM lParam)
 {
     static winPrivScreenPtr s_pScreenPriv = NULL;
@@ -404,14 +404,13 @@ winDisplayDepthChangeDialog(winPrivScreenPtr pScreenPriv)
                                           "DEPTH_CHANGE_BOX",
                                           pScreenPriv->hwndScreen,
                                           winChangeDepthDlgProc,
-                                          (int) pScreenPriv);
+                                          (LPARAM) pScreenPriv);
     /* Show the dialog box */
     ShowWindow(g_hDlgDepthChange, SW_SHOW);
 
-    ErrorF("winDisplayDepthChangeDialog - DialogBox returned: %d\n",
-           (int) g_hDlgDepthChange);
-    ErrorF("winDisplayDepthChangeDialog - GetLastError: %d\n",
-           (int) GetLastError());
+    if (!g_hDlgDepthChange)
+        ErrorF("winDisplayDepthChangeDialog - GetLastError: %d\n",
+                (int) GetLastError());
 
     /* Minimize the display window */
     ShowWindow(pScreenPriv->hwndScreen, SW_MINIMIZE);
@@ -422,7 +421,7 @@ winDisplayDepthChangeDialog(winPrivScreenPtr pScreenPriv)
  * disruptive screen depth changes. 
  */
 
-static wBOOL CALLBACK
+static INT_PTR CALLBACK
 winChangeDepthDlgProc(HWND hwndDialog, UINT message,
                       WPARAM wParam, LPARAM lParam)
 {
@@ -536,7 +535,7 @@ winDisplayAboutDialog(winPrivScreenPtr pScreenPriv)
     g_hDlgAbout = CreateDialogParam(g_hInstance,
                                     "ABOUT_BOX",
                                     pScreenPriv->hwndScreen,
-                                    winAboutDlgProc, (int) pScreenPriv);
+                                    winAboutDlgProc, (LPARAM) pScreenPriv);
 
     /* Show the dialog box */
     ShowWindow(g_hDlgAbout, SW_SHOW);
@@ -553,7 +552,7 @@ winDisplayAboutDialog(winPrivScreenPtr pScreenPriv)
  * Process messages for the about dialog.
  */
 
-static wBOOL CALLBACK
+static INT_PTR CALLBACK
 winAboutDlgProc(HWND hwndDialog, UINT message, WPARAM wParam, LPARAM lParam)
 {
     static winPrivScreenPtr s_pScreenPriv = NULL;
commit b542976846eb5d4c82910272af32ec8298da4177
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Sat Mar 30 19:40:31 2013 +0000

    hw/xwin: deprecated interface cygwin_conv_to_win32_path() doesn't exist in 64-bit cygwin
    
    The deprecated interface cygwin_conv_to_win32_path() doesn't exist in 64-bit
    cygwin, but both the ID_ABOUT_CHANGELOG control and the referenced file who's
    path we are converting haven't existed for a while, so just remove this unused,
    cygwin-specific code.
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/windialogs.c b/hw/xwin/windialogs.c
index 3ceaf4e..16f7ba0 100644
--- a/hw/xwin/windialogs.c
+++ b/hw/xwin/windialogs.c
@@ -33,9 +33,6 @@
 #include <xwin-config.h>
 #endif
 #include "win.h"
-#ifdef __CYGWIN__
-#include <sys/cygwin.h>
-#endif
 #include <shellapi.h>
 #include "winprefs.h"
 
@@ -623,17 +620,8 @@ winAboutDlgProc(HWND hwndDialog, UINT message, WPARAM wParam, LPARAM lParam)
         {
             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/"
                 "devel/server/changelog.html";
-#endif
 
             iReturn = (INT_PTR) ShellExecute(NULL,
                                          "open",
commit 5a47c6420cfe298143310938f08cc36a503e8d3d
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Mon Apr 8 01:27:26 2013 +0100

    hw/xwin: Fix a 64-bit portability issue with casting HINSTANCE result of ShellExecute() to an integer
    
    Fix a 64-bit portability issue with casting HINSTANCE result of ShellExecute()
    to an integer: Since HINSTANCE is a pointer type, use INT_PTR rather than int.
    
    Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/windialogs.c b/hw/xwin/windialogs.c
index 86f332a..3ceaf4e 100644
--- a/hw/xwin/windialogs.c
+++ b/hw/xwin/windialogs.c
@@ -621,7 +621,7 @@ winAboutDlgProc(HWND hwndDialog, UINT message, WPARAM wParam, LPARAM lParam)
 
         case ID_ABOUT_CHANGELOG:
         {
-            int iReturn;
+            INT_PTR iReturn;
 
 #ifdef __CYGWIN__
             const char *pszCygPath = "/usr/X11R6/share/doc/"
@@ -635,12 +635,12 @@ winAboutDlgProc(HWND hwndDialog, UINT message, WPARAM wParam, LPARAM lParam)
                 "devel/server/changelog.html";
 #endif
 
-            iReturn = (int) ShellExecute(NULL,
+            iReturn = (INT_PTR) ShellExecute(NULL,
                                          "open",
                                          pszWinPath, NULL, NULL, SW_MAXIMIZE);
             if (iReturn < 32) {
                 ErrorF("winAboutDlgProc - WM_COMMAND - ID_ABOUT_CHANGELOG - "
-                       "ShellExecute failed: %d\n", iReturn);
+                       "ShellExecute failed: %d\n", (int)iReturn);
             }
         }
             return TRUE;
@@ -648,14 +648,15 @@ winAboutDlgProc(HWND hwndDialog, UINT message, WPARAM wParam, LPARAM lParam)
         case ID_ABOUT_WEBSITE:
         {
             const char *pszPath = __VENDORDWEBSUPPORT__;
-            int iReturn;
+            INT_PTR iReturn;
 
-            iReturn = (int) ShellExecute(NULL,
+            iReturn = (INT_PTR) ShellExecute(NULL,
                                          "open",
                                          pszPath, NULL, NULL, SW_MAXIMIZE);
             if (iReturn < 32) {
                 ErrorF("winAboutDlgProc - WM_COMMAND - ID_ABOUT_WEBSITE - "
-                       "ShellExecute failed: %d\n", iReturn);
+                       "ShellExecute failed: %d\n", (int)iReturn);
+
             }
         }
             return TRUE;
@@ -663,14 +664,14 @@ winAboutDlgProc(HWND hwndDialog, UINT message, WPARAM wParam, LPARAM lParam)
         case ID_ABOUT_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",
                                          pszPath, NULL, NULL, SW_MAXIMIZE);
             if (iReturn < 32) {
                 ErrorF("winAboutDlgProc - WM_COMMAND - ID_ABOUT_UG - "
-                       "ShellExecute failed: %d\n", iReturn);
+                       "ShellExecute failed: %d\n", (int)iReturn);
             }
         }
             return TRUE;
@@ -678,14 +679,14 @@ winAboutDlgProc(HWND hwndDialog, UINT message, WPARAM wParam, LPARAM lParam)
         case ID_ABOUT_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",
                                          pszPath, NULL, NULL, SW_MAXIMIZE);
             if (iReturn < 32) {
                 ErrorF("winAboutDlgProc - WM_COMMAND - ID_ABOUT_FAQ - "
-                       "ShellExecute failed: %d\n", iReturn);
+                       "ShellExecute failed: %d\n", (int)iReturn);
             }
         }
             return TRUE;


More information about the xorg-commit mailing list