xserver: Branch 'master' - 7 commits

Adam Jackson ajax at kemper.freedesktop.org
Tue Aug 22 15:09:08 UTC 2017


 configure.ac                  |    3 ---
 hw/xwin/InitInput.c           |    4 ----
 hw/xwin/InitOutput.c          |   17 -----------------
 hw/xwin/Makefile.am           |   19 ++-----------------
 hw/xwin/glx/Makefile.am       |    8 +++-----
 hw/xwin/glx/indirect.h        |    3 ---
 hw/xwin/glx/meson.build       |    1 -
 hw/xwin/glx/winpriv.c         |    4 ----
 hw/xwin/meson.build           |    4 ----
 hw/xwin/win.h                 |   22 ----------------------
 hw/xwin/winauth.c             |   36 ------------------------------------
 hw/xwin/winblock.c            |    4 ----
 hw/xwin/wincreatewnd.c        |   14 --------------
 hw/xwin/wincursor.c           |    2 --
 hw/xwin/windialogs.c          |    8 --------
 hw/xwin/winengine.c           |    2 --
 hw/xwin/winerror.c            |    4 ----
 hw/xwin/winglobals.c          |    2 --
 hw/xwin/winglobals.h          |    7 -------
 hw/xwin/winkeyhook.c          |    2 --
 hw/xwin/winmultiwindowicons.c |    2 --
 hw/xwin/winprefs.c            |   10 ----------
 hw/xwin/winprocarg.c          |   24 ------------------------
 hw/xwin/winrandr.c            |    2 --
 hw/xwin/winscrinit.c          |   14 +-------------
 hw/xwin/winshadddnl.c         |    2 --
 hw/xwin/winshadgdi.c          |   16 ----------------
 hw/xwin/wintrayicon.c         |    8 --------
 hw/xwin/winvalargs.c          |    9 +--------
 hw/xwin/winwindow.h           |    2 --
 hw/xwin/winwndproc.c          |   16 ----------------
 os/auth.c                     |    4 ++--
 os/mitauth.c                  |    4 ----
 33 files changed, 9 insertions(+), 270 deletions(-)

New commits:
commit 591ac95f73b1c1ea681c45e4da9afa2b1d505abe
Author: Emil Velikov <emil.l.velikov at gmail.com>
Date:   Tue Aug 22 11:48:31 2017 +0100

    xwin: automake: remove unused {SRCS, DEFS}_{NATIVEGDI, PRIMARYFB}
    
    Left over from the following commits:
    
    8465ee788fd xwin: Remove native GDI engine (v2)
    c79f824bf66 xwin: Remove primary DirectDraw engine
    
    v2: drop leading - in the makefile
    
    Cc: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
    Reviewed-by: Jon Turney <jon.turney at dronecode.org.uk> (v1)

diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am
index 8caf82c65..5f67a6eca 100644
--- a/hw/xwin/Makefile.am
+++ b/hw/xwin/Makefile.am
@@ -102,15 +102,11 @@ SRCS =	InitInput.c \
 	$(SRCS_CLIPBOARD) \
 	$(SRCS_MULTIWINDOW) \
 	$(SRCS_MULTIWINDOWEXTWM) \
-	$(SRCS_NATIVEGDI) \
-	$(SRCS_PRIMARYFB) \
 	$(SRCS_RANDR)
 
 DEFS = \
 	$(DEFS_GLX_WINDOWS) \
-	$(DEFS_MULTIWINDOWEXTWM) \
-	$(DEFS_NATIVEGDI) \
-	$(DEFS_PRIMARYFB)
+	$(DEFS_MULTIWINDOWEXTWM)
 
 XWin_SOURCES = $(SRCS)
 
commit 69fe6156ec6cd37657d4e5af1c6f21ebf72b8fd7
Author: Emil Velikov <emil.l.velikov at gmail.com>
Date:   Tue Aug 22 11:48:30 2017 +0100

    xwin: remove always true/set XWIN_RANDR conditional/define
    
    Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
    Reviewed-by: Jon Turney <jon.turney at dronecode.org.uk>

diff --git a/configure.ac b/configure.ac
index 3049041df..eee1257a9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2194,7 +2194,6 @@ AM_CONDITIONAL(XWIN, [test "x$XWIN" = xyes])
 AM_CONDITIONAL(XWIN_MULTIWINDOWEXTWM, [test "x$XWIN" = xyes && test "x$WINDOWSWM" = xyes])
 AM_CONDITIONAL(XWIN_GLX_WINDOWS, [test "x$XWIN" = xyes && test "x$GLX" = xyes])
 AM_CONDITIONAL(XWIN_WINDOWS_DRI, [test "x$XWIN" = xyes && test "x$WINDOWSDRI" = xyes])
-AM_CONDITIONAL(XWIN_RANDR, [test "x$XWIN" = xyes])
 
 dnl Darwin / OS X DDX
 if test "x$XQUARTZ" = xyes; then
diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am
index b20737186..8caf82c65 100644
--- a/hw/xwin/Makefile.am
+++ b/hw/xwin/Makefile.am
@@ -40,11 +40,8 @@ MULTIWINDOWEXTWM_LIBS = $(top_builddir)/miext/rootless/librootless.la
 MULTIWINDOWEXTWM_CFLAGS = -I$(top_srcdir)/miext/rootless
 endif
 
-if XWIN_RANDR
 SRCS_RANDR = \
 	winrandr.c
-DEFS_RANDR = -DXWIN_RANDR
-endif
 
 SRCS =	InitInput.c \
 	InitOutput.c \
@@ -113,8 +110,7 @@ DEFS = \
 	$(DEFS_GLX_WINDOWS) \
 	$(DEFS_MULTIWINDOWEXTWM) \
 	$(DEFS_NATIVEGDI) \
-	$(DEFS_PRIMARYFB) \
-	$(DEFS_RANDR)
+	$(DEFS_PRIMARYFB)
 
 XWin_SOURCES = $(SRCS)
 
diff --git a/hw/xwin/meson.build b/hw/xwin/meson.build
index f71de8301..87fa6c5cb 100644
--- a/hw/xwin/meson.build
+++ b/hw/xwin/meson.build
@@ -17,8 +17,6 @@ endif
 xwin_c_args = []
 xwin_c_args += '-DHAVE_XWIN_CONFIG_H'
 xwin_c_args += '-Wno-bad-function-cast'
-# XXX: these conditionals are always on and can be removed
-xwin_c_args += '-DXWIN_RANDR'
 
 srcs_windows = [
     'winclipboardinit.c',
commit 8f1a200d0be261a60bb9e8e72d8704cef2d91cd4
Author: Emil Velikov <emil.l.velikov at gmail.com>
Date:   Tue Aug 22 11:48:29 2017 +0100

    xwin: remove always true/set XWIN_MULTIWINDOW conditional/define
    
    v2: drop trailing endif (Jon)
    
    Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
    Reviewed-by: Jon Turney <jon.turney at dronecode.org.uk>

diff --git a/configure.ac b/configure.ac
index 920815bf8..3049041df 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2191,7 +2191,6 @@ dnl XWin requires OpenGL spec files in order to generate wrapper code for native
 
 fi
 AM_CONDITIONAL(XWIN, [test "x$XWIN" = xyes])
-AM_CONDITIONAL(XWIN_MULTIWINDOW, [test "x$XWIN" = xyes])
 AM_CONDITIONAL(XWIN_MULTIWINDOWEXTWM, [test "x$XWIN" = xyes && test "x$WINDOWSWM" = xyes])
 AM_CONDITIONAL(XWIN_GLX_WINDOWS, [test "x$XWIN" = xyes && test "x$GLX" = xyes])
 AM_CONDITIONAL(XWIN_WINDOWS_DRI, [test "x$XWIN" = xyes && test "x$WINDOWSDRI" = xyes])
diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index 7a25a464c..168c47fc4 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -190,13 +190,11 @@ ddxGiveUp(enum ExitCode error)
             winDeleteNotifyIcon(winGetScreenPriv(g_ScreenInfo[i].pScreen));
     }
 
-#ifdef XWIN_MULTIWINDOW
     /* Unload libraries for taskbar grouping */
     winPropertyStoreDestroy();
 
     /* Notify the worker threads we're exiting */
     winDeinitMultiWindowWM();
-#endif
 
 #ifdef HAS_DEVWINDOWS
     /* Close our handle to our message queue */
