xserver: Branch 'master' - 8 commits

Keith Packard keithp at kemper.freedesktop.org
Mon Mar 3 10:11:08 PST 2014


 hw/xwin/InitOutput.c           |    5 +-
 hw/xwin/glx/gen_gl_wrappers.py |   45 ++++++--------------
 hw/xwin/glx/indirect.c         |    2 
 hw/xwin/win.h                  |    6 +-
 hw/xwin/winallpriv.c           |    4 -
 hw/xwin/winclipboardinit.c     |    2 
 hw/xwin/winclipboardxevents.c  |    5 --
 hw/xwin/wincursor.c            |   10 +---
 hw/xwin/winkeybd.c             |    2 
 hw/xwin/winmonitors.h          |    2 
 hw/xwin/winmultiwindowwm.c     |   91 +++++++++++++++++++++++++++++------------
 hw/xwin/winnativegdi.c         |    3 -
 hw/xwin/winprefslex.l          |    3 -
 hw/xwin/winprefsyacc.y         |   25 ++++-------
 hw/xwin/winshadgdi.c           |    6 --
 hw/xwin/winwin32rootless.c     |    7 +--
 hw/xwin/winwindow.c            |    2 
 hw/xwin/winwindowswm.c         |    4 -
 18 files changed, 119 insertions(+), 105 deletions(-)

New commits:
commit b634e909895f6001e7d9543e1350b20c82c8c01c
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Thu Jun 27 23:56:23 2013 +0100

    hw/xwin: More closely follow ICCCM for setting input focus
    
    In multiwindow mode, more closely follow ICCCM section 4.1.7 when setting X
    input focus to a window when the native Windows window acquires input focus:
    
    - If InputHint is FALSE, don't use XSetInputFocus()
    - If the window supports the WM_TAKE_FOCUS protocol, send a WM_TAKE_FOCUS message
    
    This helps JDK 1.7 clients acquire the focus correctly.
    
    Also, factor out checking client support for a given WM_PROTOCOLS protocol as a
    separate function.
    
    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/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index c6da777..9f12521 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -111,6 +111,7 @@ typedef struct _WMInfo {
     WMMsgQueueRec wmMsgQueue;
     Atom atmWmProtos;
     Atom atmWmDelete;
+    Atom atmWmTakeFocus;
     Atom atmPrivMap;
     Bool fAllowOtherWM;
 } WMInfoRec, *WMInfoPtr;
@@ -453,6 +454,27 @@ GetWindowName(Display * pDisplay, Window iWin, char **ppWindowName)
 }
 
 /*
+ * Does the client support the specified WM_PROTOCOLS protocol?
+ */
+
+static Bool
+IsWmProtocolAvailable(Display * pDisplay, Window iWindow, Atom atmProtocol)
+{
+  int i, n, found = 0;
+  Atom *protocols;
+
+  if (XGetWMProtocols(pDisplay, iWindow, &protocols, &n)) {
+    for (i = 0; i < n; ++i)
+      if (protocols[i] == atmProtocol)
+        ++found;
+
+    XFree(protocols);
+  }
+
+  return found > 0;
+}
+
+/*
  * Send a message to the X server from the WM thread
  */
 
