xserver: Branch 'xorg-server-1.4-apple' - 2 commits

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Mon Dec 10 21:06:08 PST 2007


 hw/xquartz/darwinEvents.c      |    2 
 hw/xquartz/darwinKeyboard.c    |   20 ++---
 hw/xquartz/quartzKeyboard.c    |    8 +-
 hw/xquartz/quartzKeyboard.h    |    4 -
 hw/xquartz/xpr/Makefile.am     |   16 +++-
 hw/xquartz/xpr/Xquartz.man     |  156 -----------------------------------------
 hw/xquartz/xpr/Xquartz.man.pre |  156 +++++++++++++++++++++++++++++++++++++++++
 7 files changed, 184 insertions(+), 178 deletions(-)

New commits:
commit ffa66f8e7417d19cf7bda5020901e6713205090b
Author: Jeremy Huddleston <jeremy at yuffie.local>
Date:   Mon Dec 10 20:57:24 2007 -0800

    Xquartz: Pre-process Xquartz man page
    (cherry picked from commit dec2633c41dd0adf73264afdf251a6522d6ae76a)

diff --git a/hw/xquartz/xpr/Makefile.am b/hw/xquartz/xpr/Makefile.am
index 87ed195..ae1b192 100644
--- a/hw/xquartz/xpr/Makefile.am
+++ b/hw/xquartz/xpr/Makefile.am
@@ -1,8 +1,5 @@
 bin_PROGRAMS = Xquartz
 
-# TODO: This man page needs sed magic and cleanup
-man1_MANS = Xquartz.man
-
 AM_CFLAGS =  $(XSERVER_CFLAGS) $(DIX_CFLAGS)
 AM_CPPFLAGS = \
 	-I$(srcdir) -I$(srcdir)/.. \
@@ -58,8 +55,19 @@ Xquartz_LDFLAGS =  \
 	-Wl,-framework,CoreAudio \
 	-Wl,-framework,IOKit
 
+appmandir = $(APP_MAN_DIR)
+appman_PRE = Xquartz.man.pre
+appman_PROCESSED = $(appman_PRE:man.pre=man)
+appman_DATA = $(appman_PRE:man.pre=@APP_MAN_SUFFIX@)
+
+CLEANFILES = $(appman_PROCESSED) $(appman_DATA)
+
+include $(top_srcdir)/cpprules.in
+
+.man.$(APP_MAN_SUFFIX):
+	cp $< $@
+
 EXTRA_DIST = \
-	Xquartz.man \
 	dri.h \
 	dristruct.h \
 	appledri.h \