@@ -787,9 +785,7 @@ winUseMsg(void)
            "\tUse the entire virtual screen if multiple\n"
            "\tmonitors are present.\n");
 
-#ifdef XWIN_MULTIWINDOW
     ErrorF("-multiwindow\n" "\tRun the server in multi-window mode.\n");
-#endif
 
 #ifdef XWIN_MULTIWINDOWEXTWM
     ErrorF("-mwextwm\n"
@@ -948,10 +944,8 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[])
 
     /* Detect supported engines */
     winDetectSupportedEngines();
-#ifdef XWIN_MULTIWINDOW
     /* Load libraries for taskbar grouping */
     winPropertyStoreInit();
-#endif
 
     /* Store the instance handle */
     g_hInstance = GetModuleHandle(NULL);
diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am
index b83b28d84..b20737186 100644
--- a/hw/xwin/Makefile.am
+++ b/hw/xwin/Makefile.am
@@ -20,7 +20,6 @@ XWIN_GLX_LIBS += $(top_builddir)/hw/xwin/glx/libXwinGLX.la
 XWIN_GLX_SYS_LIBS = -lopengl32
 endif
 
-if XWIN_MULTIWINDOW
 SRCS_MULTIWINDOW = \
 	winmultiwindowshape.c \
 	winmultiwindowwindow.c \
@@ -28,9 +27,7 @@ SRCS_MULTIWINDOW = \
 	winmultiwindowwndproc.c \
 	propertystore.h \
 	winSetAppUserModelID.c
-DEFS_MULTIWINDOW = -DXWIN_MULTIWINDOW
 MULTIWINDOW_SYS_LIBS = -lshlwapi -lole32
-endif
 
 if XWIN_MULTIWINDOWEXTWM
 SRCS_MULTIWINDOWEXTWM = \
@@ -114,7 +111,6 @@ SRCS =	InitInput.c \
 
 DEFS = \
 	$(DEFS_GLX_WINDOWS) \
-	$(DEFS_MULTIWINDOW) \
 	$(DEFS_MULTIWINDOWEXTWM) \
 	$(DEFS_NATIVEGDI) \
 	$(DEFS_PRIMARYFB) \
diff --git a/hw/xwin/glx/Makefile.am b/hw/xwin/glx/Makefile.am
index 599ec37cc..f19995086 100644
--- a/hw/xwin/glx/Makefile.am
+++ b/hw/xwin/glx/Makefile.am
@@ -20,10 +20,6 @@ endif
 libnativeGLthunk_la_SOURCES = \
 	glthunk.c
 
-if XWIN_MULTIWINDOW
-DEFS_MULTIWINDOW = -DXWIN_MULTIWINDOW
-endif
-
 if XWIN_MULTIWINDOWEXTWM
 DEFS_MULTIWINDOWEXTWM = -DXWIN_MULTIWINDOWEXTWM
 endif
@@ -32,7 +28,9 @@ if XWIN_GLX_WINDOWS
 DEFS_GLX_WINDOWS = -DXWIN_GLX_WINDOWS
 endif
 
-DEFS =  $(DEFS_MULTIWINDOW) $(DEFS_MULTIWINDOWEXTWM) $(DEFS_GLX_WINDOWS)
+DEFS = \
+	$(DEFS_MULTIWINDOWEXTWM) \
+	$(DEFS_GLX_WINDOWS)
 
 AM_CPPFLAGS = -I$(top_srcdir)/miext/rootless
 
diff --git a/hw/xwin/glx/meson.build b/hw/xwin/glx/meson.build
index 77ffeda28..7843a5f00 100644
--- a/hw/xwin/glx/meson.build
+++ b/hw/xwin/glx/meson.build
@@ -63,7 +63,6 @@ endif
 
 xwin_glx_c_args = []
 xwin_glx_c_args += '-DHAVE_XWIN_CONFIG_H'
-xwin_glx_c_args += '-DXWIN_MULTIWINDOW'
 xwin_glx_c_args += '-DXWIN_GLX_WINDOWS'
 
 xwin_glx = static_library(
diff --git a/hw/xwin/glx/winpriv.c b/hw/xwin/glx/winpriv.c
index c98ad9099..8ed93aba3 100644
--- a/hw/xwin/glx/winpriv.c
+++ b/hw/xwin/glx/winpriv.c
@@ -39,7 +39,6 @@ winGetWindowInfo(WindowPtr pWin)
         hwnd = pWinScreen->hwndScreen;
 
         pScreenInfo = pWinScreen->pScreenInfo;
-#ifdef XWIN_MULTIWINDOW
         /* check for multiwindow mode */
         if (pScreenInfo->fMultiWindow) {
             winWindowPriv(pWin);
@@ -64,7 +63,6 @@ winGetWindowInfo(WindowPtr pWin)
 
             return hwnd;
         }
-#endif
 #ifdef XWIN_MULTIWINDOWEXTWM
         /* check for multiwindow external wm mode */
         if (pScreenInfo->fMWExtWM) {
@@ -107,10 +105,8 @@ winCheckScreenAiglxIsSupported(ScreenPtr pScreen)
     winPrivScreenPtr pWinScreen = winGetScreenPriv(pScreen);
     winScreenInfoPtr pScreenInfo = pWinScreen->pScreenInfo;
 
-#ifdef XWIN_MULTIWINDOW
     if (pScreenInfo->fMultiWindow)
         return TRUE;
-#endif
 
 #ifdef XWIN_MULTIWINDOWEXTWM
     if (pScreenInfo->fMWExtWM)
diff --git a/hw/xwin/meson.build b/hw/xwin/meson.build
index eef4fee0d..f71de8301 100644
--- a/hw/xwin/meson.build
+++ b/hw/xwin/meson.build
@@ -18,7 +18,6 @@ xwin_c_args = []
 xwin_c_args += '-DHAVE_XWIN_CONFIG_H'
 xwin_c_args += '-Wno-bad-function-cast'
 # XXX: these conditionals are always on and can be removed
-xwin_c_args += '-DXWIN_MULTIWINDOW'
 xwin_c_args += '-DXWIN_RANDR'
 
 srcs_windows = [
diff --git a/hw/xwin/win.h b/hw/xwin/win.h
index 6ae242375..dda2cb548 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -394,12 +394,8 @@ typedef struct {
     Bool fMWExtWM;
 #endif
     Bool fRootless;
-#ifdef XWIN_MULTIWINDOW
     Bool fMultiWindow;
-#endif
-#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM)
     Bool fMultiMonitorOverride;
-#endif
     Bool fMultipleMonitors;
     Bool fLessPointer;
     winResizeMode iResizeMode;
@@ -474,17 +470,13 @@ typedef struct _winPrivScreenRec {
     Bool fRestacking;
 #endif
 
-#ifdef XWIN_MULTIWINDOW
     /* Privates used by multi-window */
     pthread_t ptWMProc;
     pthread_t ptXMsgProc;
     void *pWMInfo;
-#endif
 
-#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM)
     /* Privates used by both multi-window and rootless */
     Bool fRootWindowShown;
-#endif
 
     /* Privates used for any module running in a seperate thread */
     pthread_mutex_t pmServerStarted;
@@ -924,7 +916,6 @@ Bool
 void
  winSetShapeRootless(WindowPtr pWindow, int kind);
 
-#ifdef XWIN_MULTIWINDOW
 /*
  * winmultiwindowshape.c
  */
@@ -937,9 +928,7 @@ void
 
 void
  winUpdateRgnMultiWindow(WindowPtr pWindow);
-#endif
 
-#ifdef XWIN_MULTIWINDOW
 /*
  * winmultiwindowwindow.c
  */
@@ -990,16 +979,13 @@ XID
 
 int
  winAdjustXWindow(WindowPtr pWin, HWND hwnd);
-#endif
 
-#ifdef XWIN_MULTIWINDOW
 /*
  * winmultiwindowwndproc.c
  */
 
 LRESULT CALLBACK
 winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
-#endif
 
 /*
  * wintrayicon.c
diff --git a/hw/xwin/wincreatewnd.c b/hw/xwin/wincreatewnd.c
index e6e587f9f..daa6daac9 100644
--- a/hw/xwin/wincreatewnd.c
+++ b/hw/xwin/wincreatewnd.c
@@ -156,9 +156,7 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen)
         && !pScreenInfo->fMWExtWM
 #endif
         && !pScreenInfo->fRootless
-#ifdef XWIN_MULTIWINDOW
         && !pScreenInfo->fMultiWindow
-#endif
         ) {
         /* Try to handle startup via run.exe. run.exe instructs Windows to
          * hide all created windows. Detect this case and make sure the
@@ -220,9 +218,7 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen)
          || pScreenInfo->fMWExtWM
 #endif
          || pScreenInfo->fRootless
-#ifdef XWIN_MULTIWINDOW
          || pScreenInfo->fMultiWindow
-#endif
         )
         && (pScreenInfo->iResizeMode == resizeWithScrollbars)) {
         /* We cannot have scrollbars if we do not have a window border */
@@ -243,9 +239,7 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen)
             && !pScreenInfo->fMWExtWM
 #endif
             && !pScreenInfo->fRootless
-#ifdef XWIN_MULTIWINDOW
             && !pScreenInfo->fMultiWindow
-#endif
             ) {
 #if CYGDEBUG
             winDebug
@@ -293,9 +287,7 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen)
 #ifdef XWIN_MULTIWINDOWEXTWM
         && !pScreenInfo->fMWExtWM
 #endif
-#ifdef XWIN_MULTIWINDOW
         && !pScreenInfo->fMultiWindow
-#endif
         ) {
         /* Trim window width to fit work area */
         if (iWidth > (rcWorkArea.right - rcWorkArea.left))
@@ -430,13 +422,9 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen)
 #ifdef XWIN_MULTIWINDOWEXTWM
         || pScreenInfo->fMWExtWM
 #endif
-#ifdef XWIN_MULTIWINDOW
         || pScreenInfo->fMultiWindow
-#endif
         ) {
-#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM)
         pScreenPriv->fRootWindowShown = FALSE;
-#endif
         ShowWindow(*phwnd, SW_HIDE);
     }
     else
@@ -452,9 +440,7 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen)
         && !pScreenInfo->fMWExtWM
 #endif
         && !pScreenInfo->fRootless
