changeset 52557:4a93216e6678

(Vdefault_frame_scroll_bars): New variable. (x_set_vertical_scroll_bars): Use it instead of hardcoded values. (syms_of_frame): DEFVAR_LISP it, and initialize according to window-system default scroll bar position.
author Kim F. Storm <storm@cua.dk>
date Sat, 20 Sep 2003 23:26:20 +0000
parents ce06c92d0b1e
children 3fb606ea8bf6
files src/frame.c
diffstat 1 files changed, 19 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/frame.c	Sat Sep 20 23:25:46 2003 +0000
+++ b/src/frame.c	Sat Sep 20 23:26:20 2003 +0000
@@ -114,6 +114,7 @@
 
 Lisp_Object Vterminal_frame;
 Lisp_Object Vdefault_frame_alist;
+Lisp_Object Vdefault_frame_scroll_bars;
 Lisp_Object Vmouse_position_function;
 Lisp_Object Vmouse_highlight;
 Lisp_Object Vdelete_frame_functions;
@@ -3217,13 +3218,11 @@
 	   ? vertical_scroll_bar_left
 	   : EQ (Qright, arg)
 	   ? vertical_scroll_bar_right
-#ifdef HAVE_NTGUI
-	   /* MS-Windows has scroll bars on the right by default.  */
-	   : vertical_scroll_bar_right
-#else
-	   : vertical_scroll_bar_left
-#endif
-	   );
+	   : EQ (Qleft, Vdefault_frame_scroll_bars)
+	   ? vertical_scroll_bar_left
+	   : EQ (Qright, Vdefault_frame_scroll_bars)
+	   ? vertical_scroll_bar_right
+	   : vertical_scroll_bar_none);
 
       /* We set this parameter before creating the X window for the
 	 frame, so we can get the geometry right from the start.
@@ -4032,6 +4031,19 @@
 Setting this variable does not affect existing frames, only new ones.  */);
   Vdefault_frame_alist = Qnil;
 
+  DEFVAR_LISP ("default-frame-scroll-bars", &Vdefault_frame_scroll_bars,
+	       doc: /* Default position of scroll bars on this window-system.  */);
+#ifdef HAVE_WINDOW_SYSTEM
+#if defined(HAVE_NTGUI) || defined(HAVE_CARBON)
+  /* MS-Windows has scroll bars on the right by default.  */
+  Vdefault_frame_scroll_bars = Qright;
+#else
+  Vdefault_frame_scroll_bars = Qleft;
+#endif
+#else
+  Vdefault_frame_scroll_bars = Qnil;
+#endif
+
   Qinhibit_default_face_x_resources
     = intern ("inhibit-default-face-x-resources");
   staticpro (&Qinhibit_default_face_x_resources);