Index: gtk/gtkrc.key.mac
===================================================================
--- gtk/gtkrc.key.mac	(revision 0)
+++ gtk/gtkrc.key.mac	(revision 0)
@@ -0,0 +1,84 @@
+binding "gtk-mac-text-view"
+{
+  bind "<meta>a" { "select-all" (1) }
+  bind "<shift><meta>a" { "select-all" (0) }
+  bind "<meta>x" { "cut-clipboard" () }
+  bind "<meta>c" { "copy-clipboard" () }
+  bind "<meta>v" { "paste-clipboard" () }
+  unbind "<ctrl>a"
+  unbind "<shift><ctrl>a"
+  unbind "<ctrl>x"
+  unbind "<ctrl>c"
+  unbind "<ctrl>v"
+}
+
+class "GtkTextView" binding "gtk-mac-text-view"
+
+
+binding "gtk-mac-file-chooser"
+{
+  bind "<meta>v" { "location-popup-on-paste" () }
+  unbind "<ctrl>v"
+}
+
+class "GtkFileChooserDefault" binding "gtk-mac-file-chooser"
+
+
+binding "gtk-mac-tree-view"
+{
+  bind "<meta>a" { "select-all" () }
+  bind "<shift><meta>a" { "unselect-all" () }
+  bind "<meta>f" { "start-interactive-search" () }
+  bind "<meta>F" { "start-interactive-search" () }
+  unbind "<ctrl>a"
+  unbind "<shift><ctrl>a"
+  unbind "<ctrl>f"
+  unbind "<ctrl>F"
+}
+
+class "GtkTreeView" binding "gtk-mac-tree-view"
+
+
+binding "gtk-mac-icon-view"
+{
+  bind "<meta>a" { "select-all" () }
+  bind "<shift><meta>a" { "unselect-all" () }
+  unbind "<ctrl>a"
+  unbind "<shift><ctrl>a"
+}
+
+class "GtkIconView" binding "gtk-mac-icon-view"
+
+
+binding "gtk-mac-label"
+{
+  bind "<meta>a" { 
+    "move-cursor" (paragraph-ends, -1, 0)
+    "move-cursor" (paragraph-ends, 1, 1)
+  }
+  bind "<shift><meta>a" { "move-cursor" (paragraph-ends, 0, 0) }
+  bind "<meta>c" { "copy-clipboard" () }
+  unbind "<ctrl>a"
+  unbind "<shift><ctrl>a"
+  unbind "<ctrl>c"
+}
+
+class "GtkLabel" binding "gtk-mac-label"
+
+
+binding "gtk-mac-entry"
+{
+  bind "<meta>a" { 
+    "move-cursor" (buffer-ends, -1, 0)
+    "move-cursor" (buffer-ends, 1, 1)
+  }
+  bind "<meta>x" { "cut-clipboard" () }
+  bind "<meta>c" { "copy-clipboard" () }
+  bind "<meta>v" { "paste-clipboard" () }
+  unbind "<ctrl>a"
+  unbind "<ctrl>x"
+  unbind "<ctrl>c"
+  unbind "<ctrl>v"
+}
+
+class "GtkEntry" binding "gtk-mac-entry"
Index: gtk/gtktreeview.c
===================================================================
--- gtk/gtktreeview.c	(revision 20065)
+++ gtk/gtktreeview.c	(working copy)
@@ -14332,7 +14332,7 @@ gtk_tree_view_search_key_press_event (Gt
       retval = TRUE;
     }
 