-#ifdef XWIN_MULTIWINDOW
         && !pScreenInfo->fMultiWindow
-#endif
         ) {
         if (!BringWindowToTop(*phwnd)) {
             ErrorF("winCreateBoundingWindowWindowed - BringWindowToTop () "
diff --git a/hw/xwin/wincursor.c b/hw/xwin/wincursor.c
index bddd6b7ed..2afcf9fb5 100644
--- a/hw/xwin/wincursor.c
+++ b/hw/xwin/wincursor.c
@@ -95,9 +95,7 @@ winPointerWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
      */
     if ((pScreenPriv->hwndScreen == GetForegroundWindow())
         || pScreenPriv->pScreenInfo->fRootless
-#ifdef XWIN_MULTIWINDOW
         || pScreenPriv->pScreenInfo->fMultiWindow
-#endif
         ) {
         /* Get the client area coordinates */
         GetClientRect(pScreenPriv->hwndScreen, &rcClient);
diff --git a/hw/xwin/windialogs.c b/hw/xwin/windialogs.c
index c7668e6a9..26b2ebd2c 100644
--- a/hw/xwin/windialogs.c
+++ b/hw/xwin/windialogs.c
@@ -201,18 +201,14 @@ winInitDialog(HWND hwndDlg)
                      0, 0, SWP_NOSIZE | SWP_FRAMECHANGED);
     }
 
-#ifdef XWIN_MULTIWINDOW
     if (g_hIconX)
         hIcon = g_hIconX;
     else
-#endif
         hIcon = LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_XWIN));
 
-#ifdef XWIN_MULTIWINDOW
     if (g_hSmallIconX)
         hIconSmall = g_hSmallIconX;
     else
-#endif
         hIconSmall = LoadImage(g_hInstance,
                                MAKEINTRESOURCE(IDI_XWIN), IMAGE_ICON,
                                GetSystemMetrics(SM_CXSMICON),
@@ -236,11 +232,9 @@ winDisplayExitDialog(winPrivScreenPtr pScreenPriv)
     for (i = 1; i < currentMaxClients; i++)
         if (clients[i] != NullClient)
             liveClients++;
-#if defined(XWIN_MULTIWINDOW)
     /* Count down server internal clients */
     if (pScreenPriv->pScreenInfo->fMultiWindow)
         liveClients -= 2;       /* multiwindow window manager & XMsgProc  */
-#endif
     if (g_fClipboardStarted)
         liveClients--;          /* clipboard manager */
 
diff --git a/hw/xwin/winengine.c b/hw/xwin/winengine.c
index d816851e2..2336442c0 100644
--- a/hw/xwin/winengine.c
+++ b/hw/xwin/winengine.c
@@ -150,9 +150,7 @@ winSetEngine(ScreenPtr pScreen)
 #ifdef XWIN_MULTIWINDOWEXTWM
         || pScreenInfo->fMWExtWM
 #endif
-#ifdef XWIN_MULTIWINDOW
         || pScreenInfo->fMultiWindow
-#endif
         ) {
         winErrorFVerb(2,
                       "winSetEngine - Multi Window or Rootless => ShadowGDI\n");
diff --git a/hw/xwin/winglobals.h b/hw/xwin/winglobals.h
index d05330617..250085fbc 100644
--- a/hw/xwin/winglobals.h
+++ b/hw/xwin/winglobals.h
@@ -74,14 +74,10 @@ extern Bool g_fClipboard;
 extern Bool g_fClipboardStarted;
 
 /* The global X default icons */
-#if defined(XWIN_MULTIWINDOW)
 extern HICON g_hIconX;
 extern HICON g_hSmallIconX;
-#endif
 
-#ifdef XWIN_MULTIWINDOW
 extern DWORD g_dwCurrentThreadID;
-#endif
 
 extern Bool g_fKeyboardHookLL;
 extern Bool g_fButton[3];
diff --git a/hw/xwin/winkeyhook.c b/hw/xwin/winkeyhook.c
index 66d68f63d..bb99c3e25 100644
--- a/hw/xwin/winkeyhook.c
+++ b/hw/xwin/winkeyhook.c
@@ -61,7 +61,6 @@ winKeyboardMessageHookLL(int iCode, WPARAM wParam, LPARAM lParam)
     PKBDLLHOOKSTRUCT p = (PKBDLLHOOKSTRUCT) lParam;
     HWND hwnd = GetActiveWindow();
 
-#ifdef XWIN_MULTIWINDOW
     WindowPtr pWin = NULL;
     winPrivWinPtr pWinPriv = NULL;
     winPrivScreenPtr pScreenPriv = NULL;
@@ -79,7 +78,6 @@ winKeyboardMessageHookLL(int iCode, WPARAM wParam, LPARAM lParam)
         if (pScreenInfo->fMultiWindow)
             fPassAltTab = FALSE;
     }
-#endif
 
     /* Pass keystrokes on to our main message loop */
     if (iCode == HC_ACTION) {
diff --git a/hw/xwin/winmultiwindowicons.c b/hw/xwin/winmultiwindowicons.c
index 050795123..c43c29887 100644
--- a/hw/xwin/winmultiwindowicons.c
+++ b/hw/xwin/winmultiwindowicons.c
@@ -581,7 +581,6 @@ winXIconToHICON(xcb_connection_t *conn, xcb_window_t id, int iconSize)
  * Change the Windows window icon
  */
 
-#ifdef XWIN_MULTIWINDOW
 void
 winUpdateIcon(HWND hWnd, xcb_connection_t *conn, Window id, HICON hIconNew)
 {
@@ -671,4 +670,3 @@ winDestroyIcon(HICON hIcon)
         hIcon != g_hSmallIconX && !winIconIsOverride(hIcon))
         DestroyIcon(hIcon);
 }
-#endif
diff --git a/hw/xwin/winprefs.c b/hw/xwin/winprefs.c
index 65115ec5b..0ac5b4fea 100644
--- a/hw/xwin/winprefs.c
+++ b/hw/xwin/winprefs.c
@@ -138,7 +138,6 @@ MakeMenu(char *name, HMENU editMenu, int editItem)
     return hmenu;
 }
 
