[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r117642: Fix scroll bar handling for non-toolkit bui
From: |
Martin Rudalics |
Subject: |
[Emacs-diffs] trunk r117642: Fix scroll bar handling for non-toolkit builds. |
Date: |
Mon, 04 Aug 2014 16:47:48 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 117642
revision-id: address@hidden
parent: address@hidden
committer: martin rudalics <address@hidden>
branch nick: trunk
timestamp: Mon 2014-08-04 18:47:27 +0200
message:
Fix scroll bar handling for non-toolkit builds.
* frame.h (FRAME_HAS_HORIZONTAL_SCROLL_BARS): Condition
correctly according to toolkit used.
* frame.c (make_initial_frame, make_terminal_frame)
(x_set_horizontal_scroll_bars, x_set_scroll_bar_height)
(Vdefault_frame_horizontal_scroll_bars): Correctly condition
assignments according to presence of toolkit scrollbars.
* window.h (WINDOW_HAS_HORIZONTAL_SCROLL_BAR): Condition
correctly according to toolkit used.
* window.c (set_window_scroll_bars): Set horizontal scroll bar
only if toolkit supports it.
* w32term.c (w32_redeem_scroll_bar): Always redeem scroll bar if
present.
* xterm.c (x_scroll_bar_create): Initialize horizontal slot for
non-toolkit builds.
(XTredeem_scroll_bar): Always redeem scroll bar if present.
modified:
src/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1438
src/frame.c frame.c-20091113204419-o5vbwnq5f7feedwu-243
src/frame.h frame.h-20091113204419-o5vbwnq5f7feedwu-229
src/w32term.c w32term.c-20091113204419-o5vbwnq5f7feedwu-950
src/window.c window.c-20091113204419-o5vbwnq5f7feedwu-231
src/window.h window.h-20091113204419-o5vbwnq5f7feedwu-271
src/xterm.c xterm.c-20091113204419-o5vbwnq5f7feedwu-244
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2014-08-04 04:03:31 +0000
+++ b/src/ChangeLog 2014-08-04 16:47:27 +0000
@@ -1,3 +1,21 @@
+2014-08-04 Martin Rudalics <address@hidden>
+
+ * frame.h (FRAME_HAS_HORIZONTAL_SCROLL_BARS): Condition
+ correctly according to toolkit used.
+ * frame.c (make_initial_frame, make_terminal_frame)
+ (x_set_horizontal_scroll_bars, x_set_scroll_bar_height)
+ (Vdefault_frame_horizontal_scroll_bars): Correctly condition
+ assignments according to presence of toolkit scrollbars.
+ * window.h (WINDOW_HAS_HORIZONTAL_SCROLL_BAR): Condition
+ correctly according to toolkit used.
+ * window.c (set_window_scroll_bars): Set horizontal scroll bar
+ only if toolkit supports it.
+ * w32term.c (w32_redeem_scroll_bar): Always redeem scroll bar if
+ present.
+ * xterm.c (x_scroll_bar_create): Initialize horizontal slot for
+ non-toolkit builds.
+ (XTredeem_scroll_bar): Always redeem scroll bar if present.
+
2014-08-04 Dmitry Antipov <address@hidden>
* keyboard.c (safe_run_hook_funcall): Avoid consing around
=== modified file 'src/frame.c'
--- a/src/frame.c 2014-08-01 15:12:01 +0000
+++ b/src/frame.c 2014-08-04 16:47:27 +0000
@@ -860,7 +860,7 @@
#ifdef HAVE_WINDOW_SYSTEM
f->vertical_scroll_bar_type = vertical_scroll_bar_none;
- FRAME_HAS_HORIZONTAL_SCROLL_BARS (f) = false;
+ f->horizontal_scroll_bars = false;
#endif
/* The default value of menu-bar-mode is t. */
@@ -913,7 +913,7 @@
#ifdef HAVE_WINDOW_SYSTEM
f->vertical_scroll_bar_type = vertical_scroll_bar_none;
- FRAME_HAS_HORIZONTAL_SCROLL_BARS (f) = false;
+ f->horizontal_scroll_bars = false;
#endif
FRAME_MENU_BAR_LINES (f) = NILP (Vmenu_bar_mode) ? 0 : 1;
@@ -3793,12 +3793,13 @@
void
x_set_horizontal_scroll_bars (struct frame *f, Lisp_Object arg, Lisp_Object
oldval)
{
-#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NTGUI)
+#if (defined (HAVE_WINDOW_SYSTEM) \
+ && ((defined (USE_TOOLKIT_SCROLL_BARS) && !defined (HAVE_NS)) \
+ || defined (HAVE_NTGUI)))
if ((NILP (arg) && FRAME_HAS_HORIZONTAL_SCROLL_BARS (f))
|| (!NILP (arg) && !FRAME_HAS_HORIZONTAL_SCROLL_BARS (f)))
{
- FRAME_HAS_HORIZONTAL_SCROLL_BARS (f)
- = NILP (arg) ? false : true;
+ f->horizontal_scroll_bars = NILP (arg) ? false : true;
/* We set this parameter before creating the X window for the
frame, so we can get the geometry right from the start.
@@ -3844,7 +3845,9 @@
void
x_set_scroll_bar_height (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
{
-#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NTGUI)
+#if (defined (HAVE_WINDOW_SYSTEM) \
+ && ((defined (USE_TOOLKIT_SCROLL_BARS) && !defined (HAVE_NS)) \
+ || defined (HAVE_NTGUI)))
int unit = FRAME_LINE_HEIGHT (f);
if (NILP (arg))
@@ -4891,7 +4894,9 @@
DEFVAR_LISP ("default-frame-horizontal-scroll-bars",
Vdefault_frame_horizontal_scroll_bars,
doc: /* Default value for horizontal scroll bars on this
window-system. */);
-#ifdef HAVE_WINDOW_SYSTEM
+#if (defined (HAVE_WINDOW_SYSTEM) \
+ && ((defined (USE_TOOLKIT_SCROLL_BARS) && !defined (HAVE_NS)) \
+ || defined (HAVE_NTGUI)))
Vdefault_frame_horizontal_scroll_bars = Qt;
#else
Vdefault_frame_horizontal_scroll_bars = Qnil;
=== modified file 'src/frame.h'
--- a/src/frame.h 2014-08-01 15:12:01 +0000
+++ b/src/frame.h 2014-08-04 16:47:27 +0000
@@ -852,8 +852,6 @@
#define FRAME_VERTICAL_SCROLL_BAR_TYPE(f) ((f)->vertical_scroll_bar_type)
#define FRAME_HAS_VERTICAL_SCROLL_BARS(f) \
((f)->vertical_scroll_bar_type != vertical_scroll_bar_none)
-#define FRAME_HAS_HORIZONTAL_SCROLL_BARS(f) \
- ((f)->horizontal_scroll_bars)
#define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT(f) \
((f)->vertical_scroll_bar_type == vertical_scroll_bar_left)
#define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT(f) \
@@ -866,9 +864,18 @@
#define FRAME_HAS_VERTICAL_SCROLL_BARS(f) ((void) f, 0)
#define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT(f) ((void) f, 0)
#define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT(f) ((void) f, 0)
+
+#endif /* HAVE_WINDOW_SYSTEM */
+
+/* Whether horizontal scroll bars are currently enabled for frame F. */
+#if (defined (HAVE_WINDOW_SYSTEM) \
+ && ((defined (USE_TOOLKIT_SCROLL_BARS) && !defined (HAVE_NS)) \
+ || defined (HAVE_NTGUI)))
+#define FRAME_HAS_HORIZONTAL_SCROLL_BARS(f) \
+ ((f)->horizontal_scroll_bars)
+#else
#define FRAME_HAS_HORIZONTAL_SCROLL_BARS(f) ((void) f, 0)
-
-#endif /* HAVE_WINDOW_SYSTEM */
+#endif
/* Width that a scroll bar in frame F should have, if there is one.
Measured in pixels.
=== modified file 'src/w32term.c'
--- a/src/w32term.c 2014-07-27 13:21:30 +0000
+++ b/src/w32term.c 2014-08-04 16:47:27 +0000
@@ -4041,7 +4041,7 @@
if (NILP (w->vertical_scroll_bar) && NILP (w->horizontal_scroll_bar))
emacs_abort ();
- if (!NILP (w->vertical_scroll_bar) && WINDOW_HAS_VERTICAL_SCROLL_BAR (w))
+ if (!NILP (w->vertical_scroll_bar))
{
bar = XSCROLL_BAR (w->vertical_scroll_bar);
/* Unlink it from the condemned list. */
@@ -4076,7 +4076,7 @@
}
horizontal:
- if (!NILP (w->horizontal_scroll_bar) && WINDOW_HAS_HORIZONTAL_SCROLL_BAR (w))
+ if (!NILP (w->horizontal_scroll_bar))
{
bar = XSCROLL_BAR (w->horizontal_scroll_bar);
/* Unlink it from the condemned list. */
=== modified file 'src/window.c'
--- a/src/window.c 2014-07-28 09:39:09 +0000
+++ b/src/window.c 2014-08-04 16:47:27 +0000
@@ -7299,7 +7299,6 @@
Lisp_Object horizontal_type)
{
int iwidth = (NILP (width) ? -1 : (CHECK_NATNUM (width), XINT (width)));
- int iheight = (NILP (height) ? -1 : (CHECK_NATNUM (height), XINT (height)));
bool changed = 0;
if (iwidth == 0)
@@ -7327,29 +7326,39 @@
}
}
- if (MINI_WINDOW_P (w) || iheight == 0)
- horizontal_type = Qnil;
-
- if (!(NILP (horizontal_type)
- || EQ (horizontal_type, Qbottom)
- || EQ (horizontal_type, Qt)))
- error ("Invalid type of horizontal scroll bar");
-
- if (w->scroll_bar_height != iheight
- || !EQ (w->horizontal_scroll_bar_type, horizontal_type))
- {
- /* Don't change anything if new scroll bar won't fit. */
- if ((WINDOW_PIXEL_HEIGHT (w)
- - WINDOW_HEADER_LINE_HEIGHT (w)
- - WINDOW_MODE_LINE_HEIGHT (w)
- - max (iheight, 0))
- >= MIN_SAFE_WINDOW_PIXEL_HEIGHT (w))
- {
- w->scroll_bar_height = iheight;
- wset_horizontal_scroll_bar_type (w, horizontal_type);
- changed = 1;
- }
- }
+#if (defined (HAVE_WINDOW_SYSTEM) \
+ && ((defined (USE_TOOLKIT_SCROLL_BARS) && !defined (HAVE_NS)) \
+ || defined (HAVE_NTGUI)))
+ {
+ int iheight = (NILP (height) ? -1 : (CHECK_NATNUM (height), XINT
(height)));
+
+ if (MINI_WINDOW_P (w) || iheight == 0)
+ horizontal_type = Qnil;
+
+ if (!(NILP (horizontal_type)
+ || EQ (horizontal_type, Qbottom)
+ || EQ (horizontal_type, Qt)))
+ error ("Invalid type of horizontal scroll bar");
+
+ if (w->scroll_bar_height != iheight
+ || !EQ (w->horizontal_scroll_bar_type, horizontal_type))
+ {
+ /* Don't change anything if new scroll bar won't fit. */
+ if ((WINDOW_PIXEL_HEIGHT (w)
+ - WINDOW_HEADER_LINE_HEIGHT (w)
+ - WINDOW_MODE_LINE_HEIGHT (w)
+ - max (iheight, 0))
+ >= MIN_SAFE_WINDOW_PIXEL_HEIGHT (w))
+ {
+ w->scroll_bar_height = iheight;
+ wset_horizontal_scroll_bar_type (w, horizontal_type);
+ changed = 1;
+ }
+ }
+ }
+#else
+ wset_horizontal_scroll_bar_type (w, Qnil);
+#endif
return changed ? w : NULL;
}
=== modified file 'src/window.h'
--- a/src/window.h 2014-07-27 13:21:30 +0000
+++ b/src/window.h 2014-08-04 16:47:27 +0000
@@ -787,7 +787,9 @@
/* Say whether horizontal scroll bars are currently enabled for window
W. Horizontal scrollbars exist for toolkit versions only. */
-#if defined (USE_X_TOOLKIT) || defined (USE_GTK) || defined (HAVE_NTGUI)
+#if (defined (HAVE_WINDOW_SYSTEM) \
+ && ((defined (USE_TOOLKIT_SCROLL_BARS) && !defined (HAVE_NS)) \
+ || defined (HAVE_NTGUI)))
#define WINDOW_HAS_HORIZONTAL_SCROLL_BAR(W) \
((WINDOW_PSEUDO_P (W) || MINI_NON_ONLY_WINDOW_P (W)) \
? false \
=== modified file 'src/xterm.c'
--- a/src/xterm.c 2014-08-03 20:34:33 +0000
+++ b/src/xterm.c 2014-08-04 16:47:27 +0000
@@ -5474,6 +5474,7 @@
bar->start = 0;
bar->end = 0;
bar->dragging = -1;
+ bar->horizontal = horizontal;
#if defined (USE_TOOLKIT_SCROLL_BARS) && defined (USE_LUCID)
bar->last_seen_part = scroll_bar_nowhere;
#endif
@@ -5947,7 +5948,7 @@
if (NILP (w->vertical_scroll_bar) && NILP (w->horizontal_scroll_bar))
emacs_abort ();
- if (!NILP (w->vertical_scroll_bar) && WINDOW_HAS_VERTICAL_SCROLL_BAR (w))
+ if (!NILP (w->vertical_scroll_bar))
{
bar = XSCROLL_BAR (w->vertical_scroll_bar);
/* Unlink it from the condemned list. */
@@ -5982,7 +5983,7 @@
}
horizontal:
- if (!NILP (w->horizontal_scroll_bar) && WINDOW_HAS_HORIZONTAL_SCROLL_BAR (w))
+ if (!NILP (w->horizontal_scroll_bar))
{
bar = XSCROLL_BAR (w->horizontal_scroll_bar);
/* Unlink it from the condemned list. */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r117642: Fix scroll bar handling for non-toolkit builds.,
Martin Rudalics <=