summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac7
-rw-r--r--hw/xwin/InitOutput.c188
-rw-r--r--hw/xwin/Makefile.am6
-rwxr-xr-xhw/xwin/XWin.exe.manifest16
-rw-r--r--hw/xwin/XWin.man.pre401
-rw-r--r--hw/xwin/XWin.rc52
-rw-r--r--hw/xwin/system.XWinrc (renamed from hw/xwin/_usr_X11R6_lib_X11_system.XWinrc)7
-rw-r--r--hw/xwin/winclipboardthread.c3
-rw-r--r--hw/xwin/wincursor.c3
-rwxr-xr-xhw/xwin/windialogs.c6
-rw-r--r--hw/xwin/winerror.c2
-rw-r--r--hw/xwin/winkeybd.c4
-rw-r--r--hw/xwin/winmultiwindowshape.c3
-rw-r--r--hw/xwin/winmultiwindowwindow.c7
-rw-r--r--hw/xwin/winmultiwindowwm.c124
-rw-r--r--hw/xwin/winprefs.c4
-rw-r--r--hw/xwin/winprefslex.l2
-rw-r--r--hw/xwin/winprefsyacc.y4
-rwxr-xr-xhw/xwin/winprocarg.c1
-rw-r--r--hw/xwin/winwindow.h1
-rw-r--r--include/xwin-config.h.in12
-rw-r--r--os/utils.c4
22 files changed, 502 insertions, 355 deletions
diff --git a/configure.ac b/configure.ac
index a1e8a1c42..e3280b4d7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -427,6 +427,9 @@ case $host_os in
darwin*)
AC_DEFINE(CSRG_BASED, 1, [System is BSD-like])
;;
+ cygwin*)
+ CFLAGS="$CFLAGS -DFD_SETSIZE=256"
+ ;;
esac
dnl augment XORG_RELEASE_VERSION for our snapshot number and to expose the
@@ -1829,7 +1832,9 @@ AC_MSG_RESULT([$XWIN])
if test "x$XWIN" = xyes; then
PKG_CHECK_EXISTS($WINDOWSWMPROTO, [WINDOWSWM=yes], [WINDOWSWM=no])
+ AC_DEFINE_DIR(SYSCONFDIR, sysconfdir, [Location of system.XWinrc])
AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version])
+ AC_DEFINE_UNQUOTED(__VENDORDWEBSUPPORT__, ["$VENDOR_WEB"], [Vendor web address for support])
AC_CHECK_TOOL(WINDRES, windres)
case $host_os in
cygwin*)
@@ -1842,8 +1847,6 @@ if test "x$XWIN" = xyes; then
AC_DEFINE(ROOTLESS,1,[Build Rootless code])
CFLAGS="$CFLAGS -DROOTLESS_WORKAROUND"
fi
-
- CFLAGS="$CFLAGS -DFD_SETSIZE=256"
;;
mingw*)
XWIN_SERVER_NAME=Xming
diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index 91f5ec09b..acb7d4ab2 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -746,6 +746,29 @@ OsVendorInit (void)
static void
winUseMsg (void)
{
+ ErrorF("\n");
+ ErrorF("\n");
+ 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"
+ "\tthe updated region when num_boxes, or more, are in the\n"
+ "\tupdated region.\n");
+
+#ifdef XWIN_XF86CONFIG
+ ErrorF ("-config\n"
+ "\tSpecify a configuration file.\n");
+
+ ErrorF ("-configdir\n"
+ "\tSpecify a configuration directory.\n");
+#endif
+
ErrorF ("-depth bits_per_pixel\n"
"\tSpecify an optional bitdepth to use in fullscreen mode\n"
"\twith a DirectDraw engine.\n");
@@ -754,6 +777,15 @@ winUseMsg (void)
"\tEmulate 3 button mouse with an optional timeout in\n"
"\tmilliseconds.\n");
+#ifdef XWIN_EMULATEPSEUDO
+ ErrorF ("-emulatepseudo\n"
+ "\tCreate a depth 8 PseudoColor visual when running in\n"
+ "\tdepths 15, 16, 24, or 32, collectively known as TrueColor\n"
+ "\tdepths. The PseudoColor visual does not have correct colors,\n"
+ "\tand it may crash, but it at least allows you to run your\n"
+ "\tapplication in TrueColor modes.\n");
+#endif
+
ErrorF ("-engine engine_type_id\n"
"\tOverride the server's automatically selected engine type:\n"
"\t\t1 - Shadow GDI\n"
@@ -766,135 +798,121 @@ winUseMsg (void)
ErrorF ("-fullscreen\n"
"\tRun the server in fullscreen mode.\n");
-
- ErrorF ("-refresh rate_in_Hz\n"
- "\tSpecify an optional refresh rate to use in fullscreen mode\n"
- "\twith a DirectDraw engine.\n");
- ErrorF ("-screen scr_num [width height [x y] | [[WxH[+X+Y]][@m]] ]\n"
- "\tEnable screen scr_num and optionally specify a width and\n"
- "\theight and initial position for that screen. Additionally\n"
- "\ta monitor number can be specified to start the server on,\n"
- "\tat which point, all coordinates become relative to that\n"
- "\tmonitor (Not for Windows NT4 and 95). Examples:\n"
- "\t -screen 0 800x600+100+100@2 ; 2nd monitor offset 100,100 size 800x600\n"
- "\t -screen 0 1024x768@3 ; 3rd monitor size 1024x768\n"
- "\t -screen 0 @1 ; on 1st monitor using its full resolution (the default)\n");
-
- ErrorF ("-lesspointer\n"
- "\tHide the windows mouse pointer when it is over an inactive\n"
- "\t" PROJECT_NAME " window. This prevents ghost cursors appearing where\n"
- "\tthe Windows cursor is drawn overtop of the X cursor\n");
-
- ErrorF ("-nodecoration\n"
- "\tDo not draw a window border, title bar, etc. Windowed\n"
- "\tmode only.\n");
+ ErrorF ("-ignoreinput\n"
+ "\tIgnore keyboard and mouse input.\n");
#ifdef XWIN_MULTIWINDOWEXTWM
- ErrorF ("-mwextwm\n"
- "\tRun the server in multi-window external window manager mode.\n");
-
ErrorF ("-internalwm\n"
"\tRun the internal window manager.\n");
#endif
- ErrorF ("-rootless\n"
- "\tRun the server in rootless mode.\n");
+#ifdef XWIN_XF86CONFIG
+ ErrorF ("-keyboard\n"
+ "\tSpecify a keyboard device from the configuration file.\n");
+#endif
+
+ ErrorF ("-[no]keyhook\n"
+ "\tGrab special Windows keypresses like Alt-Tab or the Menu "
+ "key.\n");
+
+ ErrorF ("-lesspointer\n"
+ "\tHide the windows mouse pointer when it is over any\n"
+ "\t" EXECUTABLE_NAME " window. This prevents ghost cursors appearing when\n"
+ "\tthe Windows cursor is drawn on top of the X cursor\n");
+
+ ErrorF ("-logfile filename\n"
+ "\tWrite log messages to <filename>.\n");
+
+ ErrorF ("-logverbose verbosity\n"
+ "\tSet the verbosity of log messages. [NOTE: Only a few messages\n"
+ "\trespect the settings yet]\n"
+ "\t\t0 - only print fatal error.\n"
+ "\t\t1 - print additional configuration information.\n"
+ "\t\t2 - print additional runtime information [default].\n"
+ "\t\t3 - print debugging and tracing information.\n");
+
+ ErrorF ("-[no]multimonitors or -[no]multiplemonitors\n"
+ "\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
- ErrorF ("-multiplemonitors\n"
- "\tEXPERIMENTAL: Use the entire virtual screen if multiple\n"
- "\tmonitors are present.\n");
+#ifdef XWIN_MULTIWINDOWEXTWM
+ ErrorF ("-mwextwm\n"
+ "\tRun the server in multi-window external window manager mode.\n");
+#endif
-#ifdef XWIN_CLIPBOARD
- ErrorF ("-[no]clipboard\n"
- "\tEnable [disable] the clipboard integration. Default is enabled.\n");
+ ErrorF ("-nodecoration\n"
+ "\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 NT-based platform.\n");
+ "\tDo not use Unicode clipboard even if on a NT-based platform.\n");
#endif
+ ErrorF ("-refresh rate_in_Hz\n"
+ "\tSpecify an optional refresh rate to use in fullscreen mode\n"
+ "\twith a DirectDraw engine.\n");
+
+ ErrorF ("-rootless\n"
+ "\tRun the server in rootless mode.\n");
+
+ ErrorF ("-screen scr_num [width height [x y] | [[WxH[+X+Y]][@m]] ]\n"
+ "\tEnable screen scr_num and optionally specify a width and\n"
+ "\theight and initial position for that screen. Additionally\n"
+ "\ta monitor number can be specified to start the server on,\n"
+ "\tat which point, all coordinates become relative to that\n"
+ "\tmonitor (Not for Windows NT4 and 95). Examples:\n"
+ "\t -screen 0 800x600+100+100@2 ; 2nd monitor offset 100,100 size 800x600\n"
+ "\t -screen 0 1024x768@3 ; 3rd monitor size 1024x768\n"
+ "\t -screen 0 @1 ; on 1st monitor using its full resolution (the default)\n");
+
ErrorF ("-scrollbars\n"
"\tIn windowed mode, allow screens bigger than the Windows desktop.\n"
"\tMoreover, if the window has decorations, one can now resize\n"
"\tit.\n");
+ ErrorF ("-silent-dup-error\n"
+ "\tIf another instance of " EXECUTABLE_NAME " with the same display number is running\n"
+ "\texit silently and don’t display any error message.\n");
+
+ ErrorF ("-swcursor\n"
+ "\tDisable the usage of the Windows cursor and use the X11 software\n"
+ "\tcursor instead.\n");
+
ErrorF ("-[no]trayicon\n"
"\tDo not create a tray icon. Default is to create one\n"
"\ticon per screen. You can globally disable tray icons with\n"
"\t-notrayicon, then enable it for specific screens with\n"
"\t-trayicon for those screens.\n");
- ErrorF ("-clipupdates num_boxes\n"
- "\tUse a clipping region to constrain shadow update blits to\n"
- "\tthe updated region when num_boxes, or more, are in the\n"
- "\tupdated region. Currently supported only by `-engine 1'.\n");
-
-#ifdef XWIN_EMULATEPSEUDO
- ErrorF ("-emulatepseudo\n"
- "\tCreate a depth 8 PseudoColor visual when running in\n"
- "\tdepths 15, 16, 24, or 32, collectively known as TrueColor\n"
- "\tdepths. The PseudoColor visual does not have correct colors,\n"
- "\tand it may crash, but it at least allows you to run your\n"
- "\tapplication in TrueColor modes.\n");
-#endif
-
ErrorF ("-[no]unixkill\n"
"\tCtrl+Alt+Backspace exits the X Server.\n");
ErrorF ("-[no]winkill\n"
"\tAlt+F4 exits the X Server.\n");
-#ifdef XWIN_XF86CONFIG
- ErrorF ("-config\n"
- "\tSpecify a configuration file.\n");
-
- ErrorF ("-configdir\n"
- "\tSpecify a configuration directory.\n");
-
- ErrorF ("-keyboard\n"
- "\tSpecify a keyboard device from the configuration file.\n");
-#endif
-
- ErrorF ("-xkbrules XKBRules\n"
- "\tEquivalent to XKBRules in XF86Config files.\n");
-
- ErrorF ("-xkbmodel XKBModel\n"
- "\tEquivalent to XKBModel in XF86Config files.\n");
-
ErrorF ("-xkblayout XKBLayout\n"
"\tEquivalent to XKBLayout in XF86Config files.\n"
"\tFor example: -xkblayout de\n");
- ErrorF ("-xkbvariant XKBVariant\n"
- "\tEquivalent to XKBVariant in XF86Config files.\n"
- "\tFor example: -xkbvariant nodeadkeys\n");
+ ErrorF ("-xkbmodel XKBModel\n"
+ "\tEquivalent to XKBModel in XF86Config files.\n");
ErrorF ("-xkboptions XKBOptions\n"
"\tEquivalent to XKBOptions in XF86Config files.\n");
- ErrorF ("-logfile filename\n"
- "\tWrite logmessages to <filename> instead of /tmp/Xwin.log.\n");
-
- ErrorF ("-logverbose verbosity\n"
- "\tSet the verbosity of logmessages. [NOTE: Only a few messages\n"
- "\trespect the settings yet]\n"
- "\t\t0 - only print fatal error.\n"
- "\t\t1 - print additional configuration information.\n"
- "\t\t2 - print additional runtime information [default].\n"
- "\t\t3 - print debugging and tracing information.\n");
-
- ErrorF ("-[no]keyhook\n"
- "\tGrab special windows key combinations like Alt-Tab or the Menu "
- "key.\n These keys are discarded by default.\n");
+ ErrorF ("-xkbrules XKBRules\n"
+ "\tEquivalent to XKBRules in XF86Config files.\n");
- ErrorF ("-swcursor\n"
- "\tDisable the usage of the windows cursor and use the X11 software "
- "cursor instead\n");
+ ErrorF ("-xkbvariant XKBVariant\n"
+ "\tEquivalent to XKBVariant in XF86Config files.\n"
+ "\tFor example: -xkbvariant nodeadkeys\n");
}
/* See Porting Layer Definition - p. 57 */
diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am
index a76b56957..8b1897235 100644
--- a/hw/xwin/Makefile.am
+++ b/hw/xwin/Makefile.am
@@ -151,7 +151,7 @@ XWin_DEPENDENCIES = $(XWIN_LIBS)
XWin_LDADD = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS)
.rc.o:
- $(WINDRES) --use-temp-file -i $< --input-format=rc -o $@ -O coff -DPROJECT_NAME=\"$(VENDOR_NAME_SHORT)\"
+ $(WINDRES) --use-temp-file -i $< --input-format=rc -o $@ -O coff -I $(top_builddir)/include
XWin_LDFLAGS = -mwindows -static
@@ -190,12 +190,14 @@ XWinrc.$(FILE_MAN_SUFFIX): XWinrc.man
EXTRAMANDEFS = -D__logdir__=$(logdir) -D__sysconfdir__=$(sysconfdir) -D__datadir__=$(datadir)
+xwinconfigdir = $(sysconfdir)/X11
+xwinconfig_DATA = system.XWinrc
+
include $(top_srcdir)/cpprules.in
EXTRA_DIST = \
$(GLX_EXTRAS) \
$(MAN_SRCS) \
- _usr_X11R6_lib_X11_system.XWinrc \
X.ico \
XWin.rc \
xlaunch/config.cc \
diff --git a/hw/xwin/XWin.exe.manifest b/hw/xwin/XWin.exe.manifest
new file mode 100755
index 000000000..221150d52
--- /dev/null
+++ b/hw/xwin/XWin.exe.manifest
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+ <description>The XWin X Windows server for Cygwin.</description>
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity
+ type="win32"
+ name="Microsoft.Windows.Common-Controls"
+ version="6.0.0.0"
+ processorArchitecture="X86"
+ publicKeyToken="6595b64144ccf1df"
+ language="*"
+ />
+ </dependentAssembly>
+ </dependency>
+</assembly>
diff --git a/hw/xwin/XWin.man.pre b/hw/xwin/XWin.man.pre
index 0bad65c60..6b28b51d4 100644
--- a/hw/xwin/XWin.man.pre
+++ b/hw/xwin/XWin.man.pre
@@ -9,83 +9,171 @@ XWin \- X Server for the Cygwin environment on Microsoft Windows
.SH DESCRIPTION
-.I XWin is an X Server for the X Window System on the Cygwin environment
+\fIXWin\fP is an X Server for the X Window System on the Cygwin environment
running on Microsoft Windows.
.SH MODES
-\fIXWin\fP can operate in five different and incompatible modes:
+\fIXWin\fP can operate in 3 different modes:
.br
-* \fISingle Window\fP: This is the default option. The X server
-appears as a single Windows window and all X windows are contained
-within this window. This mode requires an external window manager.
-.br
-* \fINo Decoration\fP: This mode is like single window mode except
-that the X server window does not have a title bar or border, thus
-maximizing the amount of space available for X windows within the X
-server window. This mode requires an external window manager.
-.br
-* \fIFull Screen\fP: This mode is like single window mode except that
-the X server window takes the full screen, covering completely the
-Windows desktop. This mode requires an external window manager.
-.br
-* \fIRootless\fP: The X server works on a window covering the whole
-screen but the root window (traditionally covered with an X hatch
-pattern) is hidden from view. This mode requires an external window
-manager.
+* \fISingle Window\fP: This is the default mode. Each X screen
+appears as a single \fIWindows\fP window and all X windows are contained
+within this window.
+(In X terminology, the \fIWindows\fP window contains the root window for
+the screen)
.br
* \fIMulti-Window\fP: In this mode \fIXWin\fP uses its own integrated
window manager in order to handle the top-level X windows, in such a
-way that they appear as normal Windows windows.
+way that they appear as normal \fIWindows\fP windows.
+.br
+* \fIRootless\fP: In this mode the X server works in a window
+containing the whole screen but this root window (traditionally covered with an X hatch
+pattern) is hidden from view, so only top-level X windows are seen.
+
+.SH OPTIONS
+In addition to the normal server options described in the \fIXserver(1)\fP
+manual page, \fIXWin\fP accepts the following command line switches,
+\fIall\fP of which are optional:
+
+.SH OPTIONS CONTROLLING WINDOWING MODE
+Only one of these options may be specified.
+.TP 8
+.B (default)
+Windowed or rooted mode.
+Each X screen appears as a single \fIWindows\fP window and all X windows are
+contained within those windows.
+.TP 8
+.B \-multiwindow
+Each top-level X window appears in its own \fIWindows\fP window.
+Also start the integrated \fIWindows\fP-based window manager.
+.TP 8
+.B \-rootless
+Run the server in rootless mode.
+The X server works on a window covering the whole screen but the root window
+is hidden from view.
+.TP 8
+.B \-mwextwm
+Experimental.
+The mode combines \fB\-rootless\fP mode drawing with native \fIWindows\fP
+window frames managed by the experimental external window manager \fIxwinwm\fP.
.PP
-NOTE: \fIMulti-Window\fP mode will crash if an external window manager
-such as \fItwm\fP or \fIfvwm\fP is launched since \fIMulti-Window\fP
-uses its own internal window manager; all other modes require an
-external window manager in order to move, resize, and perform other
+\fBNOTE:\fP \fI-multiwindow\fP mode uses its own internal window manager.
+All other modes require an external window manager in order to move, resize, and perform other
operations on the individual X windows.
+.SH OPTIONS FOR SPECIFYING X SCREENS
+An X display may be composed of multiple screens.
+The default behaviour is to create a single screen 0 that is roughly the
+size of useful area of the primary monitor (allowing for any window
+decorations and the task-bar).
-.SH LOG
-As it runs \fIXWin\fP writes messages indicating the most relevant events
-to the console
-from which it was called and to a log file that by default is located at \fI
-__logdir__/XWin.0.log\fP. This file is mainly for debugging purposes.
+Screen specific parameters, such as \fB\-fullscreen\fP, can be applied as a
+default to all screens by placing those screen specific parameters
+before any \fB\-screen\fP parameter. Screen specific parameters placed after
+the first \fB\-screen\fP parameter will apply only to the immediately
+preceeding \fB\-screen\fP parameter.
+.TP 8
+.B \-[no]multimonitors or \-[no]multiplemonitors
+Create a screen 0 that covers all monitors [the primary monitor] on a system with
+multiple monitors.
+This option is currently enabled by default in \fB\-multiwindow\fP mode.
+.TP 8
+.B "\-screen \fIscreen_number\fP [\fIW\fP \fIH\fP [\fIX\fP \fIY\fP] | [[\fIW\fPx\fIH\fP[+\fIX\fP+\fIY\fP]][@\fIM\fP]] ] "
+Create screen number
+.I screen_number
+and optionally specify it's
+.I height,
+.I width
+and
+.I initial position.
+Additionally a
+.I
+monitor number
+(which count from 1) can be specified to place the screen on,
+at which point, all coordinates become relative to that monitor.
+Screen numbers must be contiguous starting from zero and cannot be duplicated.
+Examples:
-.SH PREFERENCES FILE
-On startup \fIXWin\fP looks for the file \fI$HOME/.XWinrc\fP or, if
-the previous file does not exist, \fI
-__sysconfdir__/X11/system.XWinrc\fP. \fI.XWinrc\fP allows setting
-preferences for the following:
-.br
-1- To include items into the menu associated with the \fIXWin\fP icon
-which is in the \fIWindows\fP system tray. This functions in all
-modes that have a tray icon.
-.br
-2- To include items in the menu which is associated with the Windows
-window that \fIXWin -multiwindow\fP produces for each top-level X
-window. That can be done both for the generic case and for particular
-programs.
-.br
-3- To change the icon that is associated to the Windows window that
-\fIXWin -multiwindow\fP produces for each top-level X-window. Again,
-that can be done both for the generic case and for particular
-programs.
-.PP
-The format of the \fI.XWinrc\fP file is given in the man page XWinrc(5).
+.I " -screen 0 @1 ; on 1st monitor using its full resolution (the default)"
+.I " -screen 0 800x600+100+100@2 ; on 2nd monitor offset 100,100 size 800x600"
-.SH OPTIONS
-In addition to the normal server options described in the \fIXserver(1)\fP
-manual page, \fIXWin\fP accepts the following command line switches,
-\fIall\fP of which are optional:
+.I " -screen 0 1024x768@3 ; on 3rd monitor size 1024x768"
+
+.SH OPTIONS CONTROLLING THE APPEARANCE OF THE X SCREEN WINDOWS
+These parameters only apply to windowed mode screens i.e. not
+in \fB-multwindow\fP or \fB-rootless\fP mode
+.TP 8
+.B "\-fullscreen"
+The X server window takes the full screen, covering completely the
+\fIWindows\fP desktop.
+.TP 8
+.B \-nodecoration
+Do not give the Cygwin/X window a \fIWindows\fP window border, title bar,
+etc.
+This parameter is ignored when the \fB\-fullscreen\fP parameter is specified.
+.TP 8
+.B \-scrollbars
+In windowed mode, allow screens bigger than the \fIWindows\fP desktop.
+Moreover, if the window has decorations, one can now resize it.
+This parameter is ignored when the \fB\-fullscreen\fP parameter is specified.
+
+
+.SH OPTIONS CONTROLLING WINDOWS INTEGRATION
.TP 8
.B \-[no]clipboard
Enables [disables] the integration between the Cygwin/X clipboard and
-Windows clipboard. The default is enabled.
+\fIWindows\fP clipboard. The default is enabled.
+.TP 8
+.B "\-emulate3buttons [\fItimeout\fP]"
+Emulate a three button mouse; pressing both buttons within
+.I timeout
+milliseconds causes an emulated middle button press. The default
+.I timeout
+is 50 milliseconds. Note that most mice with scroll wheel have middle
+button functionality, usually you will need this option only if you have
+a two button mouse without scroll wheel.
+.TP 8
+.B \-[no]keyhook
+Enable [disable] a low-level keyboard hook for catching
+special keypresses like Menu and Alt+Tab and passing them to the X
+Server instead of letting \fIWindows\fP handle them.
+.TP 8
+.B \-lesspointer
+Normally the \fIWindows\fP mouse cursor is hidden when the mouse is
+over an active Cygwin/X window. This option causes the mouse cursor
+also to be hidden when it is over an inactive Cygwin/X window. This
+prevents the \fIWindows\fP mouse cursor from being drawn on top of the X
+cursor.
+This parameter has no effect unless \fB-swcursor\fP is also specified.
+.TP 8
+.B \-swcursor
+Disable the usage of the \fIWindows\fP cursor and use the X11 software cursor instead.
+.TP 8
+.B \-[no]trayicon
+Do not create a tray icon. Default is to create one
+icon per screen. You can globally disable tray icons with
+\fB\-notrayicon\fP, then enable it for specific screens with
+\fB\-trayicon\fP for those screens.
+.TP 8
+.B \-nounicodeclipboard
+Do not use Unicode clipboard even if on a NT-based platform.
+.TP 8
+.B \-[no]unixkill
+Enable or disable the \fICtrl-Alt-Backspace\fP key combination as a
+signal to exit the X Server. The \fICtrl-Alt-Backspace\fP key combination
+is disabled by default.
+.TP 8
+.B \-[no]winkill
+Enable or disable the \fIAlt-F4\fP key combination as a signal to exit the
+X Server.
+The \fIAlt-F4\fP key combination is enabled by default.
+
+.SH DRAWING ENGINE OPTIONS
.TP 8
.B "\-clipupdates \fInum_boxes\fP"
-Specify an optional threshold, above which the boxes in a shadow
+Specify an optional threshold, above which the regions in a shadow
update operation will be collected into a GDI clipping region. The
clipping region is then used to do a single bit block transfer that is
constrained to the updated area by the clipping region. There is some
@@ -94,36 +182,24 @@ the clipping region, thus there may not be much benefit for a small
number of boxes (less than 10). It is even possible that this
functionality does not provide a benefit at any number of boxes; we
can only determine the usefulness of this feature through testing.
+This option probably has limited effect on current \fIWindows\fP versions
+as they already perform GDI batching.
This parameter works in conjunction with engines 1, 2, and 4 (Shadow
GDI, Shadow DirectDraw, and Shadow DirectDraw Non-Locking,
respectively).
.TP 8
-.B "\-emulate3buttons \fItimeout\fP"
-Emulate a three button mouse; pressing both buttons within
-.I timeout
-milliseconds causes an emulated middle button press. The default
-.I timeout
-is 50 milliseconds. Note that most mice with scroll wheel have middle
-button functionality, usually you will need this option only if you have
-a two button mouse without scroll wheel.
-.TP 8
-.B \-emulatepseudo
-Create a depth 8 PseudoColor visual when running in depths 15, 16, 24,
-or 32, collectively known as TrueColor depths.
- At this date (April 2004) this option is not still operative.
-.TP 8
.B "\-engine \fIengine_type_id\fP"
This option, which is intended for Cygwin/X developers,
-overrides the server's automatically supported engine type. This
+overrides the server's automatically selected engine type. This
parameter will be ignored if the specified engine type is not
supported on the current system. The supported engine type ids are 1
-- Shadow GDI, 2 - Shadow DirectDraw, and 4 - Shadow DirectDraw4.
-Additionally, there is a barely functional experimental engine type id
-16 - Native GDI.
-.TP 8
-.B "\-fullscreen [-depth \fIdepth\fP] [-refresh \fIrate_in_Hz\fP]"
-Run the server in fullscreen mode, as opposed to the default windowed
-mode.
+- Shadow GDI, 2 - Shadow DirectDraw, and 4 - Shadow DirectDraw Non-Locking.
+Additionally, there are engines with type ids
+8 - Primary DirectDraw (obsolete) and 16 - Native GDI (experimental and barely functional).
+Default behavior is to determine the engine with optimum performance that
+supports the specified depth and window configuration.
+
+.SH FULLSCREEN OPTIONS
.TP 8
.B "\-depth \fIdepth\fP"
Specify the color depth, in bits per pixel, to use when running in
@@ -134,104 +210,37 @@ fullscreen with a DirectDraw engine. This parameter is ignored if
Specify an optional refresh rate to use when running in
fullscreen with a DirectDraw engine. This parameter is ignored if
\fB\-fullscreen\fP is not specified.
+
+.SH MISCELLANEOUS OPTIONS
+See also the normal server options described in the \fIXserver(1)\fP
+manual page
+
.TP 8
.B \-help
-Write a help text to the console and to the log file.
+Write a help text listing supported command line options and their description to the console.
.TP 8
.B \-ignoreinput
Ignore keyboard and mouse input. This is usually only used for testing
and debugging purposes.
.TP 8
-.B \-[no]keyhook
-Enable [disable] a low-level keyboard hook for catching
-special key combinations like Alt+Tab and passing them to the X
-Server instead of letting \fIWindows\fP handle them.
-.TP 8
-.B \-lesspointer
-Hide the Windows mouse cursor when the mouse is over any Cygwin/X
-window (regardless of whether that window is active or inactive). This
-prevents the Windows mouse cursor from being placed overtop of the X
-cursor.
-.TP 8
-.B "\-logfile \fIFile_Name\fP"
-Change the log file from the default located at \fI
-__logdir__/XWin.0.log\fP to the one indicated by \fIFile_Name\fP.
+.B "\-logfile \fIfilename\fP"
+Change the server log file from the default of \fI
+__logdir__/XWin.n.log\fP,
+where \fIn\fP is the display number of the XWin server, to \fIfilename\fP.
.TP 8
.B "\-logverbose \fIlevel\fP"
Control the degree of verbosity of the log messages with the integer
parameter \fIlevel\fP. For \fIlevel\fP=0 only fatal errors are
-reported, for \fIlevel\fP=1 (default) simple information about
-configuration is also given, for \fIlevel\fP=2 a detailed log
+reported, for \fIlevel\fP=1 simple information about
+configuration is also given, for \fIlevel\fP=2 (default)
+additional runtime information is recorded
+and for \fIlevel\fP=3 detailed log
information (including trace and debug output) is produced. Bigger
-values will yield a still more detailed debug output. At this date
-(April 2004) the option is still not fully operative; the default
-value is 2 and the output is insensitive to the level value.
-.TP 8
-.B \-multimonitors
-Create a root window that covers all monitors on a system with
-multiple monitors.
-.TP 8
-.B \-multiwindow
-Start the integrated \fIWindowsi\fP-based window manager, which launches each
-top-level X window in its own \fIWindows\fP window. Not to be used together
-with \fB\-rootless\fP nor \fB\-fullscreen\fP.
-.TP 8
-.B \-nodecoration
-Do not give the Cygwin/X window a Windows window border, title bar,
-etc. This parameter only applies to windowed mode screens, i.e., this
-parameter is ignored when the \fB\-fullscreen\fP parameter is specified.
-.TP 8
-.B \-nounicodeclipboard
-Do not use Unicode clipboard even if NT-based platform.
-.TP 8
-.B \-rootless
-Run the server in rootless mode. Not to be used with \fB\-multiwindow\fP
-nor with \fB\-fullscreen\fP.
-.TP 8
-.B "\-screen \fIscreen_number\fP \fIwidth\fP \fIheight\fP"
-This parameter may be used to specify the
-.I screen_number,
-.I height,
-and
-.I width
-of one or several Cygwin/X screens; each Cygwin/X screen will be
-opened in its own window. When using multiple screens, be sure not to
-duplicate any screen numbers.
-.I XWin
-default behavior is to create a single screen that is roughly
-the size of the current Windows display area.
-Screen specific parameters, such as \fB\-fullscreen\fP, can be applied as a
-default to all screens by placing those screen specific parameters
-before any \fB\-screen\fP parameter. Screen specific parameters placed after
-the first \fB\-screen\fP parameter will apply only to the immediately
-preceeding \fB\-screen\fP parameter.
-.TP 8
-.B \-scrollbars
-In windowed mode, allow screens bigger than the Windows desktop.
-Moreover, if the window has decorations, one can now resize it.
-.TP 8
-.B \-[no]trayicon
-Do not create a tray icon. Default is to create one
-icon per screen. You can globally disable tray icons with
-\fB\-notrayicon\fP, then enable it for specific screens with
-\fB\-trayicon\fP for those screens.
-.TP 8
-.B \-[no]unixkill
-Enable or disable the \fICtrl-Alt-Backspace\fP key combination as a
-signal to exit the X Server. The \fICtrl-Alt-Backspace\fP key combination
-is disabled by default.
-.TP 8
-.B \-[no]winkill
-Enable or disable the \fIAlt-F4\fP key combination as a signal to exit the
-X Server.
-The \fIAlt-F4\fP key combination is enabled by default.
-.TP 8
-.B \-swcursor
-Disable the usage of the windows cursor and use the X11 software cursor instead.
+values will yield a still more detailed debug output.
.TP 8
.B \-silent-dup-error
-If another instance of XWin is found running, exit silently and don't display
-the error message.
+If another instance of \fIXWin\fP with the same display number is found running,
+exit silently and don't display any error message.
.TP 8
.B "\-xkblayout \fIlayout\fP"
.TP 8
@@ -251,10 +260,60 @@ in order to load a German layout for a pc105 keyboard one uses
the options:
.br
.I " \-xkblayout de \-xkbmodel pc105"
+
+Alternatively one may use the \fIsetxkbmap\fP program after \fIXWin\fP is
+running.
+
+The default is to select a layout matching your current layout as
+reported by \fIWindows\fP if known, or the default X server layout
+if no matching keyboard layout was found.
+
+.SH UNDOCUMENTED OPTIONS
+These options are undocumented. Do not use them.
+
+.TP 8
+.B \-emulatepseudo
+Create a depth 8 PseudoColor visual when running in depths 15, 16, 24,
+or 32, collectively known as TrueColor depths.
+Color map manipulation is not supported, so the PseudoColor visual will
+not have the correct colors.
+This option is intended to allow applications which only work with a depth 8
+visual to operate in TrueColor modes.
+.TP 8
+.B \-internalwm
+Run the internal window manager.
+
+.SH LOG FILE
+As it runs \fIXWin\fP writes messages indicating the most relevant events
+to the console
+from which it was called and to a log file that by default is located at \fI
+__logdir__/XWin.0.log\fP. This file is mainly for debugging purposes.
+
+
+.SH PREFERENCES FILE
+On startup \fIXWin\fP looks for the file \fI$HOME/.XWinrc\fP or, if
+the previous file does not exist, \fI
+__sysconfdir__/X11/system.XWinrc\fP. \fI.XWinrc\fP allows setting
+preferences for the following:
+.br
+* To include items into the menu associated with the \fIXWin\fP icon
+which is in the \fIWindows\fP system tray. This functions in all
+modes that have a tray icon.
+.br
+* To include items in the system menu which is associated with the \fIWindows\fP
+window that \fIXWin -multiwindow\fP produces for each top-level X
+window, in both the generic case and for particular programs.
+.br
+* To change the icon that is associated to the \fIWindows\fP window that
+\fIXWin -multiwindow\fP produces for each top-level X-window.
+.br
+* To change the style that is associated to the \fIWindows\fP window that
+\fXWin I-multiwindow\fP produces for each top-level X window.
.PP
-Alternatively one may use the \fIsetxkbmap\fP program after XWin is
-running or even the \fIxmodmap\fP program for loading the old-style
-keyboard maps.
+The format of the \fI.XWinrc\fP file is given in the man page XWinrc(5).
+
+.SH EXAMPLES
+Need some examples
.SH "SEE ALSO"
@@ -268,10 +327,9 @@ ones are:
.br
- The display mode can not be changed once the X server has started.
.br
-- The XWin software is developing rapidly; it is therefore likely that
+- The \fIXWin\fP software is continuously developing; it is therefore possible that
this man page is not up to date. It is always prudent to
-look also at the output of \fIXWin -help\fP and to the Cygwin/X User Guide
-at /usr/share/doc/cygwin-x-doc-x.x.x/ug/cygwin-x-ug.xxx in order to
+look also at the output of \fIXWin -help\fP in order to
check the options that are operative.
@@ -282,6 +340,7 @@ Adamson, Michael Bax, Jehan Bing, Lev Bishop, Dr. Peter Busch, Biju G
C, Robert Collins, Nick Crabtree, Early Ehlinger, Christopher Faylor,
John Fortin, Brian Genisio, Fabrizio Gennari, Alexander Gottwald, Ralf
Habacker, Colin Harrison, Matthieu Herrb, Alan Hourihane, Pierre A
-Humblet, Harold L Hunt II, Dakshinamurthy Karra, Kensuke Matsuzaki,
-Takuma Murakami, Earle F. Philhower III, Benjamin Riefenstahl, Suhaib
-Siddiqi, Jack Tanner, and Nicholas Wourms.
+Humblet, Harold L Hunt II, Dakshinamurthy Karra, Joe Krahn,
+Paul Loewenstein, Kensuke Matsuzaki,
+Takuma Murakami, Earle F. Philhower III, Benjamin Riefenstahl, Yaakov Selkowitz,
+Suhaib Siddiqi, Jack Tanner, Jon Turney and Nicholas Wourms.
diff --git a/hw/xwin/XWin.rc b/hw/xwin/XWin.rc
index df2664dca..539bd0e4d 100644
--- a/hw/xwin/XWin.rc
+++ b/hw/xwin/XWin.rc
@@ -1,5 +1,6 @@
/*
*Copyright (C) 2002-2004 Harold L Hunt II All Rights Reserved.
+ *Copyright (C) 2008 Yaakov Selkowitz All Rights Reserved
*
*Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
@@ -20,39 +21,37 @@
*CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
*WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
- *Except as contained in this notice, the name of Harold L Hunt II
+ *Except as contained in this notice, the names of the authors
*shall not be used in advertising or otherwise to promote the sale, use
*or other dealings in this Software without prior written authorization
- *from Harold L Hunt II.
+ *from the authors.
*
- * Authors: Harold L Hunt II
+ * Authors: Harold L Hunt II, Yaakov Selkowitz
*/
-#include "windows.h"
+#include <windows.h>
#include "winresource.h"
+#include "xwin-config.h"
+#include "version-config.h"
/*
* Dialogs
*/
/* About */
-ABOUT_BOX DIALOGEX 32, 32, 240, 105
+ABOUT_BOX DIALOGEX 32, 32, 260, 105
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | WS_TABSTOP | DS_CENTERMOUSE
-CAPTION "About " PROJECT_NAME
-FONT 8, "MS Sans Serif"
+CAPTION "About " XVENDORNAMESHORT
+FONT 8, "MS Shell Dlg 2"
BEGIN
- CONTROL PROJECT_NAME " Website", ID_ABOUT_WEBSITE, "Button",
- BS_OWNERDRAW | WS_TABSTOP, 30, 45, 75, 15
- CONTROL "Change Log", ID_ABOUT_CHANGELOG, "Button",
- BS_OWNERDRAW | WS_TABSTOP, 135, 45, 75, 15
- CONTROL "User's Guide", ID_ABOUT_UG, "Button",
- BS_OWNERDRAW | WS_TABSTOP, 30, 65, 75, 15
- CONTROL "FAQ", ID_ABOUT_FAQ, "Button",
- BS_OWNERDRAW | WS_TABSTOP, 135, 65, 75, 15
-
- DEFPUSHBUTTON "&OK", IDOK, 95, 85, 50, 15
-
- CTEXT PROJECT_NAME " X Server. Use the links below to learn more about the " PROJECT_NAME " project.", IDC_STATIC, 5, 5, 230, 35
+ CONTROL IDI_XWIN, IDC_STATIC, "Static", SS_ICON, 8, 8, 32, 32
+ LTEXT XVENDORNAMESHORT " X Server ", IDC_STATIC, 36, 8, 220, 8
+ LTEXT VENDOR_MAN_VERSION, IDC_STATIC, 36, 18, 220, 8
+ LTEXT BUILDERSTRING, IDC_STATIC, 36, 28, 220, 8
+ LTEXT "This software is licensed under the terms of the MIT/X11 License.", IDC_STATIC, 36, 48, 220, 20
+ CONTROL __VENDORDWEBSUPPORT__, ID_ABOUT_WEBSITE, "Button",
+ BS_OWNERDRAW | WS_TABSTOP, 36, 68, 68, 8
+ DEFPUSHBUTTON "&OK", IDOK, 105, 85, 50, 15
END
@@ -60,13 +59,13 @@ END
DEPTH_CHANGE_BOX DIALOGEX 32, 32, 180, 100
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | DS_CENTERMOUSE
-FONT 8, "MS Sans Serif"
-CAPTION PROJECT_NAME
+FONT 8, "MS Shell Dlg 2"
+CAPTION XVENDORNAMESHORT
BEGIN
DEFPUSHBUTTON "Dismiss", IDOK, 66, 80, 50, 14
- CTEXT PROJECT_NAME, IDC_STATIC, 40, 12, 100, 8
+ CTEXT XVENDORNAMESHORT, IDC_STATIC, 40, 12, 100, 8
CTEXT "Disruptive screen configuration change.", IDC_STATIC, 7, 40, 166, 8
- CTEXT "Restore previous resolution to use " PROJECT_NAME ".", IDC_STATIC, 7, 52, 166, 8
+ CTEXT "Restore previous resolution to use " XVENDORNAMESHORT ".", IDC_STATIC, 7, 52, 166, 8
END
@@ -74,8 +73,8 @@ END
EXIT_DIALOG DIALOGEX 32, 32, 180, 78
STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | WS_TABSTOP | DS_CENTERMOUSE
-FONT 8, "MS Sans Serif"
-CAPTION "Exit " PROJECT_NAME "?"
+FONT 8, "MS Shell Dlg 2"
+CAPTION "Exit " XVENDORNAMESHORT "?"
BEGIN
PUSHBUTTON "E&xit", IDOK, 55, 56, 30, 14
DEFPUSHBUTTON "&Cancel", IDCANCEL, 95, 56, 30, 14
@@ -96,7 +95,7 @@ BEGIN
MENUITEM "&Hide Root Window", ID_APP_HIDE_ROOT
MENUITEM "&About...", ID_APP_ABOUT
MENUITEM SEPARATOR
- MENUITEM "E&xit", ID_APP_EXIT
+ MENUITEM "E&xit...", ID_APP_EXIT
END
END
@@ -106,3 +105,4 @@ END
*/
IDI_XWIN ICON "X.ico"
+CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "XWin.exe.manifest"
diff --git a/hw/xwin/_usr_X11R6_lib_X11_system.XWinrc b/hw/xwin/system.XWinrc
index 1de6e2ab0..f0771c610 100644
--- a/hw/xwin/_usr_X11R6_lib_X11_system.XWinrc
+++ b/hw/xwin/system.XWinrc
@@ -1,7 +1,7 @@
# XWin Server Resource File - EXAMPLE
# Earle F. Philhower, III
-# Place in ~/.XWinrc or in /usr/X11R6/lib/X11/system.XWinrc
+# Place in ~/.XWinrc or in /etc/X11/system.XWinrc
# Keywords are case insensitive, comments legal pretty much anywhere
# you can have an end-of-line
@@ -18,6 +18,9 @@
# ^^ This command will have any "%display%"
# string replaced with the proper display
# variable (i.e. 127.0.0.1:<display>.0)
+# (This should only rarely be needed as
+# the DISPLAY environment variable is also
+# set correctly)
# or <Menu Text> MENU <name-of-some-prior-defined-menu>
# or <Menu Text> ALWAYSONTOP
# ^^ Sets the window to display above all others
@@ -80,7 +83,7 @@
// Make some menus...
menu apps {
xterm exec "xterm"
- "Emacs" exec "emacs"
+ "Emacs" exec "emacs"
notepad exec notepad
xload exec "xload -display %display%" # Comment
}
diff --git a/hw/xwin/winclipboardthread.c b/hw/xwin/winclipboardthread.c
index e5b2dc1e0..a3809034e 100644
--- a/hw/xwin/winclipboardthread.c
+++ b/hw/xwin/winclipboardthread.c
@@ -119,8 +119,7 @@ winClipboardProc (void *pvNotUsed)
/* See if X supports the current locale */
if (XSupportsLocale () == False)
{
- ErrorF ("winClipboardProc - Locale not supported by X. Exiting.\n");
- pthread_exit (NULL);
+ ErrorF ("winClipboardProc - Warning: Locale not supported by X.\n");
}
/* Set jump point for Error exits */
diff --git a/hw/xwin/wincursor.c b/hw/xwin/wincursor.c
index ce98162ef..7f1935a5d 100644
--- a/hw/xwin/wincursor.c
+++ b/hw/xwin/wincursor.c
@@ -188,8 +188,7 @@ winLoadCursor (ScreenPtr pScreen, CursorPtr pCursor, int screen)
if (pScreenPriv->cursor.sm_cx < pCursor->bits->width ||
pScreenPriv->cursor.sm_cy < pCursor->bits->height)
{
- winErrorFVerb (2, "winLoadCursor - Windows requires %dx%d cursor\n"
- "\tbut X requires %dx%d\n",
+ winErrorFVerb (3, "winLoadCursor - Windows requires %dx%d cursor but X requires %dx%d\n",
pScreenPriv->cursor.sm_cx, pScreenPriv->cursor.sm_cy,
pCursor->bits->width, pCursor->bits->height);
}
diff --git a/hw/xwin/windialogs.c b/hw/xwin/windialogs.c
index 582b865f5..a8153535f 100755
--- a/hw/xwin/windialogs.c
+++ b/hw/xwin/windialogs.c
@@ -116,8 +116,8 @@ winDrawURLWindow (LPARAM lParam)
crText = RGB(0,0,128+64);
SetTextColor (draw->hDC, crText);
- /* Create underlined font 14 high, standard dialog font */
- font = CreateFont (-14, 0, 0, 0, FW_NORMAL, FALSE, TRUE, FALSE,
+ /* Create font 8 high, standard dialog font */
+ font = CreateFont (-8, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE,
0, 0, 0, 0, 0, "MS Sans Serif");
if (!font)
{
@@ -705,7 +705,7 @@ winAboutDlgProc (HWND hwndDialog, UINT message,
case ID_ABOUT_WEBSITE:
{
- const char * pszPath = "http://x.cygwin.com/";
+ const char * pszPath = __VENDORDWEBSUPPORT__;
int iReturn;
iReturn = ShellExecute (NULL,
diff --git a/hw/xwin/winerror.c b/hw/xwin/winerror.c
index 72ee2cfb7..9ed27c3d0 100644
--- a/hw/xwin/winerror.c
+++ b/hw/xwin/winerror.c
@@ -117,6 +117,7 @@ winMessageBoxF (const char *pszError, UINT uType, ...)
"Vendor: %s\n" \
"Release: %d.%d.%d.%d (%d)\n" \
"Contact: %s\n" \
+ "%s\n\n" \
"XWin was started with the following command-line:\n\n" \
"%s\n"
@@ -124,6 +125,7 @@ winMessageBoxF (const char *pszError, UINT uType, ...)
pszErrorF, VENDOR_STRING,
XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP, XORG_VERSION_CURRENT,
VENDOR_CONTACT,
+ BUILDERSTRING,
g_pszCommandLine);
if (!pszMsgBox)
goto winMessageBoxF_Cleanup;
diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c
index 317f14dff..a423b499a 100644
--- a/hw/xwin/winkeybd.c
+++ b/hw/xwin/winkeybd.c
@@ -273,6 +273,10 @@ winKeybdProc (DeviceIntPtr pDeviceInt, int iState)
case DEVICE_ON:
pDevice->on = TRUE;
+
+ // immediately copy the state of this keyboard device to the VCK
+ // (which otherwise happens lazily after the first keypress)
+ CopyKeyClass(pDeviceInt, inputInfo.keyboard);
break;
case DEVICE_CLOSE:
diff --git a/hw/xwin/winmultiwindowshape.c b/hw/xwin/winmultiwindowshape.c
index 44007027a..353235760 100644
--- a/hw/xwin/winmultiwindowshape.c
+++ b/hw/xwin/winmultiwindowshape.c
@@ -71,6 +71,9 @@ winUpdateRgnMultiWindow (WindowPtr pWin)
{
SetWindowRgn (winGetWindowPriv(pWin)->hWnd,
winGetWindowPriv(pWin)->hRgn, TRUE);
+
+ /* The system now owns the region specified by the region handle and will delete it when it is no longer needed. */
+ winGetWindowPriv(pWin)->hRgn = NULL;
}
diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
index 8b91296f7..87ffc6d6b 100644
--- a/hw/xwin/winmultiwindowwindow.c
+++ b/hw/xwin/winmultiwindowwindow.c
@@ -515,6 +515,13 @@ winCreateWindowsWindow (WindowPtr pWin)
iWidth = pWin->drawable.width;
iHeight = pWin->drawable.height;
+ /* ensure window actually ends up somewhere visible */
+ if (iX > GetSystemMetrics (SM_CXVIRTUALSCREEN))
+ iX = CW_USEDEFAULT;
+
+ if (iY > GetSystemMetrics (SM_CYVIRTUALSCREEN))
+ iY = CW_USEDEFAULT;
+
if (winMultiWindowGetTransientFor (pWin, &pDaddy))
{
if (pDaddy)
diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index 880ca6a1c..21d913e5e 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -153,7 +153,7 @@ static Bool
InitQueue (WMMsgQueuePtr pQueue);
static void
-GetWindowName (Display * pDpy, Window iWin, char **ppName);
+GetWindowName (Display * pDpy, Window iWin, wchar_t **ppName);
static int
SendXMessage (Display *pDisplay, Window iWin, Atom atmType, long nData);
@@ -191,7 +191,7 @@ PreserveWin32Stack(WMInfoPtr pWMInfo, Window iWindow, UINT direction);
#endif
static Bool
-CheckAnotherWindowManager (Display *pDisplay, DWORD dwScreen);
+CheckAnotherWindowManager (Display *pDisplay, DWORD dwScreen, Bool fAllowOtherWM);
static void
winApplyHints (Display *pDisplay, Window iWindow, HWND hWnd, HWND *zstyle);
@@ -416,10 +416,12 @@ InitQueue (WMMsgQueuePtr pQueue)
*/
static void
-GetWindowName (Display *pDisplay, Window iWin, char **ppName)
+GetWindowName (Display *pDisplay, Window iWin, wchar_t **ppName)
{
int nResult, nNum;
char **ppList;
+ char *pszReturnData;
+ int iLen, i;
XTextProperty xtpName;
#if CYGMULTIWINDOW_DEBUG
@@ -438,38 +440,26 @@ GetWindowName (Display *pDisplay, Window iWin, char **ppName)
#endif
return;
}
-
- /* */
- if (xtpName.encoding == XA_STRING)
- {
- /* */
- if (xtpName.value)
- {
- int size = xtpName.nitems * (xtpName.format >> 3);
- *ppName = malloc(size + 1);
- strncpy(*ppName, xtpName.value, size);
- (*ppName)[size] = 0;
- XFree (xtpName.value);
- }
-
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("GetWindowName - XA_STRING %s\n", *ppName);
-#endif
- }
- else
- {
- if (XmbTextPropertyToTextList (pDisplay, &xtpName, &ppList, &nNum) >= Success && nNum > 0 && *ppList)
- {
- *ppName = strdup (*ppList);
- XFreeStringList (ppList);
- }
- XFree (xtpName.value);
-#if CYGMULTIWINDOW_DEBUG
- ErrorF ("GetWindowName - %s %s\n",
- XGetAtomName (pDisplay, xtpName.encoding), *ppName);
-#endif
- }
+ if (Xutf8TextPropertyToTextList (pDisplay, &xtpName, &ppList, &nNum) >= Success && nNum > 0 && *ppList)
+ {
+ iLen = 0;
+ for (i = 0; i < nNum; i++) iLen += strlen(ppList[i]);
+ pszReturnData = (char *) malloc (iLen + 1);
+ pszReturnData[0] = '\0';
+ for (i = 0; i < nNum; i++) strcat (pszReturnData, ppList[i]);
+ if (ppList) XFreeStringList (ppList);
+ }
+ else
+ {
+ pszReturnData = (char *) malloc (1);
+ pszReturnData[0] = '\0';
+ }
+ iLen = MultiByteToWideChar (CP_UTF8, 0, pszReturnData, -1, NULL, 0);
+ *ppName = (wchar_t*)malloc(sizeof(wchar_t)*(iLen + 1));
+ MultiByteToWideChar (CP_UTF8, 0, pszReturnData, -1, *ppName, iLen);
+ XFree (xtpName.value);
+ free (pszReturnData);
#if CYGMULTIWINDOW_DEBUG
ErrorF ("GetWindowName - Returning\n");
@@ -506,7 +496,7 @@ SendXMessage (Display *pDisplay, Window iWin, Atom atmType, long nData)
static void
UpdateName (WMInfoPtr pWMInfo, Window iWindow)
{
- char *pszName;
+ wchar_t *pszName;
Atom atmType;
int fmtRet;
unsigned long items, remain;
@@ -550,7 +540,7 @@ UpdateName (WMInfoPtr pWMInfo, Window iWindow)
&attr);
if (!attr.override_redirect)
{
- SetWindowText (hWnd, pszName);
+ SetWindowTextW (hWnd, pszName);
winUpdateIcon (iWindow);
}
@@ -903,9 +893,7 @@ winMultiWindowXMsgProc (void *pArg)
/* See if X supports the current locale */
if (XSupportsLocale () == False)
{
- ErrorF ("winMultiWindowXMsgProc - Locale not supported by X. "
- "Exiting.\n");
- pthread_exit (NULL);
+ ErrorF ("winMultiWindowXMsgProc - Warning: locale not supported by X\n");
}
/* Release the server started mutex */
@@ -979,7 +967,7 @@ winMultiWindowXMsgProc (void *pArg)
"successfully opened the display.\n");
/* Check if another window manager is already running */
- g_fAnotherWMRunning = CheckAnotherWindowManager (pProcArg->pDisplay, pProcArg->dwScreen);
+ g_fAnotherWMRunning = CheckAnotherWindowManager (pProcArg->pDisplay, pProcArg->dwScreen, pProcArg->pWMInfo->fAllowOtherWM);
if (g_fAnotherWMRunning && !pProcArg->pWMInfo->fAllowOtherWM)
{
@@ -1030,7 +1018,7 @@ winMultiWindowXMsgProc (void *pArg)
if (pProcArg->pWMInfo->fAllowOtherWM && !XPending (pProcArg->pDisplay))
{
- if (CheckAnotherWindowManager (pProcArg->pDisplay, pProcArg->dwScreen))
+ if (CheckAnotherWindowManager (pProcArg->pDisplay, pProcArg->dwScreen, TRUE))
{
if (!g_fAnotherWMRunning)
{
@@ -1288,8 +1276,7 @@ winInitMultiWindowWM (WMInfoPtr pWMInfo, WMProcArgPtr pProcArg)
/* See if X supports the current locale */
if (XSupportsLocale () == False)
{
- ErrorF ("winInitMultiWindowWM - Locale not supported by X. Exiting.\n");
- pthread_exit (NULL);
+ ErrorF ("winInitMultiWindowWM - Warning: Locale not supported by X.\n");
}
/* Release the server started mutex */
@@ -1509,7 +1496,7 @@ winRedirectErrorHandler (Display *pDisplay, XErrorEvent *pErr)
*/
static Bool
-CheckAnotherWindowManager (Display *pDisplay, DWORD dwScreen)
+CheckAnotherWindowManager (Display *pDisplay, DWORD dwScreen, Bool fAllowOtherWM)
{
/*
Try to select the events which only one client at a time is allowed to select.
@@ -1524,8 +1511,12 @@ CheckAnotherWindowManager (Display *pDisplay, DWORD dwScreen)
/*
Side effect: select the events we are actually interested in...
+
+ If other WMs are not allowed, also select one of the events which only one client
+ at a time is allowed to select, so other window managers won't start...
*/
- XSelectInput(pDisplay, RootWindow (pDisplay, dwScreen), SubstructureNotifyMask);
+ XSelectInput(pDisplay, RootWindow (pDisplay, dwScreen),
+ SubstructureNotifyMask | ( !fAllowOtherWM ? ButtonPressMask : 0));
XSync (pDisplay, 0);
return redirectError;
}
@@ -1546,6 +1537,7 @@ winDeinitMultiWindowWM (void)
#define HINT_BORDER (1L<<1)
#define HINT_SIZEBOX (1l<<2)
#define HINT_CAPTION (1l<<3)
+#define HINT_NOMAXIMIZE (1L<<4)
/* These two are used on their own */
#define HINT_MAX (1L<<0)
#define HINT_MIN (1L<<1)
@@ -1627,7 +1619,32 @@ winApplyHints (Display *pDisplay, Window iWindow, HWND hWnd, HWND *zstyle)
if (pAtom) XFree(pAtom);
}
- /* Apply Styles, overriding hint settings from above */
+ {
+ XSizeHints *normal_hint = XAllocSizeHints();
+ long supplied;
+ if (normal_hint && (XGetWMNormalHints(pDisplay, iWindow, normal_hint, &supplied) == Success))
+ {
+ if (normal_hint->flags & PMaxSize)
+ {
+ /* Not maximizable if a maximum size is specified */
+ hint |= HINT_NOMAXIMIZE;
+
+ if (normal_hint->flags & PMinSize)
+ {
+ /*
+ If both minimum size and maximum size are specified and are the same,
+ don't bother with a resizing frame
+ */
+ if ((normal_hint->min_width == normal_hint->max_width)
+ && (normal_hint->min_height == normal_hint->max_height))
+ hint = (hint & ~HINT_SIZEBOX);
+ }
+ }
+ }
+ XFree(normal_hint);
+ }
+
+ /* Override hint settings from above with settings from config file */
style = winOverrideStyle((unsigned long)pWin);
if (style & STYLE_TOPMOST) *zstyle = HWND_TOPMOST;
else if (style & STYLE_MAXIMIZE) maxmin = (hint & ~HINT_MIN) | HINT_MAX;
@@ -1644,14 +1661,21 @@ winApplyHints (Display *pDisplay, Window iWindow, HWND hWnd, HWND *zstyle)
else if (style & STYLE_NOFRAME)
hint = (hint & ~HINT_BORDER & ~HINT_CAPTION & ~HINT_SIZEBOX) | HINT_NOFRAME;
+ /* Now apply styles to window */
style = GetWindowLongPtr(hWnd, GWL_STYLE) & ~WS_CAPTION & ~WS_SIZEBOX; /* Just in case */
if (!style) return;
- if (!hint) /* All on, but no resize of children is allowed */
- style = style | WS_CAPTION | (GetParent(hWnd) ? 0 : WS_SIZEBOX);
- else if (hint & HINT_NOFRAME); /* All off, so do nothing */
+
+ if (!hint) /* All on */
+ style = style | WS_CAPTION | WS_SIZEBOX;
+ else if (hint & HINT_NOFRAME) /* All off */
+ style = style & ~WS_CAPTION & ~WS_SIZEBOX;
else style = style | ((hint & HINT_BORDER) ? WS_BORDER : 0) |
- ((hint & HINT_SIZEBOX) ? (GetParent(hWnd) ? 0 : WS_SIZEBOX) : 0) |
+ ((hint & HINT_SIZEBOX) ? WS_SIZEBOX : 0) |
((hint & HINT_CAPTION) ? WS_CAPTION : 0);
+
+ if (hint & HINT_NOMAXIMIZE)
+ style = style & ~WS_MAXIMIZEBOX;
+
SetWindowLongPtr (hWnd, GWL_STYLE, style);
}
diff --git a/hw/xwin/winprefs.c b/hw/xwin/winprefs.c
index d5bceb928..93901cac7 100644
--- a/hw/xwin/winprefs.c
+++ b/hw/xwin/winprefs.c
@@ -723,7 +723,7 @@ winIconIsOverride(unsigned hiconIn)
/*
- * Try and open ~/.XWinrc and /usr/X11R6/lib/X11/system.XWinrc
+ * Try and open ~/.XWinrc and system.XWinrc
* Load it into prefs structure for use by other functions
*/
void
@@ -763,7 +763,7 @@ LoadPreferences (void)
#ifdef RELOCATE_PROJECTROOT
snprintf(buffer, sizeof(buffer), "%s\\system.XWinrc", winGetBaseDir());
#else
- strncpy(buffer, PROJECTROOT"/lib/X11/system.XWinrc", sizeof(buffer));
+ strncpy(buffer, SYSCONFDIR"/X11/system.XWinrc", sizeof(buffer));
#endif
buffer[sizeof(buffer)-1] = 0;
prefFile = fopen (buffer, "r");
diff --git a/hw/xwin/winprefslex.l b/hw/xwin/winprefslex.l
index 9a384a2cd..463dff4ca 100644
--- a/hw/xwin/winprefslex.l
+++ b/hw/xwin/winprefslex.l
@@ -88,7 +88,7 @@ ATSTART { return ATSTART; }
ATEND { return ATEND; }
EXEC { return EXEC; }
ALWAYSONTOP { return ALWAYSONTOP; }
-DEBUG { return DEBUG; }
+DEBUG { return DEBUGOUTPUT; }
RELOAD { return RELOAD; }
TRAYICON { return TRAYICON; }
SILENTEXIT { return SILENTEXIT; }
diff --git a/hw/xwin/winprefsyacc.y b/hw/xwin/winprefsyacc.y
index 73f165915..0acf160e4 100644
--- a/hw/xwin/winprefsyacc.y
+++ b/hw/xwin/winprefsyacc.y
@@ -115,7 +115,7 @@ extern int yylex(void);
%token ATEND
%token EXEC
%token ALWAYSONTOP
-%token DEBUG
+%token DEBUGOUTPUT "DEBUG"
%token RELOAD
%token TRAYICON
%token FORCEEXIT
@@ -243,7 +243,7 @@ forceexit: FORCEEXIT NEWLINE { pref.fForceExit = TRUE; }
silentexit: SILENTEXIT NEWLINE { pref.fSilentExit = TRUE; }
;
-debug: DEBUG STRING NEWLINE { ErrorF("LoadPreferences: %s\n", $2); free($2); }
+debug: DEBUGOUTPUT STRING NEWLINE { ErrorF("LoadPreferences: %s\n", $2); free($2); }
;
diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c
index fd7719c3a..159e53333 100755
--- a/hw/xwin/winprocarg.c
+++ b/hw/xwin/winprocarg.c
@@ -1556,6 +1556,7 @@ winLogVersionInfo (void)
ErrorF ("Welcome to the XWin X Server\n");
ErrorF ("Vendor: %s\n", VENDOR_STRING);
ErrorF ("Release: %d.%d.%d.%d (%d)\n", XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP, XORG_VERSION_CURRENT);
+ ErrorF ("%s\n\n", BUILDERSTRING);
ErrorF ("Contact: %s\n", VENDOR_CONTACT);
}
diff --git a/hw/xwin/winwindow.h b/hw/xwin/winwindow.h
index 86c094334..cf2f93f0a 100644
--- a/hw/xwin/winwindow.h
+++ b/hw/xwin/winwindow.h
@@ -43,6 +43,7 @@
#ifndef PROJECT_NAME
# define PROJECT_NAME "Cygwin/X"
#endif
+#define EXECUTABLE_NAME "XWin"
#define WINDOW_CLASS "cygwin/x"
#define WINDOW_TITLE PROJECT_NAME ":%s.%d"
#define WINDOW_TITLE_XDMCP "%s:%s.%d"
diff --git a/include/xwin-config.h.in b/include/xwin-config.h.in
index c8de11073..21ceb29cf 100644
--- a/include/xwin-config.h.in
+++ b/include/xwin-config.h.in
@@ -12,7 +12,7 @@
/* Cygwin has /dev/windows for signaling new win32 messages */
#undef HAS_DEVWINDOWS
-/* Switch on debug messages */
+/* Switch on debug messages */
#undef CYGDEBUG
#undef CYGWINDOWING_DEBUG
#undef CYGMULTIWINDOW_DEBUG
@@ -22,3 +22,13 @@
/* Do we require our own snprintf? */
#undef NEED_SNPRINTF
+
+/* Short vendor name */
+#undef XVENDORNAMESHORT
+
+/* Vendor web address for support */
+#undef __VENDORDWEBSUPPORT__
+
+/* Location of system.XWinrc */
+#undef SYSCONFDIR
+
diff --git a/os/utils.c b/os/utils.c
index 71ab6f07a..79399fa53 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -504,9 +504,7 @@ void UseMsg(void)
#ifdef RLIMIT_STACK
ErrorF("-ls int limit stack space to N Kb\n");
#endif
-#ifdef SERVER_LOCK
ErrorF("-nolock disable the locking mechanism\n");
-#endif
#ifndef NOLOGOHACK
ErrorF("-logo enable logo in screen saver\n");
ErrorF("nologo disable logo in screen saver\n");
@@ -758,7 +756,6 @@ ProcessCommandLine(int argc, char *argv[])
UseMsg();
}
#endif
-#ifdef SERVER_LOCK
else if ( strcmp ( argv[i], "-nolock") == 0)
{
#if !defined(WIN32) && !defined(__CYGWIN__)
@@ -768,7 +765,6 @@ ProcessCommandLine(int argc, char *argv[])
#endif
nolock = TRUE;
}
-#endif
#ifndef NOLOGOHACK
else if ( strcmp( argv[i], "-logo") == 0)
{