-#ifdef XWIN_MULTIWINDOW
 /*
  * Callback routine that is executed once per window class.
  * Removes or creates custom window settings depending on LPARAM
@@ -197,7 +196,6 @@ ReloadEnumWindowsProc(HWND hwnd, LPARAM lParam)
 
     return TRUE;
 }
-#endif
 
 /*
  * Removes any custom icons in classes, custom menus, etc.
@@ -210,7 +208,6 @@ ReloadPrefs(winPrivScreenPtr pScreenPriv)
 {
     int i;
 
-#ifdef XWIN_MULTIWINDOW
     winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
 
     /* First, iterate over all windows, deleting their icons and custom menus.
@@ -221,7 +218,6 @@ ReloadPrefs(winPrivScreenPtr pScreenPriv)
      */
     if (pScreenInfo->fMultiWindow)
         EnumThreadWindows(g_dwCurrentThreadID, ReloadEnumWindowsProc, FALSE);
-#endif
 
     /* Now, free/clear all info from our prefs structure */
     for (i = 0; i < pref.menuItems; i++)
@@ -264,14 +260,12 @@ ReloadPrefs(winPrivScreenPtr pScreenPriv)
     g_hIconX = NULL;
     g_hSmallIconX = NULL;
 
-#ifdef XWIN_MULTIWINDOW
     if (pScreenInfo->fMultiWindow) {
         winInitGlobalIcons();
 
         /* Rebuild the icons and menus */
         EnumThreadWindows(g_dwCurrentThreadID, ReloadEnumWindowsProc, TRUE);
     }
-#endif
 
     /* Whew, done */
 }
@@ -385,14 +379,12 @@ HandleCustomWM_COMMAND(HWND hwnd, WORD command, winPrivScreenPtr pScreenPriv)
                         SetWindowPos(hwnd,
                                      HWND_TOPMOST,
                                      0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
-#if XWIN_MULTIWINDOW
                     {
                         winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
                         if (pScreenInfo->fMultiWindow)
                             /* Reflect the changed Z order */
                             winReorderWindowsMultiWindow();
                     }
-#endif
                     return TRUE;
 
                 case CMD_RELOAD:
@@ -409,7 +401,6 @@ HandleCustomWM_COMMAND(HWND hwnd, WORD command, winPrivScreenPtr pScreenPriv)
     return FALSE;
 }
 
-#ifdef XWIN_MULTIWINDOW
 /*
  * Add the default or a custom menu depending on the class match
  */
@@ -459,7 +450,6 @@ SetupSysMenu(HWND hwnd)
             MakeMenu(pref.defaultSysMenuName, sys, -1);
     }
 }
-#endif
 
 /*
  * Possibly add a menu to the toolbar icon
diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c
index 64d07cc6e..803e78f93 100644
--- a/hw/xwin/winprocarg.c
+++ b/hw/xwin/winprocarg.c
@@ -130,12 +130,8 @@ winInitializeScreenDefaults(void)
     defaultScreenInfo.fMWExtWM = FALSE;
 #endif
     defaultScreenInfo.fRootless = FALSE;
-#ifdef XWIN_MULTIWINDOW
     defaultScreenInfo.fMultiWindow = FALSE;
-#endif
-#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM)
     defaultScreenInfo.fMultiMonitorOverride = FALSE;
-#endif
     defaultScreenInfo.fMultipleMonitors = FALSE;
     defaultScreenInfo.fLessPointer = FALSE;
     defaultScreenInfo.iResizeMode = resizeDefault;
@@ -524,10 +520,8 @@ ddxProcessArgument(int argc, char *argv[], int i)
      * Look for the '-fullscreen' argument
      */
     if (IS_OPTION("-fullscreen")) {
-#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM)
         if (!screenInfoPtr->fMultiMonitorOverride)
             screenInfoPtr->fMultipleMonitors = FALSE;
-#endif
         screenInfoPtr->fFullScreen = TRUE;
 
         /* Indicate that we have processed this argument */
@@ -548,10 +542,8 @@ ddxProcessArgument(int argc, char *argv[], int i)
      * Look for the '-nodecoration' argument
      */
     if (IS_OPTION("-nodecoration")) {
-#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM)
         if (!screenInfoPtr->fMultiMonitorOverride)
             screenInfoPtr->fMultipleMonitors = FALSE;
-#endif
         screenInfoPtr->fDecoration = FALSE;
 
         /* Indicate that we have processed this argument */
@@ -585,40 +577,32 @@ ddxProcessArgument(int argc, char *argv[], int i)
      * Look for the '-rootless' argument
      */
     if (IS_OPTION("-rootless")) {
-#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM)
         if (!screenInfoPtr->fMultiMonitorOverride)
             screenInfoPtr->fMultipleMonitors = FALSE;
-#endif
         screenInfoPtr->fRootless = TRUE;
 
         /* Indicate that we have processed this argument */
         return 1;
     }
 
-#ifdef XWIN_MULTIWINDOW
     /*
      * Look for the '-multiwindow' argument
      */
     if (IS_OPTION("-multiwindow")) {
-#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM)
         if (!screenInfoPtr->fMultiMonitorOverride)
             screenInfoPtr->fMultipleMonitors = TRUE;
-#endif
         screenInfoPtr->fMultiWindow = TRUE;
 
         /* Indicate that we have processed this argument */
         return 1;
     }
-#endif
 
     /*
      * Look for the '-multiplemonitors' argument
      */
     if (IS_OPTION("-multiplemonitors")
         || IS_OPTION("-multimonitors")) {
-#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM)
         screenInfoPtr->fMultiMonitorOverride = TRUE;
-#endif
         screenInfoPtr->fMultipleMonitors = TRUE;
 
         /* Indicate that we have processed this argument */
@@ -630,9 +614,7 @@ ddxProcessArgument(int argc, char *argv[], int i)
      */
     if (IS_OPTION("-nomultiplemonitors")
         || IS_OPTION("-nomultimonitors")) {
-#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM)
         screenInfoPtr->fMultiMonitorOverride = TRUE;
-#endif
         screenInfoPtr->fMultipleMonitors = FALSE;
 
         /* Indicate that we have processed this argument */
diff --git a/hw/xwin/winrandr.c b/hw/xwin/winrandr.c
index 1560199c1..3e084221e 100644
--- a/hw/xwin/winrandr.c
+++ b/hw/xwin/winrandr.c
@@ -174,9 +174,7 @@ winRandRScreenSetSize(ScreenPtr pScreen,
         || pScreenInfo->fMWExtWM
 #endif
         || pScreenInfo->fRootless
-#ifdef XWIN_MULTIWINDOW
         || pScreenInfo->fMultiWindow
-#endif
         ) {
         ErrorF
             ("winRandRScreenSetSize - resize not supported in rootless modes\n");
diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c
index acdd49e6d..a44e21fbd 100644
--- a/hw/xwin/winscrinit.c
+++ b/hw/xwin/winscrinit.c
@@ -453,7 +453,6 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv)
 #undef WRAP
     }
 
-#ifdef XWIN_MULTIWINDOW
     /* Handle multi window mode */
     else if (pScreenInfo->fMultiWindow) {
         /* Define the WRAP macro temporarily for local use */
@@ -496,7 +495,6 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv)
         /* Undefine the WRAP macro, as it is not needed elsewhere */
 #undef WRAP
     }
-#endif
 
     /* Wrap either fb's or shadow's CloseScreen with our CloseScreen */
     pScreenPriv->CloseScreen = pScreen->CloseScreen;
@@ -525,12 +523,7 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv)
     pScreenPriv->fRestacking = FALSE;
 #endif
 
-#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM)
-    if (FALSE
-#ifdef XWIN_MULTIWINDOW
-        || pScreenInfo->fMultiWindow
-#endif
-        ) {
+    if (pScreenInfo->fMultiWindow) {
 #if CYGDEBUG || YES
         winDebug("winFinishScreenInitFB - Calling winInitWM.\n");
 #endif
@@ -546,7 +539,6 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv)
             return FALSE;
         }
     }
-#endif
 
     /* Tell the server that we are enabled */
     pScreenPriv->fEnabled = TRUE;
diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c
index 770942ad7..6d7ebce07 100644
--- a/hw/xwin/winshadgdi.c
+++ b/hw/xwin/winshadgdi.c
@@ -37,11 +37,9 @@
  * Local function prototypes
  */
 
-#ifdef XWIN_MULTIWINDOW
 static wBOOL CALLBACK winRedrawAllProcShadowGDI(HWND hwnd, LPARAM lParam);
 
 static wBOOL CALLBACK winRedrawDamagedWindowShadowGDI(HWND hwnd, LPARAM lParam);