diff --git a/hw/xquartz/xpr/Xquartz.man b/hw/xquartz/xpr/Xquartz.man
deleted file mode 100644
index 37a7f1a..0000000
--- a/hw/xquartz/xpr/Xquartz.man
+++ /dev/null
@@ -1,156 +0,0 @@
-.TH XQUARTZ 1 __vendorversion__
-.SH NAME
-Xquartz \- X window system server for Quartz operating system
-.SH SYNOPSIS
-.B Xquartz
-[ options ] ...
-.SH DESCRIPTION
-.I Xquartz
-is the X window server for Mac OS X provided by Apple.
-.I Xquartz
-runs in parallel with Aqua in rootless mode. In rootless mode, the X
-window system and Mac OS X share your display.  The root window of the
-X11 display is the size of the screen and contains all the other
-windows. The X11 root window is not displayed in rootless mode as Mac
-OS X handles the desktop background.
-.SH OPTIONS
-.PP
-In addition to the normal server options described in the \fIXserver(1)\fP
-manual page, \fIXquartz\fP accepts the following command line switches:
-.TP 8
-.B \-fakebuttons
-Emulates a 3 button mouse using modifier keys. By default, the Command modifier
-is used to emulate button 2 and Option is used for button 3. Thus, clicking the
-first mouse button while holding down Command will act like clicking
-button 2. Holding down Option will simulate button 3.
-.TP 8
-.B \-nofakebuttons
-Do not emulate a 3 button mouse. This is the default.
-.TP 8
-.B "\-fakemouse2 \fImodifiers\fP"
-Change the modifier keys used to emulate the second mouse button. By default,
-Command is used to emulate the second button. Any combination of the following
-modifier names may be used: Shift, Option, Control, Command, Fn. For example,
-.B \-fakemouse2 """Option,Shift""
-will set holding Option, Shift and clicking on button one as equivalent to
-clicking the second mouse button.
-.TP 8
-.B "\-fakemouse3 \fImodifiers\fP"
-Change the modifier keys used to emulate the third mouse button. By default,
-Option is used to emulate the third button. Any combination of the following
-modifier names may be used: Shift, Option, Control, Command, Fn. For example,
-.B \-fakemouse3 """Control,Shift""
-will set holding Control, Shift and clicking on button one as equivalent to
-clicking the third mouse button.
-.TP 8
-.B "\-swapAltMeta"
-Swaps the meaning of the Alt and Meta modifier keys.
-.TP 8
-.B "\-keymap \fIfile\fP"
-On startup \fIXquartz\fP translates a Darwin keymapping into an X keymap.
-The default is to read this keymapping from USA.keymapping. With this option
-the keymapping will be read from \fIfile\fP instead. If the file's path is
-not specified, it will be searched for in Library/Keyboards/ underneath the
-following directories (in order): ~, /, /Network, /System.
-.TP 8
-.B \-nokeymap
-On startup \fIXquartz\fP translates a Darwin keymapping into an X keymap.
-With this option \fIXquartz\fP queries the kernel for the current keymapping
-instead of reading it from a file. This will often fail on newer kernels.
-.TP 8
-.B "\-depth \fIdepth\fP"
-Specifies the color bit depth to use. Currently only 15, and 24 color
-bits per pixel are supported. If not specified, defaults to the depth
-of the main display.
-.SH CUSTOMIZATION
-\fIXquartz\fP can also be customized using the defaults(1) command. The available options are:
-.TP 8
-.B defaults write com.apple.x11 enable_fake_buttons -boolean true
-Equivalent to the \fB-fakebuttons\fP command line option.
-.TP 8
-.B defaults write com.apple.x11 fake_button2 \fImodifiers\fP
-Equivalent to the \fB-fakemouse2\fP option.
-.TP 8
-.B defaults write com.apple.x11 fake_button3 \fImodifiers\fP
-Equivalent to the \fB-fakemouse3\fP option.
-.TP 8
-.B defaults write com.apple.x11 swap_alt_meta -boolean true
-Equivalent to the \fB-swapAltMeta\fP option.
-.TP 8
-.B defaults write com.apple.x11 keymap_file \fIfilename\fP
-Equivalent to the \fB-keymap\fP option.
-.TP 8
-.B defaults write com.apple.x11 no_quit_alert -boolean true
-Disables the alert dialog displayed when attempting to quit X11.
-.TP 8
-.B defaults write com.apple.x11 no_auth -boolean true
-Stops the X server requiring that clients authenticate themselves when
-connecting. See Xsecurity(__miscmansuffix__).
-.TP 8
-.B defaults write com.apple.x11 nolisten_tcp -boolean true
-Prevents the X server accepting remote connections.
-.TP 8
-.B defaults write com.apple.x11 xinit_kills_server -boolean false
-Stops the X server exiting when the xinitrc script terminates.
-.TP 8
-.B defaults write com.apple.x11 fullscreen_hotkeys -boolean false
-Allows system hotkeys to be handled while in X11 fullscreen mode.
-.TP 8
-.B defaults write com.apple.x11 enable_system_beep -boolean false
-Don't use the standard system beep effect for X11 alerts.
-.TP 8
-.B defaults write com.apple.x11 enable_key_equivalents -boolean false
-Disable menu keyboard equivalents while X11 windows are focused.
-.TP 8
-.B defaults write com.apple.x11 depth \fIdepth\fP
-Equivalent to the \fB-depth\fP option.
-.SH "SEE ALSO"
-.PP
-X(__miscmansuffix__), XFree86(1), Xserver(1), xdm(1), xinit(1)
-.PP
-.SH AUTHORS
-XFree86 was originally ported to Mac OS X Server by John Carmack. Dave
-Zarzycki used this as the basis of his port of XFree86 4.0 to Darwin 1.0.
-Torrey T. Lyons improved and integrated this code into the XFree86
-Project's mainline for the 4.0.2 release.
-.PP
-The following members of the XonX Team contributed to the following
-releases (in alphabetical order):
-.TP 4
-XFree86 4.1.0:
-.br
-Rob Braun - Darwin x86 support
-.br
-Torrey T. Lyons - Project Lead
-.br
-Andreas Monitzer - Cocoa version of XDarwin front end
-.br
-Gregory Robert Parker - Original Quartz implementation
-.br
-Christoph Pfisterer - Dynamic shared X libraries
-.br
-Toshimitsu Tanaka - Japanese localization
-.TP 4
-XFree86 4.2.0:
-.br
-Rob Braun - Darwin x86 support
-.br
-Pablo Di Noto - Spanish localization
-.br
-Paul Edens - Dutch localization
-.br
-Kyunghwan Kim - Korean localization
-.br
-Mario Klebsch - Non-US keyboard support
-.br
-Torrey T. Lyons - Project Lead
-.br
-Andreas Monitzer - German localization
-.br
-Patrik Montgomery - Swedish localization
-.br
-Greg Parker - Rootless support
-.br
-Toshimitsu Tanaka - Japanese localization
-.br
-Olivier Verdier - French localization
diff --git a/hw/xquartz/xpr/Xquartz.man.pre b/hw/xquartz/xpr/Xquartz.man.pre
new file mode 100644
index 0000000..315db1c
--- /dev/null
+++ b/hw/xquartz/xpr/Xquartz.man.pre
@@ -0,0 +1,156 @@
+.TH XQUARTZ 1 __vendorversion__
+.SH NAME
+Xquartz \- X window system server for Quartz operating system
+.SH SYNOPSIS
+.B Xquartz
+[ options ] ...
+.SH DESCRIPTION
+.I Xquartz
+is the X window server for Mac OS X provided by Apple.
+.I Xquartz
+runs in parallel with Aqua in rootless mode. In rootless mode, the X
+window system and Mac OS X share your display.  The root window of the
+X11 display is the size of the screen and contains all the other
+windows. The X11 root window is not displayed in rootless mode as Mac
+OS X handles the desktop background.
+.SH OPTIONS
+.PP
+In addition to the normal server options described in the \fIXserver(1)\fP
+manual page, \fIXquartz\fP accepts the following command line switches:
+.TP 8
+.B \-fakebuttons
+Emulates a 3 button mouse using modifier keys. By default, the Command modifier
+is used to emulate button 2 and Option is used for button 3. Thus, clicking the
+first mouse button while holding down Command will act like clicking
+button 2. Holding down Option will simulate button 3.
+.TP 8
+.B \-nofakebuttons
+Do not emulate a 3 button mouse. This is the default.
+.TP 8
+.B "\-fakemouse2 \fImodifiers\fP"
+Change the modifier keys used to emulate the second mouse button. By default,
+Command is used to emulate the second button. Any combination of the following
+modifier names may be used: Shift, Option, Control, Command, Fn. For example,
+.B \-fakemouse2 """Option,Shift""
+will set holding Option, Shift and clicking on button one as equivalent to
+clicking the second mouse button.
+.TP 8
+.B "\-fakemouse3 \fImodifiers\fP"
+Change the modifier keys used to emulate the third mouse button. By default,
+Option is used to emulate the third button. Any combination of the following
+modifier names may be used: Shift, Option, Control, Command, Fn. For example,
+.B \-fakemouse3 """Control,Shift""
+will set holding Control, Shift and clicking on button one as equivalent to
+clicking the third mouse button.
+.TP 8
+.B "\-swapAltMeta"
+Swaps the meaning of the Alt and Meta modifier keys.
+.TP 8
+.B "\-keymap \fIfile\fP"
+On startup \fIXquartz\fP translates a Darwin keymapping into an X keymap.
+The default is to read this keymapping from USA.keymapping. With this option
+the keymapping will be read from \fIfile\fP instead. If the file's path is
+not specified, it will be searched for in Library/Keyboards/ underneath the
+following directories (in order): ~, /, /Network, /System.
+.TP 8
+.B \-nokeymap
+On startup \fIXquartz\fP translates a Darwin keymapping into an X keymap.
+With this option \fIXquartz\fP queries the kernel for the current keymapping
+instead of reading it from a file. This will often fail on newer kernels.
+.TP 8
+.B "\-depth \fIdepth\fP"
+Specifies the color bit depth to use. Currently only 15, and 24 color
+bits per pixel are supported. If not specified, defaults to the depth
+of the main display.
+.SH CUSTOMIZATION
+\fIXquartz\fP can also be customized using the defaults(1) command. The available options are:
+.TP 8
+.B defaults write org.x.X11 enable_fake_buttons -boolean true
+Equivalent to the \fB-fakebuttons\fP command line option.
+.TP 8
+.B defaults write org.x.X11 fake_button2 \fImodifiers\fP
+Equivalent to the \fB-fakemouse2\fP option.
+.TP 8
+.B defaults write org.x.X11 fake_button3 \fImodifiers\fP
+Equivalent to the \fB-fakemouse3\fP option.
+.TP 8
+.B defaults write org.x.X11 swap_alt_meta -boolean true
+Equivalent to the \fB-swapAltMeta\fP option.
+.TP 8
+.B defaults write org.x.X11 keymap_file \fIfilename\fP
+Equivalent to the \fB-keymap\fP option.
+.TP 8
+.B defaults write org.x.X11 no_quit_alert -boolean true
+Disables the alert dialog displayed when attempting to quit X11.
+.TP 8
+.B defaults write org.x.X11 no_auth -boolean true
+Stops the X server requiring that clients authenticate themselves when
+connecting. See Xsecurity(__miscmansuffix__).
+.TP 8
+.B defaults write org.x.X11 nolisten_tcp -boolean true
+Prevents the X server accepting remote connections.
+.TP 8
+.B defaults write org.x.X11 xinit_kills_server -boolean false
+Stops the X server exiting when the xinitrc script terminates.
+.TP 8
+.B defaults write org.x.X11 fullscreen_hotkeys -boolean false
+Allows system hotkeys to be handled while in X11 fullscreen mode.
+.TP 8
+.B defaults write org.x.X11 enable_system_beep -boolean false
+Don't use the standard system beep effect for X11 alerts.
+.TP 8
+.B defaults write org.x.X11 enable_key_equivalents -boolean false
+Disable menu keyboard equivalents while X11 windows are focused.
+.TP 8
+.B defaults write org.x.X11 depth \fIdepth\fP
+Equivalent to the \fB-depth\fP option.
+.SH "SEE ALSO"
+.PP
+X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1)
+.PP
+.SH AUTHORS
+XFree86 was originally ported to Mac OS X Server by John Carmack. Dave
+Zarzycki used this as the basis of his port of XFree86 4.0 to Darwin 1.0.
+Torrey T. Lyons improved and integrated this code into the XFree86
+Project's mainline for the 4.0.2 release.
+.PP
+The following members of the XonX Team contributed to the following
+releases (in alphabetical order):
+.TP 4
+XFree86 4.1.0:
+.br
+Rob Braun - Darwin x86 support
+.br
+Torrey T. Lyons - Project Lead
+.br
+Andreas Monitzer - Cocoa version of XDarwin front end
+.br
+Gregory Robert Parker - Original Quartz implementation
+.br
+Christoph Pfisterer - Dynamic shared X libraries
+.br
+Toshimitsu Tanaka - Japanese localization
+.TP 4
+XFree86 4.2.0:
+.br
+Rob Braun - Darwin x86 support
+.br
+Pablo Di Noto - Spanish localization
+.br
+Paul Edens - Dutch localization
+.br
+Kyunghwan Kim - Korean localization
+.br
+Mario Klebsch - Non-US keyboard support
+.br
+Torrey T. Lyons - Project Lead
+.br
+Andreas Monitzer - German localization
+.br
+Patrik Montgomery - Swedish localization
+.br
+Greg Parker - Rootless support
+.br
+Toshimitsu Tanaka - Japanese localization
+.br
+Olivier Verdier - French localization
commit ea713786b3d8ff1902ef3cf6896d879d82ce715d
Author: Jeremy Huddleston <jeremy at yuffie.local>
Date:   Mon Dec 10 20:47:48 2007 -0800

    Xquartz: Make Alt work with Xmodmap again
    (cherry picked from commit 0e017177dcca7185716ca760dcce9ddedc7bfef9)

diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c
index ae82f5b..1d09e09 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -424,7 +424,7 @@ void DarwinSendKeyboardEvents(int ev_type, int keycode) {
     static unsigned int last_seed;
     unsigned int this_seed;
 
-    this_seed = DarwinModeSystemKeymapSeed();
+    this_seed = QuartzSystemKeymapSeed();
     if (this_seed != last_seed) {
       last_seed = this_seed;
       DarwinKeyboardReload(darwinKeyboard);
diff --git a/hw/xquartz/darwinKeyboard.c b/hw/xquartz/darwinKeyboard.c
index f6dcfb3..f1b90b7 100644
--- a/hw/xquartz/darwinKeyboard.c
+++ b/hw/xquartz/darwinKeyboard.c
@@ -507,8 +507,9 @@ Bool DarwinParseNXKeyMapping(darwinKeyboardInfo  *info) {
                                 (left ? XK_Control_L : XK_Control_R);
                         break;
                     case NX_MODIFIERKEY_ALTERNATE:
-                        info->keyMap[keyCode * GLYPHS_PER_KEY] = XK_Mode_switch;
-                                // (left ? XK_Alt_L : XK_Alt_R);
+                        // info->keyMap[keyCode * GLYPHS_PER_KEY] = XK_Mode_switch;
+                        info->keyMap[keyCode * GLYPHS_PER_KEY] =
+                                (left ? XK_Alt_L : XK_Alt_R);
                         break;
                     case NX_MODIFIERKEY_COMMAND:
                         info->keyMap[keyCode * GLYPHS_PER_KEY] =
@@ -685,6 +686,7 @@ static void DarwinBuildModifierMaps(darwinKeyboardInfo *info) {
             case XK_Alt_L:
                 info->modifierKeycodes[NX_MODIFIERKEY_ALTERNATE][0] = i;
                 info->modMap[MIN_KEYCODE + i] = Mod1Mask;
+                *k = XK_Mode_switch; // Yes, this is ugly.  This needs to be cleaned up when we integrate quartzKeyboard with this code and refactor.
                 break;
 
             case XK_Alt_R:
@@ -693,15 +695,11 @@ static void DarwinBuildModifierMaps(darwinKeyboardInfo *info) {
 #else
                 info->modifierKeycodes[NX_MODIFIERKEY_ALTERNATE][0] = i;
 #endif
+                *k = XK_Mode_switch; // Yes, this is ugly.  This needs to be cleaned up when we integrate quartzKeyboard with this code and refactor.
                 info->modMap[MIN_KEYCODE + i] = Mod1Mask;
                 break;
 
             case XK_Mode_switch:
-                // Yes, this is ugly.  This needs to be cleaned up when we integrate quartzKeyboard with this code and refactor.
-#ifdef NX_MODIFIERKEY_RALTERNATE
-                info->modifierKeycodes[NX_MODIFIERKEY_RALTERNATE][0] = i;
-#endif
-                info->modifierKeycodes[NX_MODIFIERKEY_ALTERNATE][0] = i;
                 info->modMap[MIN_KEYCODE + i] = Mod1Mask;
                 break;
 
@@ -735,12 +733,12 @@ static void DarwinLoadKeyboardMapping(KeySymsRec *keySyms) {
     memset(keyInfo.keyMap, 0, sizeof(keyInfo.keyMap));
 
     /* TODO: Clean this up
-     * DarwinModeReadSystemKeymap is in quartz/quartzKeyboard.c
+     * QuartzReadSystemKeymap is in quartz/quartzKeyboard.c
      * DarwinParseNXKeyMapping is here
      */
     if (!DarwinParseNXKeyMapping(&keyInfo)) {
-        DEBUG_LOG("DarwinParseNXKeyMapping returned 0... running DarwinModeReadSystemKeymap().\n");
-        if (!DarwinModeReadSystemKeymap(&keyInfo)) {
+        DEBUG_LOG("DarwinParseNXKeyMapping returned 0... running QuartzReadSystemKeymap().\n");
+        if (!QuartzReadSystemKeymap(&keyInfo)) {
             FatalError("Could not build a valid keymap.");
         }
     }
@@ -790,7 +788,7 @@ void DarwinKeyboardInit(DeviceIntPtr pDev) {
     //    DarwinKeyboardReload(pDev);
     /* Initialize the seed, so we don't reload the keymap unnecessarily
        (and possibly overwrite xinitrc changes) */
-    DarwinModeSystemKeymapSeed();
+    QuartzSystemKeymapSeed();
 
     assert( InitKeyboardDeviceStruct( (DevicePtr)pDev, &keySyms,
                                       keyInfo.modMap, QuartzBell,
diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index 0a50d06..9b899ca 100644
--- a/hw/xquartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -66,11 +66,11 @@ const static struct {
     {55,  XK_Meta_L},
     {56,  XK_Shift_L},
     {57,  XK_Caps_Lock},
-    {58,  XK_Mode_switch},
+    {58,  XK_Alt_L},
     {59,  XK_Control_L},
 
     {60,  XK_Shift_R},
-    {61,  XK_Mode_switch},
+    {61,  XK_Alt_R},
     {62,  XK_Control_R},
     {63,  XK_Meta_R},
 
@@ -146,7 +146,7 @@ const static struct {
     {UKEYSYM (0x31b), XK_dead_horn},		/* COMBINING HORN */
 };
 
-unsigned int DarwinModeSystemKeymapSeed(void) {
+unsigned int QuartzSystemKeymapSeed(void) {
     static unsigned int seed;
     static KeyboardLayoutRef last_key_layout;
     KeyboardLayoutRef key_layout;
@@ -195,7 +195,7 @@ static KeySym make_dead_key(KeySym in) {
     return in;
 }
 
-Bool DarwinModeReadSystemKeymap(darwinKeyboardInfo *info) {
+Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info) {
     KeyboardLayoutRef key_layout;
     const void *chr_data = NULL;
     int num_keycodes = NUM_KEYCODES;
diff --git a/hw/xquartz/quartzKeyboard.h b/hw/xquartz/quartzKeyboard.h
index c5f22bf..0c7e70e 100644
--- a/hw/xquartz/quartzKeyboard.h
+++ b/hw/xquartz/quartzKeyboard.h
@@ -47,7 +47,7 @@ typedef struct darwinKeyboardInfo_struct {
 
 /* These functions need to be implemented by XQuartz, XDarwin, etc. */
 void DarwinKeyboardReload(DeviceIntPtr pDev);
-Bool DarwinModeReadSystemKeymap(darwinKeyboardInfo *info);
-unsigned int DarwinModeSystemKeymapSeed(void);
+Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info);
+unsigned int QuartzSystemKeymapSeed(void);
 
 #endif /* QUARTZ_KEYBOARD_H */


More information about the xorg-commit mailing list