diff options
| author | Martin Rudalics <rudalics@gmx.at> | 2017-04-12 18:22:44 +0200 |
|---|---|---|
| committer | Martin Rudalics <rudalics@gmx.at> | 2017-04-12 18:22:44 +0200 |
| commit | c25005eda1c5ad8dabb3ce815658bd3c637ae686 (patch) | |
| tree | d4c7e6bd2d2a9fe8cdc3345a0f84d6d0aa6d4987 /lisp | |
| parent | 8720f601e715e5f1d41f7cf863a525a1cc1bc12c (diff) | |
| download | emacs-c25005eda1c5ad8dabb3ce815658bd3c637ae686.tar.gz | |
New internal-border face and args for select-window and x-focus-frame
Add `internal-border' face and handle it whenever clearing the
internal border. If NORECORD equals the symbol
'mark-for-redisplay', `select-window' will not record the window
but still mark it for redisplay. The new argument NOACTIVATE
for `x-focus-frame' tries to not activate FRAME when set.
* lisp/faces.el (internal-border): New face.
* lisp/mwheel.el (mwheel-scroll): Select window to scroll with
`mark-for-redisplay'.
* lisp/scroll-bar.el (scroll-bar-drag)
(scroll-bar-horizontal-drag, scroll-bar-scroll-down)
(scroll-bar-scroll-up, scroll-bar-toolkit-scroll)
(scroll-bar-toolkit-horizontal-scroll): Select window to scroll
with `mark-for-redisplay'.
* lisp/window.el (handle-select-window): When
`focus-follows-mouse' is not 'auto-raise' try to not activate
FRAME.
* src/dispextern.h (face_id): Add INTERNAL_BORDER_FACE_ID.
* src/frame.c (Fx_focus_frame): New argument NOACTIVATE.
* src/frame.h (x_focus_frame): Update extern declaration.
* src/gtkutil.c (xg_clear_under_internal_border): Remove
function.
(xg_frame_resized, xg_frame_set_char_size): Call
x_clear_under_internal_border.
(xg_tool_bar_callback): Adapt x_focus_frame call.
* src/gtkutil.h (xg_clear_under_internal_border): Remove
declaration.
* src/nsfns.m (x_focus_frame): Add argument NOACTIVATE.
* src/w32fns.c (x_clear_under_internal_border): Fill border
with internal-border background if specified.
* src/w32term.h (x_clear_under_internal_border): Add extern
declaration.
* src/w32term.c (x_after_update_window_line): Fill border
with internal-border background if specified.
(w32_set_vertical_scroll_bar, w32_set_horizontal_scroll_bar)
(x_scroll_bar_clear, w32_read_socket): Call
x_clear_under_internal_border.
(x_focus_frame): New argument NOACTIVATE.
* src/window.c (select_window): Mark WINDOW for redisplay when
NORECORD equals 'mark-for-redisplay'.
(Fselect_window): Update doc-string.
(syms_of_window): Define Qmark_for_redisplay.
* src/xdisp.c (clear_garbaged_frames, echo_area_display)
(redisplay_internal): Call x_clear_under_internal_border.
* src/xfaces.c (lookup_basic_face): Handle `window-divider'
and `internal-border' faces.
(realize_basic_faces): Realize `internal-border' face.
(syms_of_xfaces): Define Qinternal_border.
* src/xfns.c (x_set_internal_border_width): Remove call for
xg_clear_under_internal_border.
(x_focus_frame): New argument NOACTIVATE. When non-nil try to not
activate frame.
* src/xterm.c (x_fill_rectangle): No more static.
(x_clear_under_internal_border, x_after_update_window_line):
Fill border with internal-border background if specified.
(xt_horizontal_action_hook): Rewrite.
(handle_one_xevent): Call x_clear_under_internal_border.
* src/xterm.h (x_fill_rectangle): Add extern declaration.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/faces.el | 7 | ||||
| -rw-r--r-- | lisp/mwheel.el | 3 | ||||
| -rw-r--r-- | lisp/scroll-bar.el | 12 | ||||
| -rw-r--r-- | lisp/window.el | 2 |
4 files changed, 17 insertions, 7 deletions
diff --git a/lisp/faces.el b/lisp/faces.el index e62561a63a5..a6ffd1ecd33 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -2629,6 +2629,13 @@ the same as `window-divider' face." :group 'window-divider :group 'basic-faces) +(defface internal-border + '((t nil)) + "Basic face for the internal border." + :version "26.1" + :group 'frames + :group 'basic-faces) + (defface minibuffer-prompt '((((background dark)) :foreground "cyan") ;; Don't use blue because many users of the MS-DOS port customize diff --git a/lisp/mwheel.el b/lisp/mwheel.el index 73fd2b7e115..1428e5f4d01 100644 --- a/lisp/mwheel.el +++ b/lisp/mwheel.el @@ -220,6 +220,9 @@ non-Windows systems." (mods (delq 'click (delq 'double (delq 'triple (event-modifiers event))))) (amt (assoc mods mouse-wheel-scroll-amount))) + (unless (eq scroll-window selected-window) + ;; Mark window to be scrolled for redisplay. + (select-window scroll-window 'mark-for-redisplay)) ;; Extract the actual amount or find the element that has no modifiers. (if amt (setq amt (cdr amt)) (let ((list-elt mouse-wheel-scroll-amount)) diff --git a/lisp/scroll-bar.el b/lisp/scroll-bar.el index 5290a7b3bee..58352740447 100644 --- a/lisp/scroll-bar.el +++ b/lisp/scroll-bar.el @@ -281,7 +281,7 @@ If you click outside the slider, the window scrolls to bring the slider there." (with-current-buffer (window-buffer window) (setq before-scroll point-before-scroll)) (save-selected-window - (select-window window) + (select-window window 'mark-for-redisplay) (setq before-scroll (or before-scroll (point)))) (scroll-bar-drag-1 event) @@ -326,7 +326,7 @@ If you click outside the slider, the window scrolls to bring the slider there." (with-current-buffer (window-buffer window) (setq before-scroll point-before-scroll)) (save-selected-window - (select-window window) + (select-window window 'mark-for-redisplay) (setq before-scroll (or before-scroll (point)))) (scroll-bar-horizontal-drag-1 event) @@ -356,7 +356,7 @@ EVENT should be a scroll bar click." (unwind-protect (save-selected-window (let ((portion-whole (nth 2 end-position))) - (select-window window) + (select-window window 'mark-for-redisplay) (setq before-scroll (or before-scroll (point))) (scroll-down @@ -377,7 +377,7 @@ EVENT should be a scroll bar click." (unwind-protect (save-selected-window (let ((portion-whole (nth 2 end-position))) - (select-window window) + (select-window window 'mark-for-redisplay) (setq before-scroll (or before-scroll (point))) (scroll-up @@ -402,7 +402,7 @@ EVENT should be a scroll bar click." (with-current-buffer (window-buffer window) (setq before-scroll point-before-scroll)) (save-selected-window - (select-window window) + (select-window window 'mark-for-redisplay) (setq before-scroll (or before-scroll (point))) (cond ((eq part 'above-handle) @@ -449,7 +449,7 @@ EVENT should be a scroll bar click." (with-current-buffer (window-buffer window) (setq before-scroll point-before-scroll)) (save-selected-window - (select-window window) + (select-window window 'mark-for-redisplay) (setq before-scroll (or before-scroll (point))) (cond ((eq part 'before-handle) diff --git a/lisp/window.el b/lisp/window.el index bea8383fcde..f4a834c0d8c 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -8855,7 +8855,7 @@ is active. This function is run by `mouse-autoselect-window-timer'." (raise-frame frame)) (t ;; Just focus frame. - (x-focus-frame frame)))))) + (x-focus-frame frame t)))))) (defun truncated-partial-width-window-p (&optional window) "Return non-nil if lines in WINDOW are specifically truncated due to its width. |