-#endif
 
 static Bool
  winAllocateFBShadowGDI(ScreenPtr pScreen);
@@ -263,7 +261,6 @@ winQueryRGBBitsAndMasks(ScreenPtr pScreen)
     return fReturn;
 }
 
-#ifdef XWIN_MULTIWINDOW
 /*
  * Redraw all ---?
  */
@@ -309,7 +306,6 @@ winRedrawDamagedWindowShadowGDI(HWND hwnd, LPARAM lParam)
     }
     return TRUE;
 }
-#endif
 
 /*
  * Allocate a DIB for the shadow framebuffer GDI server
@@ -403,11 +399,9 @@ winAllocateFBShadowGDI(ScreenPtr pScreen)
              (int) pScreenInfo->dwStride);
 #endif
 
-#ifdef XWIN_MULTIWINDOW
     /* Redraw all windows */
     if (pScreenInfo->fMultiWindow)
         EnumThreadWindows(g_dwCurrentThreadID, winRedrawAllProcShadowGDI, 0);
-#endif
 
     return fReturn;
 }
@@ -525,13 +519,11 @@ winShadowUpdateGDI(ScreenPtr pScreen, shadowBufPtr pBuf)
         SelectClipRgn(pScreenPriv->hdcScreen, NULL);
     }
 
-#ifdef XWIN_MULTIWINDOW
     /* Redraw all multiwindow windows */
     if (pScreenInfo->fMultiWindow)
         EnumThreadWindows(g_dwCurrentThreadID,
                           winRedrawDamagedWindowShadowGDI,
                           (LPARAM) pBoxExtents);
-#endif
 }
 
 static Bool
@@ -776,12 +768,10 @@ winBltExposedRegionsShadowGDI(ScreenPtr pScreen)
     /* EndPaint frees the DC */
     EndPaint(pScreenPriv->hwndScreen, &ps);
 
-#ifdef XWIN_MULTIWINDOW
     /* Redraw all windows */
     if (pScreenInfo->fMultiWindow)
         EnumThreadWindows(g_dwCurrentThreadID, winRedrawAllProcShadowGDI,
                           (LPARAM) pScreenPriv->hwndScreen);
-#endif
 
     return TRUE;
 }
@@ -845,11 +835,9 @@ winRedrawScreenShadowGDI(ScreenPtr pScreen)
            pScreenInfo->dwWidth, pScreenInfo->dwHeight,
            pScreenPriv->hdcShadow, 0, 0, SRCCOPY);
 
-#ifdef XWIN_MULTIWINDOW
     /* Redraw all windows */
     if (pScreenInfo->fMultiWindow)
         EnumThreadWindows(g_dwCurrentThreadID, winRedrawAllProcShadowGDI, 0);
-#endif
 
     return TRUE;
 }
@@ -944,11 +932,9 @@ winInstallColormapShadowGDI(ColormapPtr pColormap)
     /* Save a pointer to the newly installed colormap */
     pScreenPriv->pcmapInstalled = pColormap;
 
-#ifdef XWIN_MULTIWINDOW
     /* Redraw all windows */
     if (pScreenInfo->fMultiWindow)
         EnumThreadWindows(g_dwCurrentThreadID, winRedrawAllProcShadowGDI, 0);
-#endif
 
     return TRUE;
 }