-  if (((event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) == (GDK_CONTROL_MASK | GDK_SHIFT_MASK))
+  if (((event->state & (GTK_DEFAULT_ACCEL_MOD_MASK | GDK_SHIFT_MASK)) == (GTK_DEFAULT_ACCEL_MOD_MASK | GDK_SHIFT_MASK))
       && (event->keyval == GDK_g || event->keyval == GDK_G))
     {
       if (!gtk_tree_view_search_move (widget, tree_view, TRUE))
@@ -14350,7 +14350,7 @@ gtk_tree_view_search_key_press_event (Gt
       retval = TRUE;
     }
 
-  if (((event->state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) == GDK_CONTROL_MASK)
+  if (((event->state & (GTK_DEFAULT_ACCEL_MOD_MASK | GDK_SHIFT_MASK)) == GTK_DEFAULT_ACCEL_MOD_MASK)
       && (event->keyval == GDK_g || event->keyval == GDK_G))
     {
       if (!gtk_tree_view_search_move (widget, tree_view, FALSE))
Index: gtk/gtkstock.c
===================================================================
--- gtk/gtkstock.c	(revision 20065)
+++ gtk/gtkstock.c	(working copy)
@@ -27,6 +27,7 @@
 #include <config.h>
 #include <string.h>
 
+#include "gtkprivate.h"
 #include "gtkstock.h"
 #include "gtkiconfactory.h"
 #include "gtkintl.h"
@@ -300,18 +301,18 @@ static const GtkStockItem builtin_items 
   { GTK_STOCK_CANCEL, N_("_Cancel"), 0, 0, GETTEXT_PACKAGE },
   { GTK_STOCK_CDROM, N_("_CD-Rom"), 0, 0, GETTEXT_PACKAGE },
   { GTK_STOCK_CLEAR, N_("_Clear"), 0, 0, GETTEXT_PACKAGE },
-  { GTK_STOCK_CLOSE, N_("_Close"), GDK_CONTROL_MASK, 'w', GETTEXT_PACKAGE },
+  { GTK_STOCK_CLOSE, N_("_Close"), GTK_DEFAULT_ACCEL_MOD_MASK, 'w', GETTEXT_PACKAGE },
   { GTK_STOCK_CONNECT, N_("C_onnect"), 0, 0, GETTEXT_PACKAGE },
   { GTK_STOCK_CONVERT, N_("_Convert"), 0, 0, GETTEXT_PACKAGE },
-   { GTK_STOCK_COPY, N_("_Copy"), GDK_CONTROL_MASK, 'c', GETTEXT_PACKAGE },
-  { GTK_STOCK_CUT, N_("Cu_t"), GDK_CONTROL_MASK, 'x', GETTEXT_PACKAGE },
+   { GTK_STOCK_COPY, N_("_Copy"), GTK_DEFAULT_ACCEL_MOD_MASK, 'c', GETTEXT_PACKAGE },
+  { GTK_STOCK_CUT, N_("Cu_t"), GTK_DEFAULT_ACCEL_MOD_MASK, 'x', GETTEXT_PACKAGE },
   { GTK_STOCK_DELETE, N_("_Delete"), 0, 0, GETTEXT_PACKAGE },
   { GTK_STOCK_DISCARD, N_("_Discard"), 0, 0, GETTEXT_PACKAGE },
   { GTK_STOCK_DISCONNECT, N_("_Disconnect"), 0, 0, GETTEXT_PACKAGE },
   { GTK_STOCK_EXECUTE, N_("_Execute"), 0, 0, GETTEXT_PACKAGE },
   { GTK_STOCK_EDIT, N_("_Edit"), 0, 0, GETTEXT_PACKAGE },
-  { GTK_STOCK_FIND, N_("_Find"), GDK_CONTROL_MASK, 'f', GETTEXT_PACKAGE },
-  { GTK_STOCK_FIND_AND_REPLACE, N_("Find and _Replace"), GDK_CONTROL_MASK, 'r', GETTEXT_PACKAGE },
+  { GTK_STOCK_FIND, N_("_Find"), GTK_DEFAULT_ACCEL_MOD_MASK, 'f', GETTEXT_PACKAGE },
+  { GTK_STOCK_FIND_AND_REPLACE, N_("Find and _Replace"), GTK_DEFAULT_ACCEL_MOD_MASK, 'r', GETTEXT_PACKAGE },
   { GTK_STOCK_FLOPPY, N_("_Floppy"), 0, 0, GETTEXT_PACKAGE },
   { GTK_STOCK_FULLSCREEN, N_("_Fullscreen"), 0, 0, GETTEXT_PACKAGE },
   { GTK_STOCK_LEAVE_FULLSCREEN, N_("_Leave Fullscreen"), 0, 0, GETTEXT_PACKAGE },
@@ -332,7 +333,13 @@ static const GtkStockItem builtin_items 
   /* translators, strip the prefix up to and including the first | */
   { GTK_STOCK_GO_UP, N_("Navigation|_Up"), 0, 0, GETTEXT_PACKAGE },
   { GTK_STOCK_HARDDISK, N_("_Harddisk"), 0, 0, GETTEXT_PACKAGE },
-  { GTK_STOCK_HELP, N_("_Help"), GDK_CONTROL_MASK, 'h', GETTEXT_PACKAGE },
+  { GTK_STOCK_HELP, N_("_Help"),
+#ifndef GDK_WINDOWING_QUARTZ
+    GDK_CONTROL_MASK, 'h',
+#else
+    GDK_META_MASK, '?',
+#endif
+    GETTEXT_PACKAGE },
   { GTK_STOCK_HOME, N_("_Home"), 0, 0, GETTEXT_PACKAGE },
   { GTK_STOCK_INDENT, N_("Increase Indent"), 0, 0, GETTEXT_PACKAGE },
   { GTK_STOCK_UNINDENT, N_("Decrease Indent"), 0, 0, GETTEXT_PACKAGE },
@@ -366,26 +373,26 @@ static const GtkStockItem builtin_items 
   /* translators, strip the prefix up to and including the first | */
   { GTK_STOCK_MEDIA_STOP, N_("Media|_Stop"), 0, 0, GETTEXT_PACKAGE },
   { GTK_STOCK_NETWORK, N_("_Network"), 0, 0, GETTEXT_PACKAGE },
-  { GTK_STOCK_NEW, N_("_New"), GDK_CONTROL_MASK, 'n', GETTEXT_PACKAGE },
+  { GTK_STOCK_NEW, N_("_New"), GTK_DEFAULT_ACCEL_MOD_MASK, 'n', GETTEXT_PACKAGE },
   { GTK_STOCK_NO, N_("_No"), 0, 0, GETTEXT_PACKAGE },
   { GTK_STOCK_OK, N_("_OK"), 0, 0, GETTEXT_PACKAGE },
-  { GTK_STOCK_OPEN, N_("_Open"), GDK_CONTROL_MASK, 'o', GETTEXT_PACKAGE },
+  { GTK_STOCK_OPEN, N_("_Open"), GTK_DEFAULT_ACCEL_MOD_MASK, 'o', GETTEXT_PACKAGE },
   { GTK_STOCK_ORIENTATION_LANDSCAPE, N_("Landscape"), 0, 0, GETTEXT_PACKAGE },
   { GTK_STOCK_ORIENTATION_PORTRAIT, N_("Portrait"), 0, 0, GETTEXT_PACKAGE },
   { GTK_STOCK_ORIENTATION_REVERSE_LANDSCAPE, N_("Reverse landscape"), 0, 0, GETTEXT_PACKAGE },
   { GTK_STOCK_ORIENTATION_REVERSE_PORTRAIT, N_("Reverse portrait"), 0, 0, GETTEXT_PACKAGE },
   { GTK_STOCK_PAGE_SETUP, N_("Page Set_up"), 0, 0, GETTEXT_PACKAGE },
-  { GTK_STOCK_PASTE, N_("_Paste"), GDK_CONTROL_MASK, 'v', GETTEXT_PACKAGE },
+  { GTK_STOCK_PASTE, N_("_Paste"), GTK_DEFAULT_ACCEL_MOD_MASK, 'v', GETTEXT_PACKAGE },
   { GTK_STOCK_PREFERENCES, N_("_Preferences"), 0, 0, GETTEXT_PACKAGE },
   { GTK_STOCK_PRINT, N_("_Print"), 0, 0, GETTEXT_PACKAGE },
   { GTK_STOCK_PRINT_PREVIEW, N_("Print Pre_view"), 0, 0, GETTEXT_PACKAGE },
   { GTK_STOCK_PROPERTIES, N_("_Properties"), 0, 0, GETTEXT_PACKAGE },
-  { GTK_STOCK_QUIT, N_("_Quit"), GDK_CONTROL_MASK, 'q', GETTEXT_PACKAGE },
+  { GTK_STOCK_QUIT, N_("_Quit"), GTK_DEFAULT_ACCEL_MOD_MASK, 'q', GETTEXT_PACKAGE },
   { GTK_STOCK_REDO, N_("_Redo"), 0, 0, GETTEXT_PACKAGE },
   { GTK_STOCK_REFRESH, N_("_Refresh"), 0, 0, GETTEXT_PACKAGE },
   { GTK_STOCK_REMOVE, N_("_Remove"), 0, 0, GETTEXT_PACKAGE },
   { GTK_STOCK_REVERT_TO_SAVED, N_("_Revert"), 0, 0, GETTEXT_PACKAGE },
-  { GTK_STOCK_SAVE, N_("_Save"), GDK_CONTROL_MASK, 's', GETTEXT_PACKAGE },
+  { GTK_STOCK_SAVE, N_("_Save"), GTK_DEFAULT_ACCEL_MOD_MASK, 's', GETTEXT_PACKAGE },
   { GTK_STOCK_SAVE_AS, N_("Save _As"), 0, 0, GETTEXT_PACKAGE },
   { GTK_STOCK_SELECT_ALL, N_("Select _All"), 0, 0, GETTEXT_PACKAGE },
   { GTK_STOCK_SELECT_COLOR, N_("_Color"), 0, 0, GETTEXT_PACKAGE },
Index: gtk/gtksettings.c
===================================================================
--- gtk/gtksettings.c	(revision 20065)
+++ gtk/gtksettings.c	(working copy)
@@ -32,6 +32,12 @@
 #include "x11/gdkx.h"
 #endif
 
+#ifdef GDK_WINDOWING_QUARTZ
+#define DEFAULT_KEY_THEME "Mac"
+#else
+#define DEFAULT_KEY_THEME NULL
+#endif
+
 #define DEFAULT_TIMEOUT_INITIAL 200
 #define DEFAULT_TIMEOUT_REPEAT   20
 #define DEFAULT_TIMEOUT_EXPAND  500
@@ -301,7 +307,7 @@ gtk_settings_class_init (GtkSettingsClas
                                              g_param_spec_string ("gtk-key-theme-name",
 								  P_("Key Theme Name"),
 								  P_("Name of key theme RC file to load"),
-								  NULL,
+								  DEFAULT_KEY_THEME,
 								  GTK_PARAM_READWRITE),
                                              NULL);
   g_assert (result == PROP_KEY_THEME_NAME);    
Index: gtk/gtkimcontextsimple.c
===================================================================
--- gtk/gtkimcontextsimple.c	(revision 20065)
+++ gtk/gtkimcontextsimple.c	(working copy)
@@ -22,6 +22,7 @@
 #include <string.h>
 
 #include <gdk/gdkkeysyms.h>
+#include "gtkprivate.h"
 #include "gtkaccelgroup.h"
 #include "gtkimcontextsimple.h"
 #include "gtksettings.h"
@@ -491,7 +492,7 @@ check_algorithmically (GtkIMContextSimpl
  * with Ctrl-Shift-U, then release the modifiers before typing any
  * digits, and enter the digits without modifiers.
  */
-#define HEX_MOD_MASK (GDK_CONTROL_MASK | GDK_SHIFT_MASK)
+#define HEX_MOD_MASK (GTK_DEFAULT_ACCEL_MOD_MASK | GDK_SHIFT_MASK)
 
 static gboolean
 check_hex (GtkIMContextSimple *context_simple,
Index: gtk/Makefile.am
===================================================================
--- gtk/Makefile.am	(revision 20065)
+++ gtk/Makefile.am	(working copy)
@@ -892,8 +892,19 @@ if DISABLE_EXPLICIT_DEPS
 	$(SHELL) $(top_srcdir)/sanitize-la.sh $(DESTDIR)$(libdir)/$(gtktargetlib)
 endif
 
+if USE_QUARTZ
+install-mac-key-theme:
+	$(mkinstalldirs) $(DESTDIR)$(datadir)/themes/Mac/gtk-2.0-key
+	$(INSTALL_DATA) $(srcdir)/gtkrc.key.mac $(DESTDIR)$(datadir)/themes/Mac/gtk-2.0-key/gtkrc
+uninstall-mac-key-theme:
+	rm -f $(DESTDIR)$(datadir)/themes/Mac/gtk-2.0-key/gtkrc
+else
+install-mac-key-theme:
+uninstall-mac-key-theme:
+endif
+
 # Install a RC file for the default GTK+ theme, and key themes
-install-data-local: install-ms-lib install-def-file
+install-data-local: install-ms-lib install-def-file install-mac-key-theme
 	$(mkinstalldirs) $(DESTDIR)$(datadir)/themes/Raleigh/gtk-2.0
 	$(INSTALL_DATA) $(srcdir)/gtkrc.default $(DESTDIR)$(datadir)/themes/Raleigh/gtk-2.0/gtkrc
 	$(mkinstalldirs) $(DESTDIR)$(datadir)/themes/Default/gtk-2.0-key
@@ -901,7 +912,7 @@ install-data-local: install-ms-lib insta
 	$(mkinstalldirs) $(DESTDIR)$(datadir)/themes/Emacs/gtk-2.0-key
 	$(INSTALL_DATA) $(srcdir)/gtkrc.key.emacs $(DESTDIR)$(datadir)/themes/Emacs/gtk-2.0-key/gtkrc
 
-uninstall-local: uninstall-ms-lib uninstall-def-file
+uninstall-local: uninstall-ms-lib uninstall-def-file uninstall-mac-key-theme
 	rm -f $(DESTDIR)$(datadir)/themes/Raleigh/gtk-2.0/gtkrc
 	rm -f $(DESTDIR)$(datadir)/themes/Default/gtk-2.0-key/gtkrc
 	rm -f $(DESTDIR)$(datadir)/themes/Emacs/gtk-2.0-key/gtkrc
@@ -1241,6 +1252,7 @@ EXTRA_DIST +=                   \
 	gtkrc.default		\
 	gtkrc.key.default	\
 	gtkrc.key.emacs		\
+	gtkrc.key.mac		\
 	makefile.msc		\
 	makefile.msc.in		\
 	makegtkalias.pl		\
Index: gtk/gtkprivate.h
===================================================================
--- gtk/gtkprivate.h	(revision 20065)
+++ gtk/gtkprivate.h	(working copy)
@@ -104,6 +104,15 @@ gboolean _gtk_fnmatch (const char *patte
 #define GTK_PARAM_WRITABLE G_PARAM_WRITABLE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB
 #define GTK_PARAM_READWRITE G_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB
 
+/* Many keyboard shortcuts for Mac are the same as for X
+ * except they use Command key instead of Control (e.g. Cut, 
+ * Copy, Paste). This symbol is for those simple cases. */
+#ifndef GDK_WINDOWING_QUARTZ
+#define GTK_DEFAULT_ACCEL_MOD_MASK GDK_CONTROL_MASK
+#else
+#define GTK_DEFAULT_ACCEL_MOD_MASK GDK_META_MASK
+#endif
+
 G_END_DECLS
 
 #endif /* __GTK_PRIVATE_H__ */
