xwin: remove always true/set XWIN_CLIPBOARD conditional/define

v2: drop trailing endif (Jon)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
This commit is contained in:
Emil Velikov 2017-08-22 11:48:28 +01:00 committed by Adam Jackson
parent 1ef6569225
commit 9d00f6190a
17 changed files with 1 additions and 68 deletions

View File

@ -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])

View File

@ -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,

View File

@ -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");

View File

@ -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) \

View File

@ -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'

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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 */