@@ -805,21 +827,10 @@ winMultiWindowWMProc(void *pArg)
             ErrorF("\tWM_WM_KILL\n");
 #endif
             {
-                int i, n, found = 0;
-                Atom *protocols;
-
-                /* --- */
-                if (XGetWMProtocols(pWMInfo->pDisplay,
-                                    pNode->msg.iWindow, &protocols, &n)) {
-                    for (i = 0; i < n; ++i)
-                        if (protocols[i] == pWMInfo->atmWmDelete)
-                            ++found;
-
-                    XFree(protocols);
-                }
-
                 /* --- */
-                if (found)
+                if (IsWmProtocolAvailable(pWMInfo->pDisplay,
+                                          pNode->msg.iWindow,
+                                          pWMInfo->atmWmDelete))
                     SendXMessage(pWMInfo->pDisplay,
                                  pNode->msg.iWindow,
                                  pWMInfo->atmWmProtos, pWMInfo->atmWmDelete);
@@ -832,11 +843,39 @@ winMultiWindowWMProc(void *pArg)
 #if CYGMULTIWINDOW_DEBUG
             ErrorF("\tWM_WM_ACTIVATE\n");
 #endif
-
             /* Set the input focus */
-            XSetInputFocus(pWMInfo->pDisplay,
-                           pNode->msg.iWindow,
-                           RevertToPointerRoot, CurrentTime);
+
+            /*
+               ICCCM 4.1.7 is pretty opaque, but it appears that the rules are
+               actually quite simple:
+               -- the WM_HINTS input field determines whether the WM should call
+               XSetInputFocus()
+               -- independently, the WM_TAKE_FOCUS protocol determines whether
+               the WM should send a WM_TAKE_FOCUS ClientMessage.
+            */
+            {
+              Bool neverFocus = FALSE;
+              XWMHints *hints = XGetWMHints(pWMInfo->pDisplay, pNode->msg.iWindow);
+
+              if (hints) {
+                if (hints->flags & InputHint)
+                  neverFocus = !hints->input;
+                XFree(hints);
+              }
+
+              if (!neverFocus)
+                XSetInputFocus(pWMInfo->pDisplay,
+                               pNode->msg.iWindow,
+                               RevertToPointerRoot, CurrentTime);
+
+              if (IsWmProtocolAvailable(pWMInfo->pDisplay,
+                                        pNode->msg.iWindow,
+                                        pWMInfo->atmWmTakeFocus))
+                SendXMessage(pWMInfo->pDisplay,
+                             pNode->msg.iWindow,
+                             pWMInfo->atmWmProtos, pWMInfo->atmWmTakeFocus);
+
+            }
             break;
 
         case WM_WM_NAME_EVENT:
@@ -1404,6 +1443,8 @@ winInitMultiWindowWM(WMInfoPtr pWMInfo, WMProcArgPtr pProcArg)
                                        "WM_PROTOCOLS", False);
     pWMInfo->atmWmDelete = XInternAtom(pWMInfo->pDisplay,
                                        "WM_DELETE_WINDOW", False);
+    pWMInfo->atmWmTakeFocus = XInternAtom(pWMInfo->pDisplay,
+                                       "WM_TAKE_FOCUS", False);
 
     pWMInfo->atmPrivMap = XInternAtom(pWMInfo->pDisplay,
                                       WINDOWSWM_NATIVE_HWND, False);
commit 0fc84a2bb6970f6b05a19cd8b32a7f3f7fd148b3
Author: Colin Harrison <colin.harrison at virgin.net>
Date:   Fri Feb 28 15:02:14 2014 +0000

    hw/xwin: Remove unnecessary casts from malloc/realloc/calloc calls
    
    Remove unnecessary casts from malloc/realloc/calloc calls. This is the style
    used for the majority of X server code.
    
    Signed-off-by: Colin Harrison <colin.harrison at virgin.net>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c
index f130651..6906114 100644
--- a/hw/xwin/glx/indirect.c
+++ b/hw/xwin/glx/indirect.c
@@ -1613,7 +1613,7 @@ glxWinCreateContext(__GLXscreen * screen,
         glxWinReleaseTexImage
     };
 
-    context = (__GLXWinContext *) calloc(1, sizeof(__GLXWinContext));
+    context = calloc(1, sizeof(__GLXWinContext));
 
     if (!context)
         return NULL;
diff --git a/hw/xwin/winallpriv.c b/hw/xwin/winallpriv.c
index cc3b3d1..629af92 100644
--- a/hw/xwin/winallpriv.c
+++ b/hw/xwin/winallpriv.c
@@ -58,7 +58,7 @@ winAllocatePrivates(ScreenPtr pScreen)
     }
 
     /* Allocate memory for the screen private structure */
-    pScreenPriv = (winPrivScreenPtr) malloc(sizeof(winPrivScreenRec));
+    pScreenPriv = malloc(sizeof(winPrivScreenRec));
     if (!pScreenPriv) {
         ErrorF("winAllocateScreenPrivates - malloc () failed\n");
         return FALSE;
@@ -150,7 +150,7 @@ winAllocateCmapPrivates(ColormapPtr pCmap)
     }
 
     /* Allocate memory for our private structure */