diff --git a/hw/xwin/wintrayicon.c b/hw/xwin/wintrayicon.c
index 1511fc1f2..a22ca24f2 100644
--- a/hw/xwin/wintrayicon.c
+++ b/hw/xwin/wintrayicon.c
@@ -109,9 +109,7 @@ LRESULT
 winHandleIconMessage(HWND hwnd, UINT message,
                      WPARAM wParam, LPARAM lParam, winPrivScreenPtr pScreenPriv)
 {
-#if defined(XWIN_MULTIWINDOWEXTWM) || defined(XWIN_MULTIWINDOW)
     winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
-#endif
 
     switch (lParam) {
     case WM_LBUTTONUP:
@@ -146,7 +144,6 @@ winHandleIconMessage(HWND hwnd, UINT message,
         /* Get actual tray icon menu */
         hmenuTray = GetSubMenu(hmenuPopup, 0);
 
-#ifdef XWIN_MULTIWINDOW
         /* Check for MultiWindow mode */
         if (pScreenInfo->fMultiWindow) {
             MENUITEMINFO mii = { 0 };
@@ -166,7 +163,6 @@ winHandleIconMessage(HWND hwnd, UINT message,
             SetMenuItemInfo(hmenuTray, ID_APP_HIDE_ROOT, FALSE, &mii);
         }
         else
-#endif
         {
             /* Remove Hide Root Window button */
             RemoveMenu(hmenuTray, ID_APP_HIDE_ROOT, MF_BYCOMMAND);
diff --git a/hw/xwin/winvalargs.c b/hw/xwin/winvalargs.c
index f93872419..50587d4b3 100644
--- a/hw/xwin/winvalargs.c
+++ b/hw/xwin/winvalargs.c
@@ -86,10 +86,8 @@ winValidateArgs(void)
             int iCount = 0;
 
             /* Count conflicting options */
-#ifdef XWIN_MULTIWINDOW
             if (g_ScreenInfo[i].fMultiWindow)
                 ++iCount;
-#endif
 #ifdef XWIN_MULTIWINDOWEXTWM
             if (g_ScreenInfo[i].fMWExtWM)
                 ++iCount;
@@ -112,10 +110,9 @@ winValidateArgs(void)
         /* Check for -multiwindow or -mwextwm and Xdmcp */
         /* allow xdmcp if screen 0 is normal. */
         if (g_fXdmcpEnabled && !fHasNormalScreen0 && (FALSE
-#ifdef XWIN_MULTIWINDOW
                                                       || g_ScreenInfo[i].
                                                       fMultiWindow
-#endif
+
 #ifdef XWIN_MULTIWINDOWEXTWM
                                                       || g_ScreenInfo[i].
                                                       fMWExtWM
@@ -129,9 +126,7 @@ winValidateArgs(void)
 
         /* Check for -multiwindow, -mwextwm, or -rootless and -fullscreen */
         if (g_ScreenInfo[i].fFullScreen && (FALSE
-#ifdef XWIN_MULTIWINDOW
                                             || g_ScreenInfo[i].fMultiWindow
-#endif
 #ifdef XWIN_MULTIWINDOWEXTWM
                                             || g_ScreenInfo[i].fMWExtWM
 #endif
@@ -144,9 +139,7 @@ winValidateArgs(void)
 
         /* Check for -multiwindow, -mwextwm, or -rootless and -nodecoration */
         if (!g_ScreenInfo[i].fDecoration && (FALSE
-#ifdef XWIN_MULTIWINDOW
                                             || g_ScreenInfo[i].fMultiWindow
-#endif
 #ifdef XWIN_MULTIWINDOWEXTWM
                                             || g_ScreenInfo[i].fMWExtWM
 #endif
diff --git a/hw/xwin/winwindow.h b/hw/xwin/winwindow.h
index 65e4bea0c..959ce152a 100644
--- a/hw/xwin/winwindow.h
+++ b/hw/xwin/winwindow.h
@@ -84,7 +84,6 @@ typedef struct {
 #endif
 } winPrivWinRec, *winPrivWinPtr;
 
-#ifdef XWIN_MULTIWINDOW
 typedef struct _winWMMessageRec {
     DWORD dwID;
     DWORD msg;
@@ -162,5 +161,4 @@ void
 void
  winShowWindowOnTaskbar(HWND hWnd, Bool show);
 
-#endif                          /* XWIN_MULTIWINDOW */
 #endif
diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c
index 538430c13..02186b13e 100644
--- a/hw/xwin/winwndproc.c
+++ b/hw/xwin/winwndproc.c
@@ -229,11 +229,9 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
                                                                     ||
                                                                     s_pScreenInfo->
                                                                     fRootless
-#ifdef XWIN_MULTIWINDOW
                                                                     ||
                                                                     s_pScreenInfo->
                                                                     fMultiWindow
-#endif
                 )) {
                 DWORD dwWidth = 0, dwHeight = 0;
 
@@ -321,9 +319,7 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
             || s_pScreenInfo->fMWExtWM
 #endif
             || s_pScreenInfo->fRootless
-#ifdef XWIN_MULTIWINDOW
             || s_pScreenInfo->fMultiWindow
-#endif
             || s_pScreenInfo->fFullScreen)
             break;
 
@@ -624,9 +620,7 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
             || s_pScreenInfo->fMWExtWM
 #endif
             || s_pScreenInfo->fRootless
-#ifdef XWIN_MULTIWINDOW
             || s_pScreenInfo->fMultiWindow
-#endif
             )
             break;
 
@@ -1189,7 +1183,6 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
             winDisplayExitDialog(s_pScreenPriv);
             return 0;
 
-#ifdef XWIN_MULTIWINDOW
         case ID_APP_HIDE_ROOT:
             if (s_pScreenPriv->fRootWindowShown)
                 ShowWindow(s_pScreenPriv->hwndScreen, SW_HIDE);
@@ -1197,7 +1190,6 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
                 ShowWindow(s_pScreenPriv->hwndScreen, SW_SHOW);
             s_pScreenPriv->fRootWindowShown = !s_pScreenPriv->fRootWindowShown;
             return 0;
-#endif
 
         case ID_APP_MONITOR_PRIMARY:
             fPrimarySelection = !fPrimarySelection;
@@ -1217,10 +1209,8 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
     case WM_GIVEUP:
         /* Tell X that we are giving up */
-#ifdef XWIN_MULTIWINDOW
         if (s_pScreenInfo->fMultiWindow)
             winDeinitMultiWindowWM();
-#endif
         GiveUp(0);
         return 0;
 
commit 9d00f6190a8e5cc4ebda9b315d7c0a0782b58501
Author: Emil Velikov <emil.l.velikov at gmail.com>
Date:   Tue Aug 22 11:48:28 2017 +0100

    xwin: remove always true/set XWIN_CLIPBOARD conditional/define
    
    v2: drop trailing endif (Jon)
    
    Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
    Reviewed-by: Jon Turney <jon.turney at dronecode.org.uk>

diff --git a/configure.ac b/configure.ac
index 8d3c3b55b..920815bf8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2193,7 +2193,6 @@ fi
 AM_CONDITIONAL(XWIN, [test "x$XWIN" = xyes])
 AM_CONDITIONAL(XWIN_MULTIWINDOW, [test "x$XWIN" = xyes])
 AM_CONDITIONAL(XWIN_MULTIWINDOWEXTWM, [test "x$XWIN" = xyes && test "x$WINDOWSWM" = xyes])
-AM_CONDITIONAL(XWIN_CLIPBOARD, [test "x$XWIN" = xyes])
 AM_CONDITIONAL(XWIN_GLX_WINDOWS, [test "x$XWIN" = xyes && test "x$GLX" = xyes])
 AM_CONDITIONAL(XWIN_WINDOWS_DRI, [test "x$XWIN" = xyes && test "x$WINDOWSDRI" = xyes])
 AM_CONDITIONAL(XWIN_RANDR, [test "x$XWIN" = xyes])
diff --git a/hw/xwin/InitInput.c b/hw/xwin/InitInput.c
index ae837e8c5..f121d055e 100644
--- a/hw/xwin/InitInput.c
+++ b/hw/xwin/InitInput.c
@@ -37,9 +37,7 @@
  * Local function prototypes
  */
 
-#ifdef XWIN_CLIPBOARD
 int winProcEstablishConnection(ClientPtr /* client */ );
-#endif
 
 /*
  * Local global declarations
@@ -109,7 +107,6 @@ InitInput(int argc, char *argv[])
     winDebug("InitInput\n");
 #endif
 
-#ifdef XWIN_CLIPBOARD
     /*
      * Wrap some functions at every generation of the server.
      */
@@ -117,7 +114,6 @@ InitInput(int argc, char *argv[])
         winProcEstablishConnectionOrig = InitialVector[2];
         InitialVector[2] = winProcEstablishConnection;
     }
-#endif
 
     if (AllocDevicePair(serverClient, "Windows",
                         &g_pwinPointer, &g_pwinKeyboard,
diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index edd526647..7a25a464c 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -35,9 +35,7 @@ from The Open Group.
 #include "winmsg.h"
 #include "winconfig.h"
 #include "winprefs.h"
-#ifdef XWIN_CLIPBOARD
 #include "X11/Xlocale.h"
-#endif
 #ifdef DPMSExtension
 #include "dpmsproc.h"
 #endif
@@ -152,9 +150,7 @@ ddxBeforeReset(void)
 {
     winDebug("ddxBeforeReset - Hello\n");
 
-#ifdef XWIN_CLIPBOARD
     winClipboardShutdown();
-#endif
 }
 #endif
 
@@ -718,10 +714,8 @@ winUseMsg(void)
     ErrorF(EXECUTABLE_NAME " Device Dependent Usage:\n");
     ErrorF("\n");
 
-#ifdef XWIN_CLIPBOARD
     ErrorF("-[no]clipboard\n"
            "\tEnable [disable] the clipboard integration. Default is enabled.\n");
-#endif
 
     ErrorF("-clipupdates num_boxes\n"
            "\tUse a clipping region to constrain shadow update blits to\n"
@@ -806,14 +800,12 @@ winUseMsg(void)
            "\tDo not draw a window border, title bar, etc.  Windowed\n"
            "\tmode only.\n");
 
-#ifdef XWIN_CLIPBOARD
     ErrorF("-nounicodeclipboard\n"
            "\tDo not use Unicode clipboard even if on a NT-based platform.\n");
 
     ErrorF("-[no]primary\n"
            "\tWhen clipboard integration is enabled, map the X11 PRIMARY selection\n"
            "\tto the Windows clipboard. Default is enabled.\n");
-#endif
 
     ErrorF("-refresh rate_in_Hz\n"
            "\tSpecify an optional refresh rate to use in fullscreen mode\n"
@@ -1029,8 +1021,6 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[])
         }
     }
 
-#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
-
     /* Generate a cookie used by internal clients for authorization */
     if (g_fXdmcpEnabled || g_fAuthEnabled)
         winGenerateAuthorization();
@@ -1043,7 +1033,6 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[])
          */
         setlocale(LC_ALL, "");
     }
-#endif
 
 #if CYGDEBUG || YES
     winDebug("InitOutput - Returning.\n");
diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am
index 413722c71..b83b28d84 100644
--- a/hw/xwin/Makefile.am
+++ b/hw/xwin/Makefile.am
@@ -1,12 +1,9 @@
 bin_PROGRAMS = XWin
 
-if XWIN_CLIPBOARD
 SRCS_CLIPBOARD = \
 	winclipboardinit.c \
 	winclipboardwrappers.c
-DEFS_CLIPBOARD = -DXWIN_CLIPBOARD
 CLIPBOARD_LIBS = $(top_builddir)/hw/xwin/winclipboard/libXWinclipboard.la
-endif
 
 if XWIN_GLX_WINDOWS
 GLX_DIR =
@@ -115,7 +112,7 @@ SRCS =	InitInput.c \
 	$(SRCS_PRIMARYFB) \
 	$(SRCS_RANDR)
 
- DEFS = $(DEFS_CLIPBOARD) \
+DEFS = \
 	$(DEFS_GLX_WINDOWS) \
 	$(DEFS_MULTIWINDOW) \
 	$(DEFS_MULTIWINDOWEXTWM) \
diff --git a/hw/xwin/meson.build b/hw/xwin/meson.build
index 7e418206a..eef4fee0d 100644
--- a/hw/xwin/meson.build
+++ b/hw/xwin/meson.build
@@ -18,7 +18,6 @@ xwin_c_args = []
 xwin_c_args += '-DHAVE_XWIN_CONFIG_H'
 xwin_c_args += '-Wno-bad-function-cast'
 # XXX: these conditionals are always on and can be removed
-xwin_c_args += '-DXWIN_CLIPBOARD'
 xwin_c_args += '-DXWIN_MULTIWINDOW'
 xwin_c_args += '-DXWIN_RANDR'
 
diff --git a/hw/xwin/win.h b/hw/xwin/win.h
index 93103c4f8..6ae242375 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -127,11 +127,9 @@
 #include <stdio.h>
 
 #include <errno.h>
-#if defined(XWIN_MULTIWINDOWEXTWM) || defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
 #define HANDLE void *
 #include <pthread.h>
 #undef HANDLE
-#endif
 
 #ifdef HAVE_MMAP
 #include <sys/mman.h>
@@ -488,11 +486,9 @@ typedef struct _winPrivScreenRec {
     Bool fRootWindowShown;
 #endif
 
-#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
     /* Privates used for any module running in a seperate thread */
     pthread_mutex_t pmServerStarted;
     Bool fServerStarted;
-#endif
 
     /* Engine specific functions */
     winAllocateFBProcPtr pwinAllocateFB;
@@ -709,11 +705,9 @@ Bool
  * winauth.c
  */
 
-#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
 Bool
  winGenerateAuthorization(void);
 void winSetAuthorization(void);
-#endif
 
 /*
  * winblock.c
@@ -723,7 +717,6 @@ void
 
 winBlockHandler(ScreenPtr pScreen, void *pTimeout);
 
-#ifdef XWIN_CLIPBOARD
 /*
  * winclipboardinit.c
  */
@@ -733,7 +726,6 @@ Bool
 
 void
  winClipboardShutdown(void);
-#endif
 
 /*
  * wincmap.c
diff --git a/hw/xwin/winblock.c b/hw/xwin/winblock.c
index 110740d55..c8eb0c9a1 100644
--- a/hw/xwin/winblock.c
+++ b/hw/xwin/winblock.c
@@ -38,9 +38,7 @@
 void
 winBlockHandler(ScreenPtr pScreen, void *pTimeout)
 {
-#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
     winScreenPriv(pScreen);
-#endif
 
 #ifndef HAS_DEVWINDOWS
     struct timeval **tvp = pTimeout;
@@ -64,7 +62,6 @@ winBlockHandler(ScreenPtr pScreen, void *pTimeout)
     }
 #endif
 
-#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
     /* Signal threaded modules to begin */
     if (pScreenPriv != NULL && !pScreenPriv->fServerStarted) {
         int iReturn;
@@ -84,7 +81,6 @@ winBlockHandler(ScreenPtr pScreen, void *pTimeout)
             winDebug("winBlockHandler - pthread_mutex_unlock () returned\n");
         }
     }
-#endif
 
   /*
     At least one X client has asked to suspend the screensaver, so
diff --git a/hw/xwin/windialogs.c b/hw/xwin/windialogs.c
index c83b49bab..c7668e6a9 100644
--- a/hw/xwin/windialogs.c
+++ b/hw/xwin/windialogs.c
@@ -241,10 +241,8 @@ winDisplayExitDialog(winPrivScreenPtr pScreenPriv)
     if (pScreenPriv->pScreenInfo->fMultiWindow)
         liveClients -= 2;       /* multiwindow window manager & XMsgProc  */
 #endif
-#if defined(XWIN_CLIPBOARD)
     if (g_fClipboardStarted)
         liveClients--;          /* clipboard manager */
-#endif
 
     /* A user reported that this sometimes drops below zero. just eye-candy. */
     if (liveClients < 0)
diff --git a/hw/xwin/winerror.c b/hw/xwin/winerror.c
index b49f9e59d..784772f5f 100644
--- a/hw/xwin/winerror.c
+++ b/hw/xwin/winerror.c
@@ -39,22 +39,18 @@
 void
 OsVendorVErrorF(const char *pszFormat, va_list va_args)
 {
-#if defined(XWIN_CLIPBOARD) || defined (XWIN_MULTIWINDOW)
     /* make sure the clipboard and multiwindow threads do not interfere the
      * main thread */
     static pthread_mutex_t s_pmPrinting = PTHREAD_MUTEX_INITIALIZER;
 
     /* Lock the printing mutex */
     pthread_mutex_lock(&s_pmPrinting);
-#endif
 
     /* Print the error message to a log file, could be stderr */
     LogVWrite(0, pszFormat, va_args);
 
-#if defined(XWIN_CLIPBOARD) || defined (XWIN_MULTIWINDOW)
     /* Unlock the printing mutex */
     pthread_mutex_unlock(&s_pmPrinting);
-#endif
 }
 #endif
 
diff --git a/hw/xwin/winglobals.c b/hw/xwin/winglobals.c
index 66019b4b1..d1a0d4587 100644
--- a/hw/xwin/winglobals.c
+++ b/hw/xwin/winglobals.c
@@ -80,7 +80,6 @@ Bool g_fNativeGl = TRUE;
 Bool g_fHostInTitle = TRUE;
 pthread_mutex_t g_pmTerminating = PTHREAD_MUTEX_INITIALIZER;
 
-#ifdef XWIN_CLIPBOARD
 /*
  * Wrapped DIX functions
  */
@@ -93,7 +92,6 @@ winDispatchProcPtr winProcEstablishConnectionOrig = NULL;
 Bool g_fUnicodeClipboard = TRUE;
 Bool g_fClipboard = TRUE;
 Bool g_fClipboardStarted = FALSE;
-#endif
 
 /*
  * Re-initialize global variables that are invalidated
diff --git a/hw/xwin/winglobals.h b/hw/xwin/winglobals.h
index d143fb819..d05330617 100644
--- a/hw/xwin/winglobals.h
+++ b/hw/xwin/winglobals.h
@@ -62,8 +62,6 @@ extern HWND g_hDlgAbout;
 extern Bool g_fSoftwareCursor;
 extern Bool g_fCursor;
 
-#ifdef XWIN_CLIPBOARD
-
 /* Typedef for DIX wrapper functions */
 typedef int (*winDispatchProcPtr) (ClientPtr);
 
@@ -71,7 +69,6 @@ typedef int (*winDispatchProcPtr) (ClientPtr);
  * Wrapped DIX functions
  */
 extern winDispatchProcPtr winProcEstablishConnectionOrig;
-#endif
 extern Bool g_fUnicodeClipboard;
 extern Bool g_fClipboard;
 extern Bool g_fClipboardStarted;
diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c
index 35ea8f23a..64d07cc6e 100644
--- a/hw/xwin/winprocarg.c
+++ b/hw/xwin/winprocarg.c
@@ -41,9 +41,7 @@ from The Open Group.
 #include "winmsg.h"
 #include "winmonitors.h"
 
-#ifdef XWIN_CLIPBOARD
 #include "winclipboard/winclipboard.h"
-#endif
 
 /*
  * Function prototypes
@@ -690,7 +688,6 @@ ddxProcessArgument(int argc, char *argv[], int i)
         return 1;
     }
 
-#ifdef XWIN_CLIPBOARD
     /*
      * Look for the '-clipboard' argument
      */
@@ -731,7 +728,6 @@ ddxProcessArgument(int argc, char *argv[], int i)
         /* Indicate that we have processed this argument */
         return 1;
     }
-#endif
 
     /*
      * Look for the '-ignoreinput' argument
@@ -1022,7 +1018,6 @@ ddxProcessArgument(int argc, char *argv[], int i)
         return 2;
     }
 
-#ifdef XWIN_CLIPBOARD
     /*
      * Look for the '-nounicodeclipboard' argument
      */
@@ -1031,7 +1026,6 @@ ddxProcessArgument(int argc, char *argv[], int i)
         /* Indicate that we have processed the argument */
         return 1;
     }
-#endif
 
     if (IS_OPTION("-xkbrules")) {
         CHECK_ARGS(1);
diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c
index 6cbf08da4..acdd49e6d 100644
--- a/hw/xwin/winscrinit.c
+++ b/hw/xwin/winscrinit.c
@@ -264,9 +264,7 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv)
     winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
     VisualPtr pVisual = NULL;
 
-#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
     int iReturn;
-#endif
 
     /* Create framebuffer */
     if (!(*pScreenPriv->pwinInitScreen) (pScreen)) {
@@ -504,7 +502,6 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv)
     pScreenPriv->CloseScreen = pScreen->CloseScreen;
     pScreen->CloseScreen = pScreenPriv->pwinCloseScreen;
 
-#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
     /* Create a mutex for modules in separate threads to wait for */
     iReturn = pthread_mutex_init(&pScreenPriv->pmServerStarted, NULL);
     if (iReturn != 0) {
@@ -523,7 +520,6 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv)
 
     /* Set the ServerStarted flag to false */
     pScreenPriv->fServerStarted = FALSE;
-#endif
 
 #ifdef XWIN_MULTIWINDOWEXTWM
     pScreenPriv->fRestacking = FALSE;
diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c
index 825c1e081..4e1fbd15c 100644
--- a/hw/xwin/winshadddnl.c
+++ b/hw/xwin/winshadddnl.c
@@ -697,10 +697,8 @@ winCloseScreenShadowDDNL(ScreenPtr pScreen)
         pScreenPriv->hwndScreen = NULL;
     }
 
-#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
     /* Destroy the thread startup mutex */
     pthread_mutex_destroy(&pScreenPriv->pmServerStarted);
-#endif
 
     /* Kill our screeninfo's pointer to the screen */
     pScreenInfo->pScreen = NULL;
diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c
index f8295be95..770942ad7 100644
--- a/hw/xwin/winshadgdi.c
+++ b/hw/xwin/winshadgdi.c
@@ -618,10 +618,8 @@ winCloseScreenShadowGDI(ScreenPtr pScreen)
         pScreenPriv->hwndScreen = NULL;
     }
 
-#if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW)
     /* Destroy the thread startup mutex */
     pthread_mutex_destroy(&pScreenPriv->pmServerStarted);
-#endif
 
     /* Invalidate our screeninfo's pointer to the screen */
     pScreenInfo->pScreen = NULL;
diff --git a/hw/xwin/wintrayicon.c b/hw/xwin/wintrayicon.c
index 6acc0d712..1511fc1f2 100644
--- a/hw/xwin/wintrayicon.c
+++ b/hw/xwin/wintrayicon.c
@@ -36,9 +36,7 @@
 #include "win.h"
 #include <shellapi.h>
 #include "winprefs.h"
-#ifdef XWIN_CLIPBOARD
 #include "winclipboard/winclipboard.h"
-#endif
 
 /*
  * Initialize the tray icon
@@ -174,7 +172,6 @@ winHandleIconMessage(HWND hwnd, UINT message,
             RemoveMenu(hmenuTray, ID_APP_HIDE_ROOT, MF_BYCOMMAND);
         }
 
-#ifdef XWIN_CLIPBOARD
         if (g_fClipboard) {
             /* Set menu state to indicate if 'Monitor Primary' is enabled or not */
             MENUITEMINFO mii = { 0 };
@@ -187,7 +184,6 @@ winHandleIconMessage(HWND hwnd, UINT message,
             /* Remove 'Monitor Primary' menu item */
             RemoveMenu(hmenuTray, ID_APP_MONITOR_PRIMARY, MF_BYCOMMAND);
         }
-#endif
 
         SetupRootMenu(hmenuTray);
 
diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c
index ad9f1b337..538430c13 100644
--- a/hw/xwin/winwndproc.c
+++ b/hw/xwin/winwndproc.c
@@ -42,9 +42,7 @@
 #include "winmsg.h"
 #include "winmonitors.h"
 #include "inputstr.h"
-#ifdef XWIN_CLIPBOARD
 #include "winclipboard/winclipboard.h"
-#endif
 
 /*
  * Global variables
@@ -1168,10 +1166,8 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
             ShowCursor(TRUE);
         }
 
-#ifdef XWIN_CLIPBOARD
         /* Make sure the clipboard chain is ok. */
         winFixClipboardChain();
-#endif
 
         /* Call engine specific screen activation/deactivation function */
         (*s_pScreenPriv->pwinActivateApp) (s_pScreen);
@@ -1203,11 +1199,9 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
             return 0;
 #endif
 
-#ifdef XWIN_CLIPBOARD
         case ID_APP_MONITOR_PRIMARY:
             fPrimarySelection = !fPrimarySelection;
             return 0;
-#endif
 
         case ID_APP_ABOUT:
             /* Display the About box */
commit 1ef65692258136d6e36d0d9d6c5efad9877c9ceb
Author: Emil Velikov <emil.l.velikov at gmail.com>
Date:   Tue Aug 22 11:48:27 2017 +0100

    os: make MitGenerateCookie() independent of XCSECURITY
    
    Analogous to previous commit.
    
    Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
    Reviewed-by: Jon Turney <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/winauth.c b/hw/xwin/winauth.c
index b7d1e2c7d..14278390f 100644
--- a/hw/xwin/winauth.c
+++ b/hw/xwin/winauth.c
@@ -68,32 +68,6 @@ static xcb_auth_info_t auth_info;
  */
 
 #ifndef XCSECURITY
-static char cookie[16];         /* 128 bits */
-
-XID
-MitGenerateCookie(unsigned data_length,
-                  const char *data,
-                  XID id, unsigned *data_length_return, char **data_return)
-{
-    int i = 0;
-    int status;
-
-    while (data_length--) {
-        cookie[i++] += *data++;
-        if (i >= sizeof(cookie))
-            i = 0;
-    }
-    GenerateRandomData(sizeof(cookie), cookie);
-    status = MitAddCookie(sizeof(cookie), cookie, id);
-    if (!status) {
-        id = -1;
-    }
-    else {
-        *data_return = cookie;
-        *data_length_return = sizeof(cookie);
-    }
-    return id;
-}
 
 static
     XID
diff --git a/os/mitauth.c b/os/mitauth.c
index e75d700e1..a268f62f9 100644
--- a/os/mitauth.c
+++ b/os/mitauth.c
@@ -133,8 +133,6 @@ MitRemoveCookie(unsigned short data_length, const char *data)
     return 0;
 }
 
-#ifdef XCSECURITY
-
 static char cookie[16];         /* 128 bits */
 
 XID
@@ -161,5 +159,3 @@ MitGenerateCookie(unsigned data_length,
     }
     return id;
 }
