From bad41bdfd4a12f0c92fd221bffd9f3c5e40d0fe1 Mon Sep 17 00:00:00 2001 From: Colin Harrison Date: Mon, 1 Feb 2010 17:11:22 +0000 Subject: Xming: Always update the Windows title Unicode (wide-character) in -multiwindow mode. Apply the Windows title wide-character in -multiwindow mode. Windows should now display correct client X Window titles for locales with wide characters. Copyright (C) Colin Harrison 2005-2008 http://www.straightrunning.com/XmingNotes/ http://sourceforge.net/projects/xming/ Signed-off-by: Jon TURNEY --- hw/xwin/winmultiwindowwm.c | 60 +++++++++++++++++++--------------------------- 1 file changed, 25 insertions(+), 35 deletions(-) (limited to 'hw') diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index 880ca6a1c..eba5542ac 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); @@ -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); } -- cgit v1.2.3 From 7eb840fd42bc62d88fb4fcf6600546c9ff6e56be Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Tue, 2 Feb 2010 15:42:12 +0000 Subject: Cygwin/X: Respect the system's ownership of the clipping region Respect the system's ownership of the clipping region used for shaped windows Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/winmultiwindowshape.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'hw') 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; } -- cgit v1.2.3 From fd8a32baba77aba8d124658a19f4f6eda79e49c6 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Fri, 19 Jun 2009 21:14:39 +0100 Subject: Cygwin/X: Window placement refinement for multiwindow mode Window placement refinement for multiwindow mode, ensure a window actually ends up somewhere visible if it tries to create itself offscreen (which can happen for e.g. if it has a stored position from a different sized display) Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/winmultiwindowwindow.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'hw') 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) -- cgit v1.2.3 From c02638fd68440513b6046315547c554a910bd7e2 Mon Sep 17 00:00:00 2001 From: Colin Harrison Date: Tue, 2 Feb 2010 16:08:45 +0000 Subject: Xming: Add a manifest file Use manifests to enable XP style controls (only effective for XP and later and when themes are enabled). The addition of manifests shouldn't cause compatibility problems with older Windows versions. Manifest must have execute permissions, otherwise attempts to execute XWin.exe in the same directory will fail... Signed-off-by: Jon TURNEY --- hw/xwin/XWin.exe.manifest | 16 ++++++++++++++++ hw/xwin/XWin.rc | 1 + 2 files changed, 17 insertions(+) create mode 100755 hw/xwin/XWin.exe.manifest (limited to 'hw') 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 @@ + + + The XWin X Windows server for Cygwin. + + + + + + diff --git a/hw/xwin/XWin.rc b/hw/xwin/XWin.rc index df2664dca..a4125b8d0 100644 --- a/hw/xwin/XWin.rc +++ b/hw/xwin/XWin.rc @@ -106,3 +106,4 @@ END */ IDI_XWIN ICON "X.ico" +CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "XWin.exe.manifest" -- cgit v1.2.3 From 881812438b430d2856d0494707e028e5f30d6e9a Mon Sep 17 00:00:00 2001 From: Colin Harrison Date: Tue, 2 Feb 2010 16:22:39 +0000 Subject: Xming: Use 8 point font for URL in About dialog Use an 8 point font for URL in About dialog, to match the rest of the text in that dialog Signed-off-by: Jon TURNEY --- hw/xwin/windialogs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hw') diff --git a/hw/xwin/windialogs.c b/hw/xwin/windialogs.c index 582b865f5..0b590cf1d 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) { -- cgit v1.2.3 From 34269a90ea2087f883f5dc8805894fc4998e4b81 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Tue, 2 Feb 2010 16:21:44 +0000 Subject: Cygwin/X: Update resources file and About dialog Use the configured vendor web address in the About dialog Update resources file: rework About dialog, use 'MS Shell Dlg 2' logical font for all dialogs, add ellipsis to exit option in tray menu as it (may) trigger another dialog. Get short vendor name from xwin-config.h, like other configuration data presented in the About dialog box, rather than creating the PROJECT_NAME define Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- configure.ac | 1 + hw/xwin/Makefile.am | 2 +- hw/xwin/XWin.rc | 51 ++++++++++++++++++++++++------------------------ hw/xwin/windialogs.c | 2 +- include/xwin-config.h.in | 8 +++++++- 5 files changed, 35 insertions(+), 29 deletions(-) (limited to 'hw') diff --git a/configure.ac b/configure.ac index ec9442bd3..2546e8352 100644 --- a/configure.ac +++ b/configure.ac @@ -1826,6 +1826,7 @@ AC_MSG_RESULT([$XWIN]) if test "x$XWIN" = xyes; then PKG_CHECK_EXISTS($WINDOWSWMPROTO, [WINDOWSWM=yes], [WINDOWSWM=no]) 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*) diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am index a76b56957..3324157c7 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 diff --git a/hw/xwin/XWin.rc b/hw/xwin/XWin.rc index a4125b8d0..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 #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 diff --git a/hw/xwin/windialogs.c b/hw/xwin/windialogs.c index 0b590cf1d..a8153535f 100755 --- a/hw/xwin/windialogs.c +++ b/hw/xwin/windialogs.c @@ -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/include/xwin-config.h.in b/include/xwin-config.h.in index c8de11073..932f2e861 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,9 @@ /* Do we require our own snprintf? */ #undef NEED_SNPRINTF + +/* Short vendor name */ +#undef XVENDORNAMESHORT + +/* Vendor web address for support */ +#undef __VENDORDWEBSUPPORT__ -- cgit v1.2.3 From 11252ed82e1f361b99e86521ac9314f868bd1a3a Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Mon, 1 Feb 2010 17:11:54 +0000 Subject: Cygwin/X: Look for system.Xwinrc in SYSCONFDIR/X11 Look for system.Xwinrc in SYSCONFDIR/X11 (usually /etc/X11) Rename sample system.Xwinrc file not to have a X11R6 path in it's name Add makefile install rule for system.XWinrc Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- configure.ac | 1 + hw/xwin/Makefile.am | 4 +- hw/xwin/_usr_X11R6_lib_X11_system.XWinrc | 125 ------------------------------- hw/xwin/system.XWinrc | 125 +++++++++++++++++++++++++++++++ hw/xwin/winprefs.c | 4 +- include/xwin-config.h.in | 4 + 6 files changed, 135 insertions(+), 128 deletions(-) delete mode 100644 hw/xwin/_usr_X11R6_lib_X11_system.XWinrc create mode 100644 hw/xwin/system.XWinrc (limited to 'hw') diff --git a/configure.ac b/configure.ac index 2546e8352..ef441dad3 100644 --- a/configure.ac +++ b/configure.ac @@ -1825,6 +1825,7 @@ 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) diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am index 3324157c7..8b1897235 100644 --- a/hw/xwin/Makefile.am +++ b/hw/xwin/Makefile.am @@ -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/_usr_X11R6_lib_X11_system.XWinrc b/hw/xwin/_usr_X11R6_lib_X11_system.XWinrc deleted file mode 100644 index 1de6e2ab0..000000000 --- a/hw/xwin/_usr_X11R6_lib_X11_system.XWinrc +++ /dev/null @@ -1,125 +0,0 @@ -# XWin Server Resource File - EXAMPLE -# Earle F. Philhower, III - -# Place in ~/.XWinrc or in /usr/X11R6/lib/X11/system.XWinrc - -# Keywords are case insensitive, comments legal pretty much anywhere -# you can have an end-of-line - -# Comments begin with "#" or "//" and go to the end-of-line - -# Paths to commands are **cygwin** based (i.e. /usr/local/bin/xcalc) - -# Paths to icons are **WINDOWS** based (i.e. c:\windows\icons) - -# Menus are defined as... -# MENU { -# EXEC -# ^^ This command will have any "%display%" -# string replaced with the proper display -# variable (i.e. 127.0.0.1:.0) -# or MENU -# or ALWAYSONTOP -# ^^ Sets the window to display above all others -# or RELOAD -# ^^ Causes ~/.XWinrc or the system.XWinrc file -# to be reloaded and icons and menus regenerated -# or SEPARATOR -# ... -# } - -# Set the taskmar menu with -# ROOTMENU - -# If you want a menu to be applied to all popup window's system menu -# DEFAULTSYSMENU - -# To choose a specific menu for a specific WM_CLASS or WM_NAME use ... -# SYSMENU { -# -# ... -# } - -# When specifying an ICONFILE in the following commands several different -# formats are allowed: -# 1. Name of a regular Windows .ico format file -# (ex: "cygwin.ico", "apple.ico") -# 2. Name and index into a Windows .DLL -# (ex: "c:\windows\system32\shell32.dll,4" gives the default folder icon -# "c:\windows\system32\shell32.dll,5" gives the floppy drive icon) -# 3. Index into XWin.EXE internal ICON resource -# (ex: ",101" is the 1st icon inside XWin.exe) - -# To define where ICO files live (** Windows path**) -# ICONDIRECTORY -# NOTE: If you specify a fully qualified path to an ICON below -# (i.e. "c:\xxx" or "d:\xxxx") -# this ICONDIRECTORY will not be prepended - -# To change the taskbar icon use... -# TRAYICON - -# To define a replacement for the standard X icon for apps w/o specified icons -# DEFAULTICON - -# To define substitute icons on a per-window basis use... -# ICONS { -# -# ... -# } -# In the case where multiple matches occur, the first listed in the ICONS -# section will be chosen. - -# To disable exit confirmation dialog add the line containing SilentExit - -# DEBUG prints out the string to the XWin.log file - -// Below are just some silly menus to demonstrate writing your -// own configuration file. - -// Make some menus... -menu apps { - xterm exec "xterm" - "Emacs" exec "emacs" - notepad exec notepad - xload exec "xload -display %display%" # Comment -} - -menu root { -// Comments fit here, too... - "Reload .XWinrc" RELOAD - "Applications" menu apps - SEParATOR -} - -menu aot { - Separator - "Always on Top" alwaysontop -} - -menu xtermspecial { - "Emacs" exec "emacs" - "Always on Top" alwaysontop - SepArAtor -} - -RootMenu root - -DefaultSysMenu aot atend - -SysMenu { - "xterm" xtermspecial atstart -} - -# IconDirectory "c:\winnt\" - -# DefaultIcon "reinstall.ico" - -# Icons { -# "xterm" "uninstall.ico" -# } - -SilentExit - -DEBUG "Done parsing the configuration file..." - diff --git a/hw/xwin/system.XWinrc b/hw/xwin/system.XWinrc new file mode 100644 index 000000000..37ac00859 --- /dev/null +++ b/hw/xwin/system.XWinrc @@ -0,0 +1,125 @@ +# XWin Server Resource File - EXAMPLE +# Earle F. Philhower, III + +# 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 + +# Comments begin with "#" or "//" and go to the end-of-line + +# Paths to commands are **cygwin** based (i.e. /usr/local/bin/xcalc) + +# Paths to icons are **WINDOWS** based (i.e. c:\windows\icons) + +# Menus are defined as... +# MENU { +# EXEC +# ^^ This command will have any "%display%" +# string replaced with the proper display +# variable (i.e. 127.0.0.1:.0) +# or MENU +# or ALWAYSONTOP +# ^^ Sets the window to display above all others +# or RELOAD +# ^^ Causes ~/.XWinrc or the system.XWinrc file +# to be reloaded and icons and menus regenerated +# or SEPARATOR +# ... +# } + +# Set the taskmar menu with +# ROOTMENU + +# If you want a menu to be applied to all popup window's system menu +# DEFAULTSYSMENU + +# To choose a specific menu for a specific WM_CLASS or WM_NAME use ... +# SYSMENU { +# +# ... +# } + +# When specifying an ICONFILE in the following commands several different +# formats are allowed: +# 1. Name of a regular Windows .ico format file +# (ex: "cygwin.ico", "apple.ico") +# 2. Name and index into a Windows .DLL +# (ex: "c:\windows\system32\shell32.dll,4" gives the default folder icon +# "c:\windows\system32\shell32.dll,5" gives the floppy drive icon) +# 3. Index into XWin.EXE internal ICON resource +# (ex: ",101" is the 1st icon inside XWin.exe) + +# To define where ICO files live (** Windows path**) +# ICONDIRECTORY +# NOTE: If you specify a fully qualified path to an ICON below +# (i.e. "c:\xxx" or "d:\xxxx") +# this ICONDIRECTORY will not be prepended + +# To change the taskbar icon use... +# TRAYICON + +# To define a replacement for the standard X icon for apps w/o specified icons +# DEFAULTICON + +# To define substitute icons on a per-window basis use... +# ICONS { +# +# ... +# } +# In the case where multiple matches occur, the first listed in the ICONS +# section will be chosen. + +# To disable exit confirmation dialog add the line containing SilentExit + +# DEBUG prints out the string to the XWin.log file + +// Below are just some silly menus to demonstrate writing your +// own configuration file. + +// Make some menus... +menu apps { + xterm exec "xterm" + "Emacs" exec "emacs" + notepad exec notepad + xload exec "xload -display %display%" # Comment +} + +menu root { +// Comments fit here, too... + "Reload .XWinrc" RELOAD + "Applications" menu apps + SEParATOR +} + +menu aot { + Separator + "Always on Top" alwaysontop +} + +menu xtermspecial { + "Emacs" exec "emacs" + "Always on Top" alwaysontop + SepArAtor +} + +RootMenu root + +DefaultSysMenu aot atend + +SysMenu { + "xterm" xtermspecial atstart +} + +# IconDirectory "c:\winnt\" + +# DefaultIcon "reinstall.ico" + +# Icons { +# "xterm" "uninstall.ico" +# } + +SilentExit + +DEBUG "Done parsing the configuration file..." + 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/include/xwin-config.h.in b/include/xwin-config.h.in index 932f2e861..21ceb29cf 100644 --- a/include/xwin-config.h.in +++ b/include/xwin-config.h.in @@ -28,3 +28,7 @@ /* Vendor web address for support */ #undef __VENDORDWEBSUPPORT__ + +/* Location of system.XWinrc */ +#undef SYSCONFDIR + -- cgit v1.2.3 From 7a440e5b7a416e582b6c3cc4c33822854ce73aed Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sun, 4 Oct 2009 15:55:40 +0100 Subject: Cygwin/X: Tidy up system.Xwinrc Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/system.XWinrc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'hw') diff --git a/hw/xwin/system.XWinrc b/hw/xwin/system.XWinrc index 37ac00859..f0771c610 100644 --- a/hw/xwin/system.XWinrc +++ b/hw/xwin/system.XWinrc @@ -18,6 +18,9 @@ # ^^ This command will have any "%display%" # string replaced with the proper display # variable (i.e. 127.0.0.1:.0) +# (This should only rarely be needed as +# the DISPLAY environment variable is also +# set correctly) # or MENU # or 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 } -- cgit v1.2.3 From 2f2f3da080629d410dd99e281c382b54f0dbbf5d Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Fri, 19 Jun 2009 21:14:47 +0100 Subject: Cygwin/X: Copy the state of the Windows keyboard device to the Virtual Core Keyboard at startup. Otherwise, this happens lazily after the first keypress, which can lead to applications which are started from a shell window and inspect the keyboard state before a character is typed getting the wrong idea about the desired keymap (e.g. xemacs shows this behaviour) Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/winkeybd.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'hw') 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: -- cgit v1.2.3 From f60b7712b3451649f138b158ee282be89a66b9ef Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Mon, 1 Feb 2010 17:13:00 +0000 Subject: Cygwin/X: Report BUILDERSTRING with version information Report BUILDERSTRING with version information Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/winerror.c | 2 ++ hw/xwin/winprocarg.c | 1 + 2 files changed, 3 insertions(+) (limited to 'hw') 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/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); } -- cgit v1.2.3 From 22982b9e95a2339d5ba60d66263e42a0331ee41f Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Thu, 29 Oct 2009 18:50:23 +0000 Subject: Cygwin/X: XSupportsLocale() failure is non-critical Treat XSupportsLocale() returning false as non-critical to internal client theads startup, and issue a warning, not an error Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/winclipboardthread.c | 3 +-- hw/xwin/winmultiwindowwm.c | 7 ++----- 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'hw') 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/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index eba5542ac..e39cbc105 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -893,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 */ @@ -1278,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 */ -- cgit v1.2.3 From 6f1836bfbd80e88d4c57a32757d0a5b398504c35 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Mon, 2 Nov 2009 17:37:14 +0000 Subject: Cygwin/X: Update DDX specific -help text Alphabetize options Review option descriptions, clarify and bring up to date Add missing option descriptions Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/InitOutput.c | 188 ++++++++++++++++++++++++++++----------------------- hw/xwin/winwindow.h | 1 + 2 files changed, 104 insertions(+), 85 deletions(-) (limited to 'hw') 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 .\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 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/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" -- cgit v1.2.3 From 26857b1c2003797b02e258247f63064aa1e37c10 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sat, 31 Oct 2009 17:19:17 +0000 Subject: Cygwin/X: Update XWin man page Restructure to group similar options and offer some commentary on those groups Review option descriptions, clarify and bring up-to-date Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/XWin.man.pre | 401 +++++++++++++++++++++++++++++---------------------- 1 file changed, 230 insertions(+), 171 deletions(-) (limited to 'hw') 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. -- cgit v1.2.3 From 654d2e372dc2978ce379ab9f02137333ec224f0c Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Tue, 10 Nov 2009 13:24:40 +0000 Subject: Cygwin/X: Discourage other WMs in multiwindow mode Tidying up of other WM detection code when ading SWT/Motif fix in commit 71519a572fe15b85c0eb2b02636c9e871f2c858f was rather over-agressive and now allows other WMs to think they can start when the internal WM is running. Revert to the behaviour of selecting ButtonPressMask events as well on the root window, so other WMs will be dissuaded from starting Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/winmultiwindowwm.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'hw') diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index e39cbc105..e92170d8f 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -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); @@ -967,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) { @@ -1018,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) { @@ -1496,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. @@ -1511,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; } -- cgit v1.2.3 From 7f54ccafadf99c0a1a3e788734199b306b4fa51d Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Fri, 16 Jan 2009 13:12:12 +0000 Subject: Cygwin/X: Make transient windows resizable again Reverts the change which makes parented windows non-resizeable Because this was trying to do something which we should be doing, as an alternative we try checking WM_NORMAL_HINTS for windows which shouldn't be resizable If a window has a maximum size specified, no maximize box If a window has a fixed size (max size == min size, per EWMH 1.3 Implementation Notes), no resizing frame Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/winmultiwindowwm.c | 43 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-) (limited to 'hw') diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c index e92170d8f..21d913e5e 100644 --- a/hw/xwin/winmultiwindowwm.c +++ b/hw/xwin/winmultiwindowwm.c @@ -1537,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) @@ -1618,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; @@ -1635,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); } -- cgit v1.2.3 From b7dbbd3cd4d28cd4939706b3bf6394ba8ecafaff Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Sun, 22 Nov 2009 23:35:09 +0000 Subject: Cygwin/X: Avoid cursor size log spam Fedora 12 likes to use a 39x26 animated wait cursor. Avoid spamming the log with warnings that each frame can't be completely contained in the 32x32 native cursor Also reformat log message so it doesn't contain a '\n\t'. I mean, it's not like we might want to grep the log or something... Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/wincursor.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'hw') 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); } -- cgit v1.2.3 From c76248fda99c38aef0ccf0ed6b58fbe95f6fe497 Mon Sep 17 00:00:00 2001 From: Jon TURNEY Date: Tue, 2 Feb 2010 20:53:44 +0000 Subject: Cygwin/X: Avoid a collision between DEBUG and a token name Rename a token to avoid a collision between DEBUG defined via AC_DEFINE if --enable-debug is configured, and the token for the 'debug' instruction in the XWin preferences file Signed-off-by: Jon TURNEY Reviewed-by: Colin Harrison --- hw/xwin/winprefslex.l | 2 +- hw/xwin/winprefsyacc.y | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'hw') 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); } ; -- cgit v1.2.3