-    pCmapPriv = (winPrivCmapPtr) malloc(sizeof(winPrivCmapRec));
+    pCmapPriv = malloc(sizeof(winPrivCmapRec));
     if (!pCmapPriv) {
         ErrorF("winAllocateCmapPrivates - malloc () failed\n");
         return FALSE;
diff --git a/hw/xwin/winclipboardxevents.c b/hw/xwin/winclipboardxevents.c
index 226c3f0..7d3c30e 100644
--- a/hw/xwin/winclipboardxevents.c
+++ b/hw/xwin/winclipboardxevents.c
@@ -248,7 +248,7 @@ winClipboardFlushXEvents(HWND hwnd,
                                                       (LPCWSTR) pszGlobalData,
                                                       -1, NULL, 0, NULL, NULL);
                 /* NOTE: iConvertDataLen includes space for null terminator */
-                pszConvertData = (char *) malloc(iConvertDataLen);
+                pszConvertData = malloc(iConvertDataLen);
                 WideCharToMultiByte(CP_UTF8,
                                     0,
                                     (LPCWSTR) pszGlobalData,
@@ -581,8 +581,7 @@ winClipboardFlushXEvents(HWND hwnd,
                                                   pszReturnData, -1, NULL, 0);
 
                 /* Allocate memory for the Unicode string */
-                pwszUnicodeStr
-                    = (wchar_t *) malloc(sizeof(wchar_t) * (iUnicodeLen + 1));
+                pwszUnicodeStr = malloc(sizeof(wchar_t) * (iUnicodeLen + 1));
                 if (!pwszUnicodeStr) {
                     ErrorF("winClipboardFlushXEvents - SelectionNotify "
                            "malloc failed for pwszUnicodeStr, aborting.\n");
diff --git a/hw/xwin/wincursor.c b/hw/xwin/wincursor.c
index a35336a..f3ac0f7 100644
--- a/hw/xwin/wincursor.c
+++ b/hw/xwin/wincursor.c
@@ -255,10 +255,8 @@ winLoadCursor(ScreenPtr pScreen, CursorPtr pCursor, int screen)
         bi.bV4BlueMask = 0x000000FF;
         bi.bV4AlphaMask = 0xFF000000;
 
-        lpBits =
-            (uint32_t *) calloc(pScreenPriv->cursor.sm_cx *
-                                pScreenPriv->cursor.sm_cy,
-                                sizeof(uint32_t));
+        lpBits = calloc(pScreenPriv->cursor.sm_cx * pScreenPriv->cursor.sm_cy,
+                        sizeof(uint32_t));
 
         if (lpBits) {
             int y;
@@ -302,9 +300,7 @@ winLoadCursor(ScreenPtr pScreen, CursorPtr pCursor, int screen)
         pbmiColors[2].rgbBlue = pCursor->foreBlue >> 8;
         pbmiColors[2].rgbReserved = 0;
 
-        lpBits =
-            (uint32_t *) calloc(pScreenPriv->cursor.sm_cx *
-                                pScreenPriv->cursor.sm_cy, sizeof(char));
+        lpBits = calloc(pScreenPriv->cursor.sm_cx * pScreenPriv->cursor.sm_cy, 1);
 
         pCur = (unsigned char *) lpBits;
         if (lpBits) {
diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index 1dd8ba5..c6da777 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -405,7 +405,7 @@ Xutf8TextPropertyToString(Display * pDisplay, XTextProperty * xtp)
 
         for (i = 0; i < nNum; i++)
             iLen += strlen(ppList[i]);
-        pszReturnData = (char *) malloc(iLen + 1);
+        pszReturnData = malloc(iLen + 1);
         pszReturnData[0] = '\0';
         for (i = 0; i < nNum; i++)
             strcat(pszReturnData, ppList[i]);
@@ -413,7 +413,7 @@ Xutf8TextPropertyToString(Display * pDisplay, XTextProperty * xtp)
             XFreeStringList(ppList);
     }
     else {
-        pszReturnData = (char *) malloc(1);
+        pszReturnData = malloc(1);
         pszReturnData[0] = '\0';
     }
 
@@ -537,7 +537,7 @@ UpdateName(WMInfoPtr pWMInfo, Window iWindow)
             int iLen =
                 MultiByteToWideChar(CP_UTF8, 0, pszWindowName, -1, NULL, 0);
             wchar_t *pwszWideWindowName =
-                (wchar_t *) malloc(sizeof(wchar_t) * (iLen + 1));
+                malloc(sizeof(wchar_t)*(iLen + 1));
             MultiByteToWideChar(CP_UTF8, 0, pszWindowName, -1,
                                 pwszWideWindowName, iLen);
 
@@ -1237,9 +1237,9 @@ winInitWM(void **ppWMInfo,
           pthread_mutex_t * ppmServerStarted,
           int dwScreen, HWND hwndScreen, BOOL allowOtherWM)
 {
-    WMProcArgPtr pArg = (WMProcArgPtr) malloc(sizeof(WMProcArgRec));
-    WMInfoPtr pWMInfo = (WMInfoPtr) malloc(sizeof(WMInfoRec));
-    XMsgProcArgPtr pXMsgArg = (XMsgProcArgPtr) malloc(sizeof(XMsgProcArgRec));
+    WMProcArgPtr pArg = malloc(sizeof(WMProcArgRec));
+    WMInfoPtr pWMInfo = malloc(sizeof(WMInfoRec));
+    XMsgProcArgPtr pXMsgArg = malloc(sizeof(XMsgProcArgRec));
 
     /* Bail if the input parameters are bad */
     if (pArg == NULL || pWMInfo == NULL || pXMsgArg == NULL) {
@@ -1432,7 +1432,7 @@ winSendMessageToWM(void *pWMInfo, winWMMessagePtr pMsg)
     ErrorF("winSendMessageToWM ()\n");
 #endif
 
-    pNode = (WMMsgNodePtr) malloc(sizeof(WMMsgNodeRec));
+    pNode = malloc(sizeof(WMMsgNodeRec));
     if (pNode != NULL) {
         memcpy(&pNode->msg, pMsg, sizeof(winWMMessageRec));
         PushMessage(&((WMInfoPtr) pWMInfo)->wmMsgQueue, pNode);
diff --git a/hw/xwin/winnativegdi.c b/hw/xwin/winnativegdi.c
index a2a5123..1859698 100644
--- a/hw/xwin/winnativegdi.c
+++ b/hw/xwin/winnativegdi.c
@@ -344,8 +344,7 @@ winCreateDIBNativeGDI(int iWidth, int iHeight, int iDepth,
     }
 
     /* Allocate bitmap info header */
-    pbmih = (BITMAPINFOHEADER *) malloc(sizeof(BITMAPINFOHEADER)
-                                        + 256 * sizeof(RGBQUAD));
+    pbmih = malloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD));
     if (pbmih == NULL) {
         ErrorF("winCreateDIBNativeGDI - malloc () failed\n");
         return FALSE;
diff --git a/hw/xwin/winprefslex.l b/hw/xwin/winprefslex.l
index 9af6103..fd13edc 100644
--- a/hw/xwin/winprefslex.l
+++ b/hw/xwin/winprefslex.l
@@ -45,7 +45,7 @@ extern void ErrorF (const char* /*f*/, ...);
 static char *makestr(char *str)
 {
   char *ptr;
-  ptr = (char*)malloc (strlen(str)+1);
+  ptr = malloc(strlen(str)+1);
   if (!ptr)
     {
       ErrorF ("winMultiWindowLex:makestr() out of memory\n");
diff --git a/hw/xwin/winprefsyacc.y b/hw/xwin/winprefsyacc.y
index 3b376b3..683fc44 100644
--- a/hw/xwin/winprefsyacc.y
+++ b/hw/xwin/winprefsyacc.y
@@ -311,10 +311,9 @@ static void
 AddMenuLine (char *text, MENUCOMMANDTYPE cmd, char *param)
 {
   if (menu.menuItem==NULL)
-    menu.menuItem = (MENUITEM*)malloc(sizeof(MENUITEM));
+    menu.menuItem = malloc(sizeof(MENUITEM));
   else
-    menu.menuItem = (MENUITEM*)
-      realloc(menu.menuItem, sizeof(MENUITEM)*(menu.menuItems+1));
+    menu.menuItem = realloc(menu.menuItem, sizeof(MENUITEM)*(menu.menuItems+1));
 
   strncpy (menu.menuItem[menu.menuItems].text, text, MENU_MAX);
   menu.menuItem[menu.menuItems].text[MENU_MAX] = 0;
@@ -339,10 +338,9 @@ CloseMenu (void)
     }
   
   if (pref.menuItems)
-    pref.menu = (MENUPARSED*)
-      realloc (pref.menu, (pref.menuItems+1)*sizeof(MENUPARSED));
+    pref.menu = realloc (pref.menu, (pref.menuItems+1)*sizeof(MENUPARSED));
   else
-    pref.menu = (MENUPARSED*)malloc (sizeof(MENUPARSED));
+    pref.menu = malloc (sizeof(MENUPARSED));
   
   memcpy (pref.menu+pref.menuItems, &menu, sizeof(MENUPARSED));
   pref.menuItems++;
@@ -365,10 +363,9 @@ static void
 AddIconLine (char *matchstr, char *iconfile)
 {
   if (pref.icon==NULL)
-    pref.icon = (ICONITEM*)malloc(sizeof(ICONITEM));
+    pref.icon = malloc(sizeof(ICONITEM));
   else
-    pref.icon = (ICONITEM*)
-      realloc(pref.icon, sizeof(ICONITEM)*(pref.iconItems+1));
+    pref.icon = realloc(pref.icon, sizeof(ICONITEM)*(pref.iconItems+1));
 
   strncpy(pref.icon[pref.iconItems].match, matchstr, MENU_MAX);
   pref.icon[pref.iconItems].match[MENU_MAX] = 0;
@@ -401,10 +398,9 @@ static void
 AddStyleLine (char *matchstr, unsigned long style)
 {
   if (pref.style==NULL)
-    pref.style = (STYLEITEM*)malloc(sizeof(STYLEITEM));
+    pref.style = malloc(sizeof(STYLEITEM));
   else
-    pref.style = (STYLEITEM*)
-      realloc(pref.style, sizeof(STYLEITEM)*(pref.styleItems+1));
+    pref.style = realloc(pref.style, sizeof(STYLEITEM)*(pref.styleItems+1));
 
   strncpy(pref.style[pref.styleItems].match, matchstr, MENU_MAX);
   pref.style[pref.styleItems].match[MENU_MAX] = 0;
@@ -434,10 +430,9 @@ static void
 AddSysMenuLine (char *matchstr, char *menuname, int pos)
 {
   if (pref.sysMenu==NULL)
-    pref.sysMenu = (SYSMENUITEM*)malloc(sizeof(SYSMENUITEM));
+    pref.sysMenu = malloc(sizeof(SYSMENUITEM));
   else
-    pref.sysMenu = (SYSMENUITEM*)
-      realloc(pref.sysMenu, sizeof(SYSMENUITEM)*(pref.sysMenuItems+1));
+    pref.sysMenu = realloc(pref.sysMenu, sizeof(SYSMENUITEM)*(pref.sysMenuItems+1));
 
   strncpy (pref.sysMenu[pref.sysMenuItems].match, matchstr, MENU_MAX);
   pref.sysMenu[pref.sysMenuItems].match[MENU_MAX] = 0;
diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c
index 2e3c64c..5c815eb 100644
--- a/hw/xwin/winshadgdi.c
+++ b/hw/xwin/winshadgdi.c
@@ -184,8 +184,7 @@ winQueryRGBBitsAndMasks(ScreenPtr pScreen)
     }
 
     /* Allocate a bitmap header and color table */
-    pbmih = (BITMAPINFOHEADER *) malloc(sizeof(BITMAPINFOHEADER)
-                                        + 256 * sizeof(RGBQUAD));
+    pbmih = malloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD));
     if (pbmih == NULL) {
         ErrorF("winQueryRGBBitsAndMasks - malloc failed\n");
         return FALSE;
@@ -545,8 +544,7 @@ winInitScreenShadowGDI(ScreenPtr pScreen)
     pScreenPriv->hdcShadow = CreateCompatibleDC(pScreenPriv->hdcScreen);
 
     /* Allocate bitmap info header */
-    pScreenPriv->pbmih = (BITMAPINFOHEADER *) malloc(sizeof(BITMAPINFOHEADER)
-                                                     + 256 * sizeof(RGBQUAD));
+    pScreenPriv->pbmih = malloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD));
     if (pScreenPriv->pbmih == NULL) {
         ErrorF("winInitScreenShadowGDI - malloc () failed\n");
         return FALSE;
diff --git a/hw/xwin/winwin32rootless.c b/hw/xwin/winwin32rootless.c
index 724976a..0b62696 100644
--- a/hw/xwin/winwin32rootless.c
+++ b/hw/xwin/winwin32rootless.c
@@ -184,8 +184,8 @@ InitWin32RootlessEngine(win32RootlessWindowPtr pRLWinPriv)
 
     /* Allocate bitmap info header */
     pRLWinPriv->pbmihShadow =
-        (BITMAPINFOHEADER *) malloc(sizeof(BITMAPINFOHEADER)
-                                    + 256 * sizeof(RGBQUAD));
+        malloc(sizeof(BITMAPINFOHEADER)
+               + 256 * sizeof(RGBQUAD));
     if (pRLWinPriv->pbmihShadow == NULL) {
         ErrorF("InitWin32RootlessEngine - malloc () failed\n");
         return;
@@ -214,8 +214,7 @@ winMWExtWMCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen,
              newX, newY, pFrame->width, pFrame->height);
 #endif
 
-    pRLWinPriv =
-        (win32RootlessWindowPtr) malloc(sizeof(win32RootlessWindowRec));
+    pRLWinPriv = malloc(sizeof(win32RootlessWindowRec));
     pRLWinPriv->pFrame = pFrame;
     pRLWinPriv->pfb = NULL;
     pRLWinPriv->hbmpShadow = NULL;
diff --git a/hw/xwin/winwindow.c b/hw/xwin/winwindow.c
index 759aa5e..8c1c28f 100644
--- a/hw/xwin/winwindow.c
+++ b/hw/xwin/winwindow.c
@@ -155,7 +155,7 @@ winCopyWindowNativeGDI(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
     nbox = RegionNumRects(prgnDst);
 
     /* Allocate source points for each box */
-    if (!(pptSrc = (DDXPointPtr) malloc(nbox * sizeof(DDXPointRec))))
+    if (!(pptSrc = malloc(nbox * sizeof(DDXPointRec))))
         return;
 
     /* Set an iterator pointer */
diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c
index c3503db..2805ff7 100644
--- a/hw/xwin/winwindowswm.c
+++ b/hw/xwin/winwindowswm.c
@@ -162,7 +162,7 @@ ProcWindowsWMSelectInput(ClientPtr client)
         }
 
         /* build the entry */
-        pNewEvent = (WMEventPtr) malloc(sizeof(WMEventRec));
+        pNewEvent = malloc(sizeof(WMEventRec));
         if (!pNewEvent)
             return BadAlloc;
         pNewEvent->next = 0;
@@ -183,7 +183,7 @@ ProcWindowsWMSelectInput(ClientPtr client)
          * done through the resource database.
          */
         if (!pHead) {
-            pHead = (WMEventPtr *) malloc(sizeof(WMEventPtr));
+            pHead = malloc(sizeof(WMEventPtr));
             if (!pHead ||
                 !AddResource(eventResource, eventResourceType, (void *) pHead))
             {
commit 94f709cfce62e716f8d3adea388625850de71e78
Author: Colin Harrison <colin.harrison at virgin.net>
Date:   Fri Feb 28 14:23:00 2014 +0000

    hw/xwin: Add missing FORCEEXIT token to XWin configuration file lexer
    
    Somehow this was left out of commmit f3fad371cce0f3836514ad5b29e59fa1ca0627a7
    
    Signed-off-by: Colin Harrison <colin.harrison at virgin.net>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/winprefslex.l b/hw/xwin/winprefslex.l
index 15f7077..9af6103 100644
--- a/hw/xwin/winprefslex.l
+++ b/hw/xwin/winprefslex.l
@@ -90,6 +90,7 @@ ALWAYSONTOP             { return ALWAYSONTOP; }
 DEBUG                   { return DEBUGOUTPUT; }
 RELOAD                  { return RELOAD; }
 TRAYICON                { return TRAYICON; }
+FORCEEXIT		{ return FORCEEXIT; }
 SILENTEXIT		{ return SILENTEXIT; }
 "{"                     { return LB; }
 "}"                     { return RB; }
commit 6432d44020443bbda90bd46ffcb572b51be803a1
Author: Colin Harrison <colin.harrison at virgin.net>
Date:   Fri Feb 28 14:21:46 2014 +0000

    hw/xwin: Silence bell when volume is zero
    
    Allow the bell to be turned off with X server option '-f 0', or by 'xset b off'.
    
    Signed-off-by: Colin Harrison <colin.harrison at virgin.net>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c
index b6b2086..3a75ab2 100644
--- a/hw/xwin/winkeybd.c
+++ b/hw/xwin/winkeybd.c
@@ -128,7 +128,7 @@ winKeybdBell(int iPercent, DeviceIntPtr pDeviceInt, void *pCtrl, int iClass)
      * sound on systems with a sound card or it will beep the PC speaker
      * on systems that do not have a sound card.
      */
-    MessageBeep(MB_OK);
+    if (iPercent > 0) MessageBeep(MB_OK);
 }
 
 /* Change some keyboard configuration parameters */
commit 7e37c4f727609d2d992ca46ffce56311c8d8225c
Author: Colin Harrison <colin.harrison at virgin.net>
Date:   Fri Feb 28 14:21:06 2014 +0000

    hw/xwin: Fix typo in comment
    
    'i' before 'e' except after 'c'
    
    Signed-off-by: Colin Harrison <colin.harrison at virgin.net>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/winclipboardinit.c b/hw/xwin/winclipboardinit.c
index 304e6df..157006d 100644
--- a/hw/xwin/winclipboardinit.c
+++ b/hw/xwin/winclipboardinit.c
@@ -77,7 +77,7 @@ winInitClipboard(void)
 }
 
 /*
- * Create the Windows window that we use to recieve Windows messages
+ * Create the Windows window that we use to receive Windows messages
  */
 
 HWND
commit d75195b62677f5b0f17bbe089b3aea5b295d5f2c
Author: Colin Harrison <colin.harrison at virgin.net>
Date:   Fri Feb 28 14:20:48 2014 +0000

    hw/xwin: Align parameter names in prototypes with definition
    
    A follow up to commits 2d9123fd, 451c5d91 and efe96a17, which changed the
    parameter name in the definition from index to i, to fix shadowing index() but
    didn't adjust the prototype declaration.
    
    Signed-off-by: Colin Harrison <colin.harrison at virgin.net>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/win.h b/hw/xwin/win.h
index 0adb227..80fc504 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -751,7 +751,7 @@ Bool
  winAllocatePrivates(ScreenPtr pScreen);
 
 Bool
- winInitCmapPrivates(ColormapPtr pCmap, int index);
+ winInitCmapPrivates(ColormapPtr pCmap, int i);
 
 Bool
  winAllocateCmapPrivates(ColormapPtr pCmap);
@@ -1056,12 +1056,12 @@ Bool
  winScreenInit(ScreenPtr pScreen, int argc, char **argv);
 
 Bool
- winFinishScreenInitFB(int index, ScreenPtr pScreen, int argc, char **argv);
+ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv);
 
 #if defined(XWIN_NATIVEGDI)
 Bool
 
-winFinishScreenInitNativeGDI(int index,
+winFinishScreenInitNativeGDI(int i,
                              ScreenPtr pScreen, int argc, char **argv);
 #endif
 
diff --git a/hw/xwin/winmonitors.h b/hw/xwin/winmonitors.h
index 8201e47..5fe3ecd 100644
--- a/hw/xwin/winmonitors.h
+++ b/hw/xwin/winmonitors.h
@@ -40,4 +40,4 @@ struct GetMonitorInfoData {
     HMONITOR monitorHandle;
 };
 
-Bool QueryMonitor(int index, struct GetMonitorInfoData *data);
+Bool QueryMonitor(int i, struct GetMonitorInfoData *data);
commit e53568e2c5004a434a16e3971fb2cd0823e6487b
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date:   Wed Jan 1 16:43:38 2014 +0000

    hw/xwin: Just generate the WGL wrappers we need
    
    Just generate the WGL wrappers we need, rather than for everything in wgl.xml
    
    This avoids generating a lot of unused wrappers, and also avoids compilation
    requiring a wglext.h at least as new as wgl.xml
    
    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/glx/gen_gl_wrappers.py b/hw/xwin/glx/gen_gl_wrappers.py
index 683b9d9..cdbba63 100755
--- a/hw/xwin/glx/gen_gl_wrappers.py
+++ b/hw/xwin/glx/gen_gl_wrappers.py
@@ -43,35 +43,18 @@ thunkdefs=False
 staticwrappers=False
 nodebug=False
 
-#exclude base WGL API
-WinGDI={key: 1 for key in [
-     "wglCopyContext"
-    ,"wglCreateContext"
-    ,"wglCreateLayerContext"
-    ,"wglDeleteContext"
-    ,"wglGetCurrentContext"
-    ,"wglGetCurrentDC"
-    ,"wglGetProcAddress"
-    ,"wglMakeCurrent"
-    ,"wglShareLists"
-    ,"wglUseFontBitmapsA"
-    ,"wglUseFontBitmapsW"
-    ,"wglUseFontBitmaps"
-    ,"SwapBuffers"
-    ,"wglUseFontOutlinesA"
-    ,"wglUseFontOutlinesW"
-    ,"wglUseFontOutlines"
-    ,"wglDescribeLayerPlane"
-    ,"wglSetLayerPaletteEntries"
-    ,"wglGetLayerPaletteEntries"
-    ,"wglRealizeLayerPalette"
-    ,"wglSwapLayerBuffers"
-    ,"wglSwapMultipleBuffers"
-    ,"ChoosePixelFormat"
-    ,"DescribePixelFormat"
-    ,"GetEnhMetaFilePixelFormat"
-    ,"GetPixelFormat"
-    ,"SetPixelFormat"
+# list of WGL extension functions we use
+used_wgl_ext_fns = {key: 1 for key in [
+    "wglSwapIntervalEXT",
+    "wglGetExtensionsStringARB",
+    "wglDestroyPbufferARB",
+    "wglGetPbufferDCARB",
+    "wglReleasePbufferDCARB",
+    "wglCreatePbufferARB",
+    "wglMakeContextCurrentARB",
+    "wglChoosePixelFormatARB",
+    "wglGetPixelFormatAttribivARB",
+    "wglGetPixelFormatAttribivARB"
 ]}
 
 if __name__ == '__main__':
@@ -162,7 +145,7 @@ class PreResolveOutputGenerator(OutputGenerator):
     def genCmd(self, cmd, name):
         OutputGenerator.genCmd(self, cmd, name)
 
-        if name in WinGDI:
+        if prefix == 'wgl' and not name in used_wgl_ext_fns:
             return
 
         self.outFile.write('RESOLVE_DECL(PFN' + name.upper() + 'PROC);\n')
@@ -190,7 +173,7 @@ class WrapperOutputGenerator(OutputGenerator):
     def genCmd(self, cmd, name):
         OutputGenerator.genCmd(self, cmd, name)
 
-        if name in WinGDI:
+        if prefix == 'wgl' and not name in used_wgl_ext_fns:
             return
 
         proto=noneStr(cmd.elem.find('proto'))
commit dec5e9899bfee2a83f8a64f975790ecd2390256d
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Wed Apr 10 18:04:17 2013 +0100

    hw/xwin: Fix implicit-function-declaration warning in XwinExtensionInit() when compiled with XWIN_GLX_WINDOWS defined
    
    InitOutput.c: In function ‘XwinExtensionInit’:
    InitOutput.c:170:9: error: implicit declaration of function ‘glxWinPushNativeProvider’ [-Werror=implicit-function-declaration]
             glxWinPushNativeProvider();
             ^
    InitOutput.c:170:9: warning: nested extern declaration of ‘glxWinPushNativeProvider’ [-Wnested-externs]
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>
    Reviewed-by: Colin Harrison <colin.harrison at virgin.net>

diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index b05ca27..9413350 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -58,8 +58,11 @@ typedef WINAPI HRESULT(*SHGETFOLDERPATHPROC) (HWND hwndOwner,
                                               HANDLE hToken,
                                               DWORD dwFlags, LPTSTR pszPath);
 #endif
-
 #include "glx_extinit.h"
+#ifdef XWIN_GLX_WINDOWS
+#include "glx/glwindows.h"
+#endif
+
 /*
  * References to external symbols
  */


More information about the xorg-commit mailing list