-
-#endif                          /* XCSECURITY */
commit 292ee7151631cabbd928847a5a2ca47e14a06b75
Author: Emil Velikov <emil.l.velikov at gmail.com>
Date:   Tue Aug 22 11:48:26 2017 +0100

    os: make GenerateRandomData() independent of XCSECURITY
    
    The function itself does not depend on the macro. Move it outside
    of the ifdef guard and remove the identical copy in XWIN.
    
    This is step 1 towards removing the duplication in winauth.c and moving
    the OS specifics to os/
    
    Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
    Reviewed-by: Jon Turney <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/winauth.c b/hw/xwin/winauth.c
index e86343952..b7d1e2c7d 100644
--- a/hw/xwin/winauth.c
+++ b/hw/xwin/winauth.c
@@ -68,16 +68,6 @@ static xcb_auth_info_t auth_info;
  */
 
 #ifndef XCSECURITY
-void
-GenerateRandomData(int len, char *buf)
-{
-    int fd;
-
-    fd = open("/dev/urandom", O_RDONLY);
-    read(fd, buf, len);
-    close(fd);
-}
-
 static char cookie[16];         /* 128 bits */
 
 XID
diff --git a/os/auth.c b/os/auth.c
index c7b333ca2..9d87c1f39 100644
--- a/os/auth.c
+++ b/os/auth.c
@@ -302,6 +302,8 @@ GenerateAuthorization(unsigned name_length,
     return -1;
 }
 
