From 45b223e1c2bdc447263a9de7af62c93f4058c33c Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Wed, 7 Sep 2011 12:50:20 +0100 Subject: Build dpmsstubs.c once as a convenience library, rather than once for each DDX which wants to use it Signed-off-by: Jon TURNEY Reviewed-by: Gaetan Nadon --- Xext/Makefile.am | 4 +++- hw/vfb/Makefile.am | 4 ++-- hw/xnest/Makefile.am | 4 ++-- hw/xwin/Makefile.am | 6 +++--- test/Makefile.am | 2 +- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/Xext/Makefile.am b/Xext/Makefile.am index 8e31f1367..a9a446820 100644 --- a/Xext/Makefile.am +++ b/Xext/Makefile.am @@ -1,4 +1,4 @@ -noinst_LTLIBRARIES = libXext.la +noinst_LTLIBRARIES = libXext.la libXextdpmsstubs.la AM_CFLAGS = $(DIX_CFLAGS) @@ -96,6 +96,8 @@ endif libXext_la_SOURCES = $(BUILTIN_SRCS) libXext_la_LIBADD = $(BUILTIN_LIBS) +libXextdpmsstubs_la_SOURCES = dpmsstubs.c + EXTRA_DIST = \ $(MITSHM_SRCS) \ $(XV_SRCS) \ diff --git a/hw/vfb/Makefile.am b/hw/vfb/Makefile.am index 9f4992c8b..c9f6957b4 100644 --- a/hw/vfb/Makefile.am +++ b/hw/vfb/Makefile.am @@ -9,7 +9,6 @@ AM_CFLAGS = -DHAVE_DIX_CONFIG_H \ SRCS = InitInput.c \ InitOutput.c \ - $(top_srcdir)/Xext/dpmsstubs.c \ $(top_srcdir)/Xi/stubs.c \ $(top_srcdir)/mi/miinitext.c @@ -22,7 +21,8 @@ XVFB_LIBS = \ @XVFB_LIBS@ \ libfbcmap.a \ $(MAIN_LIB) \ - $(XSERVER_LIBS) + $(XSERVER_LIBS) \ + $(top_builddir)/Xext/libXextdpmsstubs.la Xvfb_LDADD = $(XVFB_LIBS) $(XVFB_SYS_LIBS) $(XSERVER_SYS_LIBS) Xvfb_DEPENDENCIES = $(XVFB_LIBS) diff --git a/hw/xnest/Makefile.am b/hw/xnest/Makefile.am index 3c099cd6b..c5560fdd6 100644 --- a/hw/xnest/Makefile.am +++ b/hw/xnest/Makefile.am @@ -42,7 +42,6 @@ SRCS = Args.c \ XNPixmap.h \ XNWindow.h \ xnest-config.h \ - $(top_srcdir)/Xext/dpmsstubs.c \ $(top_srcdir)/Xi/stubs.c \ $(top_srcdir)/mi/miinitext.c @@ -51,7 +50,8 @@ libfbcmap_a_CFLAGS = $(AM_CFLAGS) XNEST_LIBS = \ @XNEST_LIBS@ \ - libfbcmap.a + libfbcmap.a \ + $(top_builddir)/Xext/libXextdpmsstubs.la Xnest_SOURCES = $(SRCS) diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am index 7f0eaf097..666804504 100644 --- a/hw/xwin/Makefile.am +++ b/hw/xwin/Makefile.am @@ -127,7 +127,6 @@ SRCS = InitInput.c \ winresource.h \ winwindow.h \ XWin.rc \ - $(top_srcdir)/Xext/dpmsstubs.c \ $(top_srcdir)/Xi/stubs.c \ $(top_srcdir)/mi/miinitext.c \ $(top_srcdir)/fb/fbcmap_mi.c \ @@ -153,12 +152,13 @@ XWin_SOURCES = $(SRCS) AM_CPPFLAGS = -I$(top_srcdir)/miext/rootless XWIN_SYS_LIBS += -ldxguid -XWIN_LIBS += $(top_builddir)/pseudoramiX/libPseudoramiX.la - +XWIN_LIBS += $(top_builddir)/pseudoramiX/libPseudoramiX.la \ + $(top_builddir)/Xext/libXextdpmsstubs.la XWin_DEPENDENCIES = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_LIBS) $(XSERVER_LIBS) XWin_LDADD = $(MULTIWINDOW_LIBS) $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_GLX_LINK_FLAGS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS) XWin_LDFLAGS = -mwindows -static -Wl,--disable-stdcall-fixup + .rc.o: $(AM_V_GEN)$(WINDRES) --use-temp-file -i $< --input-format=rc -o $@ -O coff -I $(top_builddir)/include diff --git a/test/Makefile.am b/test/Makefile.am index 88fb6aa96..7209fbd37 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -71,7 +71,6 @@ else nodist_libxservertest_la_SOURCES = \ ddxstubs.c \ $(top_srcdir)/mi/miinitext.c \ - $(top_srcdir)/Xext/dpmsstubs.c \ $(top_srcdir)/Xi/stubs.c libxservertest_la_LIBADD += \ @@ -83,6 +82,7 @@ libxservertest_la_LIBADD += \ $(top_builddir)/randr/librandr.la \ $(top_builddir)/render/librender.la \ $(top_builddir)/Xext/libXext.la \ + $(top_builddir)/Xext/libXextdpmsstubs.la \ $(top_builddir)/Xi/libXi.la \ $(top_builddir)/xfixes/libxfixes.la \ $(top_builddir)/xkb/libxkb.la \ -- cgit v1.2.3 From f23dd02b969089b66685f70887f19041049f7a24 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Fri, 21 Feb 2014 18:11:33 +0000 Subject: Build Xi/stubs.c once as a convenience library, rather than once for each DDX which wants to use it Signed-off-by: Jon TURNEY Reviewed-by: Gaetan Nadon --- Xi/Makefile.am | 5 +++-- hw/vfb/Makefile.am | 4 ++-- hw/xnest/Makefile.am | 4 ++-- hw/xwin/Makefile.am | 4 ++-- test/Makefile.am | 4 ++-- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Xi/Makefile.am b/Xi/Makefile.am index af85bd049..6c456c4ac 100644 --- a/Xi/Makefile.am +++ b/Xi/Makefile.am @@ -1,4 +1,4 @@ -noinst_LTLIBRARIES = libXi.la +noinst_LTLIBRARIES = libXi.la libXistubs.la AM_CFLAGS = $(DIX_CFLAGS) @@ -107,4 +107,5 @@ libXi_la_SOURCES = \ xiwarppointer.c \ xiwarppointer.h -EXTRA_DIST = stubs.c +libXistubs_la_SOURCES = \ + stubs.c diff --git a/hw/vfb/Makefile.am b/hw/vfb/Makefile.am index c9f6957b4..a02a43820 100644 --- a/hw/vfb/Makefile.am +++ b/hw/vfb/Makefile.am @@ -9,7 +9,6 @@ AM_CFLAGS = -DHAVE_DIX_CONFIG_H \ SRCS = InitInput.c \ InitOutput.c \ - $(top_srcdir)/Xi/stubs.c \ $(top_srcdir)/mi/miinitext.c libfbcmap_a_CFLAGS = $(AM_CFLAGS) @@ -22,7 +21,8 @@ XVFB_LIBS = \ libfbcmap.a \ $(MAIN_LIB) \ $(XSERVER_LIBS) \ - $(top_builddir)/Xext/libXextdpmsstubs.la + $(top_builddir)/Xext/libXextdpmsstubs.la \ + $(top_builddir)/Xi/libXistubs.la Xvfb_LDADD = $(XVFB_LIBS) $(XVFB_SYS_LIBS) $(XSERVER_SYS_LIBS) Xvfb_DEPENDENCIES = $(XVFB_LIBS) diff --git a/hw/xnest/Makefile.am b/hw/xnest/Makefile.am index c5560fdd6..bb8d3d821 100644 --- a/hw/xnest/Makefile.am +++ b/hw/xnest/Makefile.am @@ -42,7 +42,6 @@ SRCS = Args.c \ XNPixmap.h \ XNWindow.h \ xnest-config.h \ - $(top_srcdir)/Xi/stubs.c \ $(top_srcdir)/mi/miinitext.c libfbcmap_a_SOURCES = $(top_srcdir)/fb/fbcmap_mi.c @@ -51,7 +50,8 @@ libfbcmap_a_CFLAGS = $(AM_CFLAGS) XNEST_LIBS = \ @XNEST_LIBS@ \ libfbcmap.a \ - $(top_builddir)/Xext/libXextdpmsstubs.la + $(top_builddir)/Xext/libXextdpmsstubs.la \ + $(top_builddir)/Xi/libXistubs.la Xnest_SOURCES = $(SRCS) diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am index 666804504..b0da70493 100644 --- a/hw/xwin/Makefile.am +++ b/hw/xwin/Makefile.am @@ -127,7 +127,6 @@ SRCS = InitInput.c \ winresource.h \ winwindow.h \ XWin.rc \ - $(top_srcdir)/Xi/stubs.c \ $(top_srcdir)/mi/miinitext.c \ $(top_srcdir)/fb/fbcmap_mi.c \ $(SRCS_CLIPBOARD) \ @@ -153,7 +152,8 @@ AM_CPPFLAGS = -I$(top_srcdir)/miext/rootless XWIN_SYS_LIBS += -ldxguid XWIN_LIBS += $(top_builddir)/pseudoramiX/libPseudoramiX.la \ - $(top_builddir)/Xext/libXextdpmsstubs.la + $(top_builddir)/Xext/libXextdpmsstubs.la \ + $(top_builddir)/Xi/libXistubs.la XWin_DEPENDENCIES = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_LIBS) $(XSERVER_LIBS) XWin_LDADD = $(MULTIWINDOW_LIBS) $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_GLX_LINK_FLAGS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS) XWin_LDFLAGS = -mwindows -static -Wl,--disable-stdcall-fixup diff --git a/test/Makefile.am b/test/Makefile.am index 7209fbd37..3ad24d9ec 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -70,8 +70,7 @@ endif else nodist_libxservertest_la_SOURCES = \ ddxstubs.c \ - $(top_srcdir)/mi/miinitext.c \ - $(top_srcdir)/Xi/stubs.c + $(top_srcdir)/mi/miinitext.c libxservertest_la_LIBADD += \ $(top_builddir)/damageext/libdamageext.la \ @@ -84,6 +83,7 @@ libxservertest_la_LIBADD += \ $(top_builddir)/Xext/libXext.la \ $(top_builddir)/Xext/libXextdpmsstubs.la \ $(top_builddir)/Xi/libXi.la \ + $(top_builddir)/Xi/libXistubs.la \ $(top_builddir)/xfixes/libxfixes.la \ $(top_builddir)/xkb/libxkb.la \ $(top_builddir)/xkb/libxkbstubs.la -- cgit v1.2.3 From 432fc37e2ca833f1ec3cb614cbdc3a7ae13f22b7 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Mon, 24 Feb 2014 20:45:51 +0000 Subject: Build fbcmap_mi.c once, rather than once for each DDX Build fbcmap_mi.c once, rather than once for each DDX, and make it part of libfb or libwfb convenience library. Since 84e8de1271bb11b5b4b9747ae4647f47333a8ab7 we don't have fbcmap.c This is a sort of revert of 17d85387d1e6851d35474b65929e268ca64ef65b v2: Remove libkdrivestubs.la from configure.ac Signed-off-by: Jon TURNEY Reviewed-by: Gaetan Nadon --- configure.ac | 3 +-- fb/Makefile.am | 3 +-- hw/dmx/Makefile.am | 1 - hw/kdrive/src/Makefile.am | 5 +---- hw/vfb/Makefile.am | 5 ----- hw/xfree86/dixmods/Makefile.am | 4 ++-- hw/xnest/Makefile.am | 5 ----- hw/xquartz/Makefile.am | 1 - hw/xwin/Makefile.am | 1 - 9 files changed, 5 insertions(+), 23 deletions(-) diff --git a/configure.ac b/configure.ac index a75ba8f69..f589d6d74 100644 --- a/configure.ac +++ b/configure.ac @@ -2408,8 +2408,7 @@ if test "$KDRIVE" = yes; then fi ;; esac - KDRIVE_STUB_LIB='$(top_builddir)/hw/kdrive/src/libkdrivestubs.la' - KDRIVE_LOCAL_LIBS="$MAIN_LIB $DIX_LIB $KDRIVE_LIB $KDRIVE_STUB_LIB" + KDRIVE_LOCAL_LIBS="$MAIN_LIB $DIX_LIB $KDRIVE_LIB" KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $FB_LIB $MI_LIB $KDRIVE_PURE_LIBS" KDRIVE_LOCAL_LIBS="$KDRIVE_LOCAL_LIBS $KDRIVE_OS_LIB" KDRIVE_LIBS="$KDRIVE_LOCAL_LIBS $XSERVER_SYS_LIBS $GLX_SYS_LIBS $DLOPEN_LIBS $TSLIB_LIBS" diff --git a/fb/Makefile.am b/fb/Makefile.am index 89f3babb1..752eabeb7 100644 --- a/fb/Makefile.am +++ b/fb/Makefile.am @@ -22,6 +22,7 @@ libfb_la_SOURCES = \ fbbits.h \ fbblt.c \ fbbltone.c \ + fbcmap_mi.c \ fbcopy.c \ fbfill.c \ fbfillrect.c \ @@ -50,5 +51,3 @@ libfb_la_SOURCES = \ fbwindow.c libwfb_la_SOURCES = $(libfb_la_SOURCES) - -EXTRA_DIST = fbcmap_mi.c diff --git a/hw/dmx/Makefile.am b/hw/dmx/Makefile.am index a05af139e..eef84cb66 100644 --- a/hw/dmx/Makefile.am +++ b/hw/dmx/Makefile.am @@ -65,7 +65,6 @@ Xdmx_SOURCES = dmx.c \ dmxwindow.c \ dmxwindow.h \ $(top_srcdir)/mi/miinitext.c \ - $(top_srcdir)/fb/fbcmap_mi.c \ $(GLX_SRCS) diff --git a/hw/kdrive/src/Makefile.am b/hw/kdrive/src/Makefile.am index 5799ddbdb..d69f0dd99 100644 --- a/hw/kdrive/src/Makefile.am +++ b/hw/kdrive/src/Makefile.am @@ -4,7 +4,7 @@ AM_CPPFLAGS = \ AM_CFLAGS = -DHAVE_DIX_CONFIG_H -noinst_LTLIBRARIES = libkdrive.la libkdrivestubs.la +noinst_LTLIBRARIES = libkdrive.la if XV KDRIVE_XV_SOURCES = \ @@ -23,6 +23,3 @@ libkdrive_la_SOURCES = \ kshadow.c \ $(KDRIVE_XV_SOURCES) \ $(top_srcdir)/mi/miinitext.c - -libkdrivestubs_la_SOURCES = \ - $(top_srcdir)/fb/fbcmap_mi.c diff --git a/hw/vfb/Makefile.am b/hw/vfb/Makefile.am index a02a43820..f0f9fee47 100644 --- a/hw/vfb/Makefile.am +++ b/hw/vfb/Makefile.am @@ -1,7 +1,6 @@ SUBDIRS = man bin_PROGRAMS = Xvfb -noinst_LIBRARIES = libfbcmap.a AM_CFLAGS = -DHAVE_DIX_CONFIG_H \ $(XVFBMODULES_CFLAGS) \ @@ -11,14 +10,10 @@ SRCS = InitInput.c \ InitOutput.c \ $(top_srcdir)/mi/miinitext.c -libfbcmap_a_CFLAGS = $(AM_CFLAGS) -libfbcmap_a_SOURCES = $(top_srcdir)/fb/fbcmap_mi.c - Xvfb_SOURCES = $(SRCS) XVFB_LIBS = \ @XVFB_LIBS@ \ - libfbcmap.a \ $(MAIN_LIB) \ $(XSERVER_LIBS) \ $(top_builddir)/Xext/libXextdpmsstubs.la \ diff --git a/hw/xfree86/dixmods/Makefile.am b/hw/xfree86/dixmods/Makefile.am index 3c43640ec..dd076e421 100644 --- a/hw/xfree86/dixmods/Makefile.am +++ b/hw/xfree86/dixmods/Makefile.am @@ -19,12 +19,12 @@ AM_CPPFLAGS = @XORG_INCS@ \ libfb_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) libfb_la_LIBADD = $(top_builddir)/fb/libfb.la -libfb_la_SOURCES = $(top_builddir)/fb/fbcmap_mi.c fbmodule.c +libfb_la_SOURCES = fbmodule.c libfb_la_CFLAGS = $(AM_CFLAGS) libwfb_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) libwfb_la_LIBADD = $(top_builddir)/fb/libwfb.la -libwfb_la_SOURCES = $(top_builddir)/fb/fbcmap_mi.c fbmodule.c +libwfb_la_SOURCES = fbmodule.c libwfb_la_CFLAGS = $(AM_CFLAGS) -DFB_ACCESS_WRAPPER libglx_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) diff --git a/hw/xnest/Makefile.am b/hw/xnest/Makefile.am index bb8d3d821..eb550c0f7 100644 --- a/hw/xnest/Makefile.am +++ b/hw/xnest/Makefile.am @@ -1,7 +1,6 @@ SUBDIRS = man bin_PROGRAMS = Xnest -noinst_LIBRARIES = libfbcmap.a AM_CFLAGS = -DHAVE_XNEST_CONFIG_H \ $(DIX_CFLAGS) \ @@ -44,12 +43,8 @@ SRCS = Args.c \ xnest-config.h \ $(top_srcdir)/mi/miinitext.c -libfbcmap_a_SOURCES = $(top_srcdir)/fb/fbcmap_mi.c -libfbcmap_a_CFLAGS = $(AM_CFLAGS) - XNEST_LIBS = \ @XNEST_LIBS@ \ - libfbcmap.a \ $(top_builddir)/Xext/libXextdpmsstubs.la \ $(top_builddir)/Xi/libXistubs.la diff --git a/hw/xquartz/Makefile.am b/hw/xquartz/Makefile.am index 2ca953cf9..4da896d76 100644 --- a/hw/xquartz/Makefile.am +++ b/hw/xquartz/Makefile.am @@ -20,7 +20,6 @@ SUBDIRS = bundle . $(GL_DIR) xpr pbproxy mach-startup man DIST_SUBDIRS = bundle . GL xpr pbproxy mach-startup man libXquartz_la_SOURCES = \ - $(top_srcdir)/fb/fbcmap_mi.c \ $(top_srcdir)/mi/miinitext.c \ X11Application.m \ X11Controller.m \ diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am index b0da70493..cf42cfd2d 100644 --- a/hw/xwin/Makefile.am +++ b/hw/xwin/Makefile.am @@ -128,7 +128,6 @@ SRCS = InitInput.c \ winwindow.h \ XWin.rc \ $(top_srcdir)/mi/miinitext.c \ - $(top_srcdir)/fb/fbcmap_mi.c \ $(SRCS_CLIPBOARD) \ $(SRCS_MULTIWINDOW) \ $(SRCS_MULTIWINDOWEXTWM) \ -- cgit v1.2.3 From 5870bd398d6073938d821c060eccf24adc07a2f1 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Mon, 24 Mar 2014 17:32:09 +0000 Subject: Fix ephyr build with --disable-glamor See http://tinderbox.x.org/builds/2014-03-23-0010/logs/xserver/#build Signed-off-by: Jon TURNEY Tested-by: Julien Cristau Reviewed-by: Julien Cristau --- hw/kdrive/ephyr/hostx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c index 4f48770a6..435919e0a 100644 --- a/hw/kdrive/ephyr/hostx.c +++ b/hw/kdrive/ephyr/hostx.c @@ -734,13 +734,16 @@ hostx_screen_init(KdScreenInfo *screen, scrpriv->win_width = width; scrpriv->win_height = height; +#ifdef GLAMOR if (ephyr_glamor) { *bytes_per_line = 0; *bits_per_pixel = 0; ephyr_glamor_set_window_size(scrpriv->glamor, scrpriv->win_width, scrpriv->win_height); return NULL; - } else if (host_depth_matches_server(scrpriv)) { + } else +#endif + if (host_depth_matches_server(scrpriv)) { *bytes_per_line = scrpriv->ximg->stride; *bits_per_pixel = scrpriv->ximg->bpp; -- cgit v1.2.3 From a3730271d52542757ec0f41acc29e7730501f666 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Mon, 24 Mar 2014 17:32:10 +0000 Subject: Fix build when configured --enable-debug Include os.h for ErrorF() to fix implicit-function-declaration warnings when configured with --enable-debug. hw/xfree86/parser/DRI.c: In function 'xf86parseDRISection': hw/xfree86/parser/DRI.c:87:5: error: implicit declaration of function 'ErrorF' [-Werror=implicit-function-declaration] hw/xfree86/parser/Extensions.c: In function 'xf86parseExtensionsSection': hw/xfree86/parser/Extensions.c:77:5: error: implicit declaration of function 'ErrorF' [-Werror=implicit-function-declaration] Signed-off-by: Jon TURNEY Reviewed-by: Julien Cristau --- hw/xfree86/parser/DRI.c | 1 + hw/xfree86/parser/Extensions.c | 1 + 2 files changed, 2 insertions(+) diff --git a/hw/xfree86/parser/DRI.c b/hw/xfree86/parser/DRI.c index ad053f746..6be32d7ea 100644 --- a/hw/xfree86/parser/DRI.c +++ b/hw/xfree86/parser/DRI.c @@ -31,6 +31,7 @@ #include #endif +#include "os.h" #include "xf86Parser.h" #include "xf86tokens.h" #include "Configint.h" diff --git a/hw/xfree86/parser/Extensions.c b/hw/xfree86/parser/Extensions.c index b5ba72e5f..a6fcb56f0 100644 --- a/hw/xfree86/parser/Extensions.c +++ b/hw/xfree86/parser/Extensions.c @@ -35,6 +35,7 @@ #include #endif +#include "os.h" #include "xf86Parser.h" #include "xf86tokens.h" #include "Configint.h" -- cgit v1.2.3 From bc348bd2c42f3f18786085ccef2f010eff5bf3d2 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Mon, 11 Mar 2013 14:34:32 +0000 Subject: Handle -displayfd and an explicit display number sensibly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Handle -displayfd and an explicit display number sensibly, e.g. use the explicitly specified display number, and write it to the displayfd v2: displayfd might be 0, so use -1 as invalid value v3: Rebase for addition of NoListenAll flag Signed-off-by: Jon TURNEY Reviewed-by: Kristian Høgsberg --- dix/globals.c | 3 ++- include/opaque.h | 1 + os/connection.c | 12 ++++++------ os/utils.c | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/dix/globals.c b/dix/globals.c index 9738e9cdf..eaa2afe24 100644 --- a/dix/globals.c +++ b/dix/globals.c @@ -127,7 +127,8 @@ int defaultColorVisualClass = -1; int monitorResolution = 0; const char *display; -int displayfd; +int displayfd = -1; +Bool explicit_display = FALSE; char *ConnectionInfo; CARD32 TimeOutValue = DEFAULT_TIMEOUT * MILLI_PER_SECOND; diff --git a/include/opaque.h b/include/opaque.h index 7ec1d850f..6b8071c5b 100644 --- a/include/opaque.h +++ b/include/opaque.h @@ -51,6 +51,7 @@ extern _X_EXPORT int defaultScreenSaverBlanking; extern _X_EXPORT int defaultScreenSaverAllowExposures; extern _X_EXPORT const char *display; extern _X_EXPORT int displayfd; +extern _X_EXPORT Bool explicit_display; extern _X_EXPORT int defaultBackingStore; extern _X_EXPORT Bool disableBackingStore; diff --git a/os/connection.c b/os/connection.c index b3640b8e4..e914d9d94 100644 --- a/os/connection.c +++ b/os/connection.c @@ -352,8 +352,8 @@ void NotifyParentProcess(void) { #if !defined(WIN32) - if (dynamic_display[0]) { - write(displayfd, dynamic_display, strlen(dynamic_display)); + if (displayfd >= 0) { + write(displayfd, display, strlen(display)); write(displayfd, "\n", 1); close(displayfd); } @@ -405,18 +405,18 @@ CreateWellKnownSockets(void) FD_ZERO(&WellKnownConnections); /* display is initialized to "0" by main(). It is then set to the display - * number if specified on the command line, or to NULL when the -displayfd - * option is used. */ + * number if specified on the command line. */ + if (NoListenAll) { ListenTransCount = 0; } - else if (display) { + else if ((displayfd < 0) || explicit_display) { if (TryCreateSocket(atoi(display), &partial) && ListenTransCount >= 1) if (!PartialNetwork && partial) FatalError ("Failed to establish all listening sockets"); } - else { /* -displayfd */ + else { /* -displayfd and no explicit display number */ Bool found = 0; for (i = 0; i < 65535 - X_TCP_PORT; i++) { if (TryCreateSocket(i, &partial) && !partial) { diff --git a/os/utils.c b/os/utils.c index c513968ad..6e6974e89 100644 --- a/os/utils.c +++ b/os/utils.c @@ -666,6 +666,7 @@ ProcessCommandLine(int argc, char *argv[]) else if (argv[i][0] == ':') { /* initialize display */ display = argv[i]; + explicit_display = TRUE; display++; if (!VerifyDisplayName(display)) { ErrorF("Bad display name: %s\n", display); @@ -736,7 +737,6 @@ ProcessCommandLine(int argc, char *argv[]) else if (strcmp(argv[i], "-displayfd") == 0) { if (++i < argc) { displayfd = atoi(argv[i]); - display = NULL; #ifdef LOCK_SERVER nolock = TRUE; #endif -- cgit v1.2.3