+#endif                          /* XCSECURITY */
+
 void
 GenerateRandomData(int len, char *buf)
 {
@@ -315,5 +317,3 @@ GenerateRandomData(int len, char *buf)
     close(fd);
 #endif
 }
-
-#endif                          /* XCSECURITY */
commit 8aee1f40eaa3527c90698d6826ce8314b8b5a92a
Author: Emil Velikov <emil.l.velikov at gmail.com>
Date:   Tue Aug 22 11:48:25 2017 +0100

    xwin/glx: remove unused __GLXWinScreen::glx_enable_bits
    
    All the relevant code already uses the ::base::glx_enable_bits one.
    
    Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
    Reviewed-by: Jon Turney <jon.turney at dronecode.org.uk>

diff --git a/hw/xwin/glx/indirect.h b/hw/xwin/glx/indirect.h
index 8a66121ac..bcdef153a 100644
--- a/hw/xwin/glx/indirect.h
+++ b/hw/xwin/glx/indirect.h
@@ -64,9 +64,6 @@ struct __GLXWinDrawable {
 struct __GLXWinScreen {
     __GLXscreen base;
 
-    /* Supported GLX extensions */
-    unsigned char glx_enable_bits[__GLX_EXT_BYTES];
-
     Bool has_WGL_ARB_multisample;
     Bool has_WGL_ARB_pixel_format;
     Bool has_WGL_ARB_pbuffer;


More information about the xorg-commit mailing list