2014-10-02 13:26:23 +00:00
|
|
|
|
;;; frame.el --- multi-frame management independent of window systems -*- lexical-binding:t -*-
|
1992-05-30 21:11:25 +00:00
|
|
|
|
|
2021-01-01 09:13:56 +00:00
|
|
|
|
;; Copyright (C) 1993-1994, 1996-1997, 2000-2021 Free Software
|
2015-01-01 22:26:41 +00:00
|
|
|
|
;; Foundation, Inc.
|
1992-07-22 04:22:42 +00:00
|
|
|
|
|
2019-05-25 20:43:06 +00:00
|
|
|
|
;; Maintainer: emacs-devel@gnu.org
|
1992-07-17 08:15:29 +00:00
|
|
|
|
;; Keywords: internal
|
2010-08-29 16:17:13 +00:00
|
|
|
|
;; Package: emacs
|
1992-07-16 07:28:05 +00:00
|
|
|
|
|
1996-01-14 07:34:30 +00:00
|
|
|
|
;; This file is part of GNU Emacs.
|
|
|
|
|
|
2008-05-06 08:06:51 +00:00
|
|
|
|
;; GNU Emacs is free software: you can redistribute it and/or modify
|
1996-01-14 07:34:30 +00:00
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
2008-05-06 08:06:51 +00:00
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
;; (at your option) any later version.
|
1996-01-14 07:34:30 +00:00
|
|
|
|
|
|
|
|
|
;; GNU Emacs is distributed in the hope that it will be useful,
|
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
2017-09-13 22:52:52 +00:00
|
|
|
|
;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
1991-08-15 21:29:06 +00:00
|
|
|
|
|
2001-07-15 16:15:35 +00:00
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
1992-07-16 07:28:05 +00:00
|
|
|
|
;;; Code:
|
2012-09-17 11:55:05 +00:00
|
|
|
|
(eval-when-compile (require 'cl-lib))
|
|
|
|
|
|
Replace gui-method macros with cl-generic with &context
* lisp/frame.el (gui-method--name, gui-method, gui-method-define)
(gui-method-declare, gui-call): Remove.
(frame-creation-function): Use cl-defgeneric.
(make-frame): Adjust callers.
* lisp/menu-bar.el (menu-bar-edit-menu):
Use gui-backend-selection-exists-p.
* lisp/select.el (x-get-clipboard): Use gui-backend-get-selection.
(gui-backend-get-selection): New cl-generic to replace
gui-get-selection method.
(gui-backend-set-selection): New cl-generic to replace
gui-set-selection method.
(gui-selection-owner-p): New cl-generic to replace
gui-selection-owner-p method.
(gui-backend-selection-exists-p): New cl-generic to replace
gui-selection-exists-p method. Adjust all callers.
* lisp/server.el (server-create-window-system-frame): Don't ignore
window-system spec even when unsupported.
* lisp/simple.el (deactivate-mark): Use new gui-backend-* functions.
* lisp/startup.el (handle-args-function, window-system-initialization):
Use cl-defgeneric.
(command-line): Adjust calls accordingly.
* lisp/term/ns-win.el (ns-window-system-initialization): Turn into
a window-system-initialization method.
(handle-args-function, frame-creation-function): Use cl-defmethod.
(gui-set-selection, gui-selection-owner-p, gui-selection-exists-p)
(gui-get-selection): Use cl-defmethod on the new functions instead.
* lisp/term/pc-win.el (w16-get-selection-value): Turn into
a gui-backend-get-selection method.
(gui-selection-exists-p, gui-selection-owner-p, gui-set-selection):
Use cl-defmethod on the new functions instead.
(msdos-window-system-initialization): Turn into
a window-system-initialization method.
(frame-creation-function, handle-args-function): Use cl-defmethod.
* lisp/term/w32-win.el (w32-window-system-initialization): Turn into
a window-system-initialization method.
(handle-args-function, frame-creation-function): Use cl-defmethod.
(gui-set-selection, gui-selection-owner-p, gui-selection-exists-p)
(gui-get-selection): Use cl-defmethod on the new functions instead.
* lisp/term/x-win.el (x-window-system-initialization): Turn into
a window-system-initialization method.
(handle-args-function, frame-creation-function): Use cl-defmethod.
(gui-set-selection, gui-selection-owner-p, gui-selection-exists-p)
(gui-get-selection): Use cl-defmethod on the new functions instead.
* lisp/term/xterm.el (xterm--set-selection): Turn into
a gui-backend-set-selection method.
* src/nsselect.m (Fns_selection_exists_p): Remove unused arg `terminal'.
(Fns_selection_owner_p): Remove unused arg `terminal'.
(Fns_get_selection): Remove unused args `time_stamp' and `terminal'.
2015-05-23 15:32:29 +00:00
|
|
|
|
(cl-defgeneric frame-creation-function (params)
|
2014-10-01 22:13:11 +00:00
|
|
|
|
"Method for window-system dependent functions to create a new frame.
|
2004-01-11 21:59:40 +00:00
|
|
|
|
The window system startup file should add its frame creation
|
2014-10-01 22:13:11 +00:00
|
|
|
|
function to this method, which should take an alist of parameters
|
2004-01-11 21:59:40 +00:00
|
|
|
|
as its argument.")
|
2004-01-10 12:56:22 +00:00
|
|
|
|
|
* lisp/emacs-lisp/cl-generic.el: Add (major-mode MODE) context
(cl--generic-derived-specializers): New function.
(cl--generic-derived-generalizer): New generalizer.
(cl-generic-generalizers): New specializer (derived-mode MODE).
(cl--generic-split-args): Apply the rewriter, if any.
(cl-generic-define-context-rewriter): New macro.
(major-mode): Use it to define a new context-rewriter, so we can write
`(major-mode MODE)' instead of `(major-mode (derived-mode MODE))'.
* lisp/frame.el (window-system): New context-rewriter so we can write
`(window-system VAL)' instead of (window-system (eql VAL)).
(cl--generic-split-args): Apply the rewriter, if any.
(frame-creation-function): Use the new syntax.
* lisp/term/x-win.el (window-system-initialization)
(handle-args-function, frame-creation-function)
(gui-backend-set-selection, gui-backend-selection-owner-p)
(gui-backend-selection-exists-p, gui-backend-get-selection):
* lisp/term/w32-win.el (window-system-initialization)
(handle-args-function, frame-creation-function)
(gui-backend-set-selection, gui-backend-get-selection)
(gui-backend-selection-owner-p, gui-backend-selection-exists-p):
* lisp/term/pc-win.el (gui-backend-get-selection)
(gui-backend-selection-exists-p, gui-backend-selection-owner-p)
(gui-backend-set-selection, window-system-initialization)
(frame-creation-function, handle-args-function):
* lisp/term/ns-win.el (window-system-initialization)
(handle-args-function, frame-creation-function)
(gui-backend-set-selection, gui-backend-selection-exists-p)
(gui-backend-get-selection):
* lisp/startup.el (handle-args-function):
* lisp/term/xterm.el (gui-backend-get-selection)
(gui-backend-set-selection): Use the new syntax.
2015-10-29 15:06:31 +00:00
|
|
|
|
(cl-generic-define-context-rewriter window-system (value)
|
|
|
|
|
;; If `value' is a `consp', it's probably an old-style specializer,
|
|
|
|
|
;; so just use it, and anyway `eql' isn't very useful on cons cells.
|
2021-08-03 23:02:11 +00:00
|
|
|
|
`(window-system ,(if (consp value) value `(eql ',value))))
|
* lisp/emacs-lisp/cl-generic.el: Add (major-mode MODE) context
(cl--generic-derived-specializers): New function.
(cl--generic-derived-generalizer): New generalizer.
(cl-generic-generalizers): New specializer (derived-mode MODE).
(cl--generic-split-args): Apply the rewriter, if any.
(cl-generic-define-context-rewriter): New macro.
(major-mode): Use it to define a new context-rewriter, so we can write
`(major-mode MODE)' instead of `(major-mode (derived-mode MODE))'.
* lisp/frame.el (window-system): New context-rewriter so we can write
`(window-system VAL)' instead of (window-system (eql VAL)).
(cl--generic-split-args): Apply the rewriter, if any.
(frame-creation-function): Use the new syntax.
* lisp/term/x-win.el (window-system-initialization)
(handle-args-function, frame-creation-function)
(gui-backend-set-selection, gui-backend-selection-owner-p)
(gui-backend-selection-exists-p, gui-backend-get-selection):
* lisp/term/w32-win.el (window-system-initialization)
(handle-args-function, frame-creation-function)
(gui-backend-set-selection, gui-backend-get-selection)
(gui-backend-selection-owner-p, gui-backend-selection-exists-p):
* lisp/term/pc-win.el (gui-backend-get-selection)
(gui-backend-selection-exists-p, gui-backend-selection-owner-p)
(gui-backend-set-selection, window-system-initialization)
(frame-creation-function, handle-args-function):
* lisp/term/ns-win.el (window-system-initialization)
(handle-args-function, frame-creation-function)
(gui-backend-set-selection, gui-backend-selection-exists-p)
(gui-backend-get-selection):
* lisp/startup.el (handle-args-function):
* lisp/term/xterm.el (gui-backend-get-selection)
(gui-backend-set-selection): Use the new syntax.
2015-10-29 15:06:31 +00:00
|
|
|
|
|
|
|
|
|
(cl-defmethod frame-creation-function (params &context (window-system nil))
|
Replace gui-method macros with cl-generic with &context
* lisp/frame.el (gui-method--name, gui-method, gui-method-define)
(gui-method-declare, gui-call): Remove.
(frame-creation-function): Use cl-defgeneric.
(make-frame): Adjust callers.
* lisp/menu-bar.el (menu-bar-edit-menu):
Use gui-backend-selection-exists-p.
* lisp/select.el (x-get-clipboard): Use gui-backend-get-selection.
(gui-backend-get-selection): New cl-generic to replace
gui-get-selection method.
(gui-backend-set-selection): New cl-generic to replace
gui-set-selection method.
(gui-selection-owner-p): New cl-generic to replace
gui-selection-owner-p method.
(gui-backend-selection-exists-p): New cl-generic to replace
gui-selection-exists-p method. Adjust all callers.
* lisp/server.el (server-create-window-system-frame): Don't ignore
window-system spec even when unsupported.
* lisp/simple.el (deactivate-mark): Use new gui-backend-* functions.
* lisp/startup.el (handle-args-function, window-system-initialization):
Use cl-defgeneric.
(command-line): Adjust calls accordingly.
* lisp/term/ns-win.el (ns-window-system-initialization): Turn into
a window-system-initialization method.
(handle-args-function, frame-creation-function): Use cl-defmethod.
(gui-set-selection, gui-selection-owner-p, gui-selection-exists-p)
(gui-get-selection): Use cl-defmethod on the new functions instead.
* lisp/term/pc-win.el (w16-get-selection-value): Turn into
a gui-backend-get-selection method.
(gui-selection-exists-p, gui-selection-owner-p, gui-set-selection):
Use cl-defmethod on the new functions instead.
(msdos-window-system-initialization): Turn into
a window-system-initialization method.
(frame-creation-function, handle-args-function): Use cl-defmethod.
* lisp/term/w32-win.el (w32-window-system-initialization): Turn into
a window-system-initialization method.
(handle-args-function, frame-creation-function): Use cl-defmethod.
(gui-set-selection, gui-selection-owner-p, gui-selection-exists-p)
(gui-get-selection): Use cl-defmethod on the new functions instead.
* lisp/term/x-win.el (x-window-system-initialization): Turn into
a window-system-initialization method.
(handle-args-function, frame-creation-function): Use cl-defmethod.
(gui-set-selection, gui-selection-owner-p, gui-selection-exists-p)
(gui-get-selection): Use cl-defmethod on the new functions instead.
* lisp/term/xterm.el (xterm--set-selection): Turn into
a gui-backend-set-selection method.
* src/nsselect.m (Fns_selection_exists_p): Remove unused arg `terminal'.
(Fns_selection_owner_p): Remove unused arg `terminal'.
(Fns_get_selection): Remove unused args `time_stamp' and `terminal'.
2015-05-23 15:32:29 +00:00
|
|
|
|
;; It's tempting to get rid of tty-create-frame-with-faces and turn it into
|
|
|
|
|
;; this method (i.e. move this method to faces.el), but faces.el is loaded
|
|
|
|
|
;; much earlier from loadup.el (before cl-generic and even before
|
|
|
|
|
;; cl-preloaded), so we'd first have to reorder that part.
|
|
|
|
|
(tty-create-frame-with-faces params))
|
|
|
|
|
|
2004-04-19 15:39:17 +00:00
|
|
|
|
(defvar window-system-default-frame-alist nil
|
2012-01-29 14:22:51 +00:00
|
|
|
|
"Window-system dependent default frame parameters.
|
|
|
|
|
The value should be an alist of elements (WINDOW-SYSTEM . ALIST),
|
2014-10-01 22:13:11 +00:00
|
|
|
|
where WINDOW-SYSTEM is a window system symbol (as returned by `framep')
|
2012-01-29 14:22:51 +00:00
|
|
|
|
and ALIST is a frame parameter alist like `default-frame-alist'.
|
|
|
|
|
Then, for frames on WINDOW-SYSTEM, any parameters specified in
|
|
|
|
|
ALIST supersede the corresponding parameters specified in
|
2009-01-02 14:47:45 +00:00
|
|
|
|
`default-frame-alist'.")
|
2004-04-19 15:39:17 +00:00
|
|
|
|
|
2012-09-17 11:55:05 +00:00
|
|
|
|
(defvar display-format-alist nil
|
|
|
|
|
"Alist of patterns to decode display names.
|
|
|
|
|
The car of each entry is a regular expression matching a display
|
|
|
|
|
name string. The cdr is a symbol giving the window-system that
|
|
|
|
|
handles the corresponding kind of display.")
|
|
|
|
|
|
2001-10-12 20:39:54 +00:00
|
|
|
|
;; The initial value given here used to ask for a minibuffer.
|
|
|
|
|
;; But that's not necessary, because the default is to have one.
|
|
|
|
|
;; By not specifying it here, we let an X resource specify it.
|
2010-06-25 19:32:37 +00:00
|
|
|
|
(defcustom initial-frame-alist nil
|
2009-01-02 14:47:45 +00:00
|
|
|
|
"Alist of parameters for the initial X window frame.
|
|
|
|
|
You can set this in your init file; for example,
|
|
|
|
|
|
|
|
|
|
(setq initial-frame-alist
|
2015-11-17 23:28:50 +00:00
|
|
|
|
\\='((top . 1) (left . 1) (width . 80) (height . 55)))
|
2009-01-02 14:47:45 +00:00
|
|
|
|
|
|
|
|
|
Parameters specified here supersede the values given in
|
|
|
|
|
`default-frame-alist'.
|
|
|
|
|
|
|
|
|
|
If the value calls for a frame without a minibuffer, and you have
|
|
|
|
|
not created a minibuffer frame on your own, a minibuffer frame is
|
|
|
|
|
created according to `minibuffer-frame-alist'.
|
|
|
|
|
|
|
|
|
|
You can specify geometry-related options for just the initial
|
|
|
|
|
frame by setting this variable in your init file; however, they
|
|
|
|
|
won't take effect until Emacs reads your init file, which happens
|
|
|
|
|
after creating the initial frame. If you want the initial frame
|
|
|
|
|
to have the proper geometry as soon as it appears, you need to
|
|
|
|
|
use this three-step process:
|
1994-07-03 20:18:38 +00:00
|
|
|
|
* Specify X resources to give the geometry you want.
|
|
|
|
|
* Set `default-frame-alist' to override these options so that they
|
|
|
|
|
don't affect subsequent frames.
|
|
|
|
|
* Set `initial-frame-alist' in a way that matches the X resources,
|
1998-11-22 15:35:02 +00:00
|
|
|
|
to override what you put in `default-frame-alist'."
|
|
|
|
|
:type '(repeat (cons :format "%v"
|
|
|
|
|
(symbol :tag "Parameter")
|
|
|
|
|
(sexp :tag "Value")))
|
|
|
|
|
:group 'frames)
|
1991-08-15 21:29:06 +00:00
|
|
|
|
|
1999-07-06 18:27:40 +00:00
|
|
|
|
(defcustom minibuffer-frame-alist '((width . 80) (height . 2))
|
2009-05-14 03:50:53 +00:00
|
|
|
|
"Alist of parameters for the initial minibuffer frame.
|
|
|
|
|
This is the minibuffer frame created if `initial-frame-alist'
|
|
|
|
|
calls for a frame without a minibuffer. The parameters specified
|
|
|
|
|
here supersede those given in `default-frame-alist', for the
|
|
|
|
|
initial minibuffer frame.
|
|
|
|
|
|
2009-01-02 14:47:45 +00:00
|
|
|
|
You can set this in your init file; for example,
|
|
|
|
|
|
1992-07-15 00:32:19 +00:00
|
|
|
|
(setq minibuffer-frame-alist
|
2015-11-17 23:28:50 +00:00
|
|
|
|
\\='((top . 1) (left . 1) (width . 80) (height . 2)))
|
2009-01-02 14:47:45 +00:00
|
|
|
|
|
2009-05-14 03:50:53 +00:00
|
|
|
|
It is not necessary to include (minibuffer . only); that is
|
|
|
|
|
appended when the minibuffer frame is created."
|
1999-07-06 18:27:40 +00:00
|
|
|
|
:type '(repeat (cons :format "%v"
|
|
|
|
|
(symbol :tag "Parameter")
|
|
|
|
|
(sexp :tag "Value")))
|
|
|
|
|
:group 'frames)
|
1991-08-15 21:29:06 +00:00
|
|
|
|
|
1994-09-29 04:48:59 +00:00
|
|
|
|
(defun handle-delete-frame (event)
|
1999-07-30 18:39:32 +00:00
|
|
|
|
"Handle delete-frame events from the X server."
|
1994-09-29 04:48:59 +00:00
|
|
|
|
(interactive "e")
|
Add new frame parameters and associated functions
Add new frame parameters `undecorated', `override-redirect',
`parent-frame', `skip-taskbar', `no-focus-on-map',
`no-accept-focus', `z-group', `delete-before', `no-other-frame',
`mouse-wheel-frame', `min-width', `min-height'. Add new
functions `frame-restack' and `frame-list-z-order'.
* lisp/cus-start.el (focus-follows-mouse): Adapt customization
type.
* lisp/frame.el (handle-delete-frame): Handle child and
`delete-before' frames.
(other-frame): Stop looking for other frame after one round.
(frame-list-z-order, frame-restack): New functions.
(delete-other-frames): Handle child frames.
* lisp/frameset.el (frameset-persistent-filter-alist)
(frameset--record-relationships): Handle `delete-before',
`parent-frame' and `mouse-wheel-frame' parameters. Rename
latter from `frameset--record-minibuffer-relationships'.
(frameset--restore-frame): Handle ‘parent-frame’ parameter
specially.
(frameset-restore): Handle `delete-before', `parent-frame' and
`mouse-wheel-frame' parameters.
* lisp/mwheel.el (mwheel-scroll): Handle `mouse-wheel-frame'
parameter.
* lisp/window.el (window--min-size-ignore-p): Fix doc-string.
(mouse-autoselect-window-select, handle-select-window): Major
rewrite. Try to not ignore errors. Handle auto-selection of
child frames and different values of `focus-follows-mouse'.
* src/frame.c (frame_windows_min_size): Handle new `min-width'
and `min-height' frame parameters.
(make_frame): Initialize new frame structure members.
(do_switch_frame): Don't reset internal_last_event_frame for
descendant frames.
(Fframe_parent, frame_ancestor_p, Fframe_ancestor_p): New
functions.
(candidate_frame): Don't return `no-other-frame' frame.
(other_frames): New function replacing other_visible_frames.
(delete_frame): Rewrite. Handle child and `delete-before' frames.
(Fmake_frame_invisible): Call other_frames.
(store_frame_param): Check `delete-before' and `parent-frame'
parameters for circular dependencies.
(frame_parms, syms_of_frame): Add entries for and define new
frame parameters.
(focus_follows_mouse): New meaningful value `auto-raise'.
* src/frame.h (z_group): New enumeration type.
(frame): New slots parent_frame, undecorated, override_redirect,
skip_taskbar, no_focus_on_map, no_accept_focus, z_group.
(fset_parent_frame): New inlined function.
(FRAME_UNDECORATED, FRAME_OVERRIDE_REDIRECT)
(FRAME_PARENT_FRAME, FRAME_SKIP_TASKBAR, FRAME_NO_FOCUS_ON_MAP)
(FRAME_NO_ACCEPT_FOCUS, FRAME_Z_GROUP, FRAME_Z_GROUP_NONE)
(FRAME_Z_GROUP_ABOVE, FRAME_Z_GROUP_ABOVE_SUSPENDED)
(FRAME_Z_GROUP_BELOW): New macros.
(frame_ancestor_p): Add declaration.
* src/gtkutil.c (xg_create_frame_widgets): Handle
`undecorated' and `override-redirect' frame parameters.
(x_wm_set_size_hint): None for child frames.
(xg_set_undecorated, xg_frame_restack, xg_set_skip_taskbar)
(xg_set_no_focus_on_map, xg_set_no_accept_focus)
(xg_set_override_redirect): New functions.
(xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos):
Don't let scrollbars obscure child frames.
* src/gtkutil.h: (xg_set_undecorated, xg_frame_restack)
(xg_set_skip_taskbar, xg_set_no_focus_on_map)
(xg_set_no_accept_focus, xg_set_override_redirect): Add extern
declarations.
* src/nsfns.m (ns_frame_parm_handlers): Add entries for new
frame parameters.
(Fx_create_frame): Install `min-width' and `min-height' frame
parameters.
* src/nsterm.m (mouseMoved:): Handle focus_follows_mouse change.
* src/w32fns.c (WS_EX_NOACTIVATE): Define if necessary.
(x_real_positions): Handle child frames.
(x_set_menu_bar_lines): Don't for child frames.
(x_set_undecorated, x_set_parent_frame, x_set_skip_taskbar)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_z_group): New functions.
(w32_createvscrollbar, w32_createhscrollbar): Don't draw
scroll bars over child frames.
(w32_createwindow): Handle new frame parameters and child frames.
(w32_wnd_proc): Let mouse clicks into a child frame activate
the frame. Try to handle the `no-accept-focus' parameter. Do
SetFocus when our window is brought to top or becomes the
foreground window.
(w32_window): Don't initialize menu bar for child frames.
(Fx_create_frame): Handle new frame parameters.
(x_create_tip_frame): Set explicit_parent slot.
(w32_dialog_in_progress): New function.
(Fx_file_dialog): Handle `z-group-above' frames.
(w32_frame_list_z_order, Fw32_frame_list_z_order)
(w32_frame_restack, Fw32_frame_restack): New functions.
(w32_frame_parm_handlers): Add entries for new frame
parameters.
* src/w32font.c (Fx_select_font): Handle `z-group-above'
frames during font selection dialogue.
* src/w32term.c (construct_mouse_wheel): Construct mouse wheel
event from F's w32 window.
(w32_mouse_position): Handle child frames.
(w32_set_vertical_scroll_bar, w32_set_horizontal_scroll_bar):
Don't draw scroll bars over child frames.
(w32_read_socket): Always erase background of child frames.
When generating SELECT_WINDOW_EVENTs handle new value of
`focus-follows-mouse' and handle `no-accept-focus' parameter.
Handle `mouse-wheel-frame' parameter.
(x_calc_absolute_position, x_set_offset, x_set_window_size):
Handle child frames.
(x_make_frame_visible): Handle child frames specially. Handle
`no-focus-on-map' parameter.
* src/w32term.h (w32_dialog_in_progress): Add external
declaration.
* src/xdisp.c (x_consider_frame_title, prepare_menu_bars): Not
for child frames.
* src/xfns.c (Xm/MwmUtil.h): Include for WM hints.
(PropMotifWmHints, PROP_MOTIF_WM_HINTS_ELEMENTS): Define for
non-Motif, non-GTK case.
(x_real_pos_and_offsets): Handle child frames.
(x_set_undecorated, x_set_parent_frame)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_override_redirect): New functions.
(x_set_menu_bar_lines): Not for child frames.
(x_window): Handle `undecorated' and `override_redirect' cases.
(Fx_create_frame): Handle new frame parameters.
(frame_geometry): Handle child frames and outer border.
(x_frame_list_z_order, Fx_frame_list_z_order)
(x_frame_restack, Fx_frame_restack): New functions.
(Fx_file_dialog, Fx_select_font): Set x_menu_set_in_use.
(x_frame_parm_handlers): Add entries for new frame parameters.
* src/xmenu.c (x_menu_set_in_use): Handle `z-group-above'
frames.
* src/xterm.c (x_set_frame_alpha): Don't set alpha of parent
for child frames.
(XTmouse_position): Handle child frames.
(x_scroll_bar_create, x_scroll_bar_expose): Don't let scroll
bars obscure child frames.
(handle_one_xevent): Handle child frame positions. If necessary
set `skip-taskbar' and reassign proper `z-group' when we are
mapped. When generating SELECT_WINDOW_EVENTs handle new value
of `focus-follows-mouse'. Handle `mouse-wheel-frame' parameter.
Let mouse clicks into a child frame activate the frame.
(x_calc_absolute_position, x_set_offset): Handle child frames
specially.
(x_set_skip_taskbar, x_set_z_group): New functions.
(x_make_frame_visible): Handle child frames.
(ATOM_REFS_INIT): Add entries for
Xatom_net_wm_state_skip_taskbar, Xatom_net_wm_state_above,
Xatom_net_wm_state_below.
* src/xterm.h (top-level): Declare Xatom_net_wm_state_above,
Xatom_net_wm_state_below and Xatom_net_wm_state_skip_taskbar.
(x_set_skip_taskbar, x_set_z_group): Add extern declarations.
2017-04-12 08:38:25 +00:00
|
|
|
|
(let* ((frame (posn-window (event-start event))))
|
|
|
|
|
(if (catch 'other-frame
|
|
|
|
|
(dolist (frame-1 (frame-list))
|
2017-04-30 08:02:53 +00:00
|
|
|
|
;; A valid "other" frame is visible, has its `delete-before'
|
|
|
|
|
;; parameter unset and is not a child frame.
|
Add new frame parameters and associated functions
Add new frame parameters `undecorated', `override-redirect',
`parent-frame', `skip-taskbar', `no-focus-on-map',
`no-accept-focus', `z-group', `delete-before', `no-other-frame',
`mouse-wheel-frame', `min-width', `min-height'. Add new
functions `frame-restack' and `frame-list-z-order'.
* lisp/cus-start.el (focus-follows-mouse): Adapt customization
type.
* lisp/frame.el (handle-delete-frame): Handle child and
`delete-before' frames.
(other-frame): Stop looking for other frame after one round.
(frame-list-z-order, frame-restack): New functions.
(delete-other-frames): Handle child frames.
* lisp/frameset.el (frameset-persistent-filter-alist)
(frameset--record-relationships): Handle `delete-before',
`parent-frame' and `mouse-wheel-frame' parameters. Rename
latter from `frameset--record-minibuffer-relationships'.
(frameset--restore-frame): Handle ‘parent-frame’ parameter
specially.
(frameset-restore): Handle `delete-before', `parent-frame' and
`mouse-wheel-frame' parameters.
* lisp/mwheel.el (mwheel-scroll): Handle `mouse-wheel-frame'
parameter.
* lisp/window.el (window--min-size-ignore-p): Fix doc-string.
(mouse-autoselect-window-select, handle-select-window): Major
rewrite. Try to not ignore errors. Handle auto-selection of
child frames and different values of `focus-follows-mouse'.
* src/frame.c (frame_windows_min_size): Handle new `min-width'
and `min-height' frame parameters.
(make_frame): Initialize new frame structure members.
(do_switch_frame): Don't reset internal_last_event_frame for
descendant frames.
(Fframe_parent, frame_ancestor_p, Fframe_ancestor_p): New
functions.
(candidate_frame): Don't return `no-other-frame' frame.
(other_frames): New function replacing other_visible_frames.
(delete_frame): Rewrite. Handle child and `delete-before' frames.
(Fmake_frame_invisible): Call other_frames.
(store_frame_param): Check `delete-before' and `parent-frame'
parameters for circular dependencies.
(frame_parms, syms_of_frame): Add entries for and define new
frame parameters.
(focus_follows_mouse): New meaningful value `auto-raise'.
* src/frame.h (z_group): New enumeration type.
(frame): New slots parent_frame, undecorated, override_redirect,
skip_taskbar, no_focus_on_map, no_accept_focus, z_group.
(fset_parent_frame): New inlined function.
(FRAME_UNDECORATED, FRAME_OVERRIDE_REDIRECT)
(FRAME_PARENT_FRAME, FRAME_SKIP_TASKBAR, FRAME_NO_FOCUS_ON_MAP)
(FRAME_NO_ACCEPT_FOCUS, FRAME_Z_GROUP, FRAME_Z_GROUP_NONE)
(FRAME_Z_GROUP_ABOVE, FRAME_Z_GROUP_ABOVE_SUSPENDED)
(FRAME_Z_GROUP_BELOW): New macros.
(frame_ancestor_p): Add declaration.
* src/gtkutil.c (xg_create_frame_widgets): Handle
`undecorated' and `override-redirect' frame parameters.
(x_wm_set_size_hint): None for child frames.
(xg_set_undecorated, xg_frame_restack, xg_set_skip_taskbar)
(xg_set_no_focus_on_map, xg_set_no_accept_focus)
(xg_set_override_redirect): New functions.
(xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos):
Don't let scrollbars obscure child frames.
* src/gtkutil.h: (xg_set_undecorated, xg_frame_restack)
(xg_set_skip_taskbar, xg_set_no_focus_on_map)
(xg_set_no_accept_focus, xg_set_override_redirect): Add extern
declarations.
* src/nsfns.m (ns_frame_parm_handlers): Add entries for new
frame parameters.
(Fx_create_frame): Install `min-width' and `min-height' frame
parameters.
* src/nsterm.m (mouseMoved:): Handle focus_follows_mouse change.
* src/w32fns.c (WS_EX_NOACTIVATE): Define if necessary.
(x_real_positions): Handle child frames.
(x_set_menu_bar_lines): Don't for child frames.
(x_set_undecorated, x_set_parent_frame, x_set_skip_taskbar)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_z_group): New functions.
(w32_createvscrollbar, w32_createhscrollbar): Don't draw
scroll bars over child frames.
(w32_createwindow): Handle new frame parameters and child frames.
(w32_wnd_proc): Let mouse clicks into a child frame activate
the frame. Try to handle the `no-accept-focus' parameter. Do
SetFocus when our window is brought to top or becomes the
foreground window.
(w32_window): Don't initialize menu bar for child frames.
(Fx_create_frame): Handle new frame parameters.
(x_create_tip_frame): Set explicit_parent slot.
(w32_dialog_in_progress): New function.
(Fx_file_dialog): Handle `z-group-above' frames.
(w32_frame_list_z_order, Fw32_frame_list_z_order)
(w32_frame_restack, Fw32_frame_restack): New functions.
(w32_frame_parm_handlers): Add entries for new frame
parameters.
* src/w32font.c (Fx_select_font): Handle `z-group-above'
frames during font selection dialogue.
* src/w32term.c (construct_mouse_wheel): Construct mouse wheel
event from F's w32 window.
(w32_mouse_position): Handle child frames.
(w32_set_vertical_scroll_bar, w32_set_horizontal_scroll_bar):
Don't draw scroll bars over child frames.
(w32_read_socket): Always erase background of child frames.
When generating SELECT_WINDOW_EVENTs handle new value of
`focus-follows-mouse' and handle `no-accept-focus' parameter.
Handle `mouse-wheel-frame' parameter.
(x_calc_absolute_position, x_set_offset, x_set_window_size):
Handle child frames.
(x_make_frame_visible): Handle child frames specially. Handle
`no-focus-on-map' parameter.
* src/w32term.h (w32_dialog_in_progress): Add external
declaration.
* src/xdisp.c (x_consider_frame_title, prepare_menu_bars): Not
for child frames.
* src/xfns.c (Xm/MwmUtil.h): Include for WM hints.
(PropMotifWmHints, PROP_MOTIF_WM_HINTS_ELEMENTS): Define for
non-Motif, non-GTK case.
(x_real_pos_and_offsets): Handle child frames.
(x_set_undecorated, x_set_parent_frame)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_override_redirect): New functions.
(x_set_menu_bar_lines): Not for child frames.
(x_window): Handle `undecorated' and `override_redirect' cases.
(Fx_create_frame): Handle new frame parameters.
(frame_geometry): Handle child frames and outer border.
(x_frame_list_z_order, Fx_frame_list_z_order)
(x_frame_restack, Fx_frame_restack): New functions.
(Fx_file_dialog, Fx_select_font): Set x_menu_set_in_use.
(x_frame_parm_handlers): Add entries for new frame parameters.
* src/xmenu.c (x_menu_set_in_use): Handle `z-group-above'
frames.
* src/xterm.c (x_set_frame_alpha): Don't set alpha of parent
for child frames.
(XTmouse_position): Handle child frames.
(x_scroll_bar_create, x_scroll_bar_expose): Don't let scroll
bars obscure child frames.
(handle_one_xevent): Handle child frame positions. If necessary
set `skip-taskbar' and reassign proper `z-group' when we are
mapped. When generating SELECT_WINDOW_EVENTs handle new value
of `focus-follows-mouse'. Handle `mouse-wheel-frame' parameter.
Let mouse clicks into a child frame activate the frame.
(x_calc_absolute_position, x_set_offset): Handle child frames
specially.
(x_set_skip_taskbar, x_set_z_group): New functions.
(x_make_frame_visible): Handle child frames.
(ATOM_REFS_INIT): Add entries for
Xatom_net_wm_state_skip_taskbar, Xatom_net_wm_state_above,
Xatom_net_wm_state_below.
* src/xterm.h (top-level): Declare Xatom_net_wm_state_above,
Xatom_net_wm_state_below and Xatom_net_wm_state_skip_taskbar.
(x_set_skip_taskbar, x_set_z_group): Add extern declarations.
2017-04-12 08:38:25 +00:00
|
|
|
|
(when (and (not (eq frame-1 frame))
|
|
|
|
|
(frame-visible-p frame-1)
|
|
|
|
|
(not (frame-parent frame-1))
|
|
|
|
|
(not (frame-parameter frame-1 'delete-before)))
|
|
|
|
|
(throw 'other-frame t))))
|
1994-09-29 04:48:59 +00:00
|
|
|
|
(delete-frame frame t)
|
1996-02-28 00:08:58 +00:00
|
|
|
|
;; Gildea@x.org says it is ok to ask questions before terminating.
|
|
|
|
|
(save-buffers-kill-emacs))))
|
2013-11-25 02:41:02 +00:00
|
|
|
|
|
2018-06-11 21:58:09 +00:00
|
|
|
|
(defun frame-focus-state (&optional frame)
|
|
|
|
|
"Return FRAME's last known focus state.
|
2018-06-12 16:26:44 +00:00
|
|
|
|
If nil or omitted, FRAME defaults to the selected frame.
|
|
|
|
|
|
2018-06-11 21:58:09 +00:00
|
|
|
|
Return nil if the frame is definitely known not be focused, t if
|
2018-06-12 16:26:44 +00:00
|
|
|
|
the frame is known to be focused, and `unknown' if we don't know."
|
2018-06-11 21:58:09 +00:00
|
|
|
|
(let* ((frame (or frame (selected-frame)))
|
|
|
|
|
(tty-top-frame (tty-top-frame frame)))
|
|
|
|
|
(if (not tty-top-frame)
|
|
|
|
|
(frame-parameter frame 'last-focus-update)
|
|
|
|
|
;; All tty frames are frame-visible-p if the terminal is
|
|
|
|
|
;; visible, so check whether the frame is the top tty frame
|
|
|
|
|
;; before checking visibility.
|
|
|
|
|
(cond ((not (eq tty-top-frame frame)) nil)
|
|
|
|
|
((not (frame-visible-p frame)) nil)
|
|
|
|
|
(t (let ((tty-focus-state
|
|
|
|
|
(terminal-parameter frame 'tty-focus-state)))
|
|
|
|
|
(cond ((eq tty-focus-state 'focused) t)
|
|
|
|
|
((eq tty-focus-state 'defocused) nil)
|
|
|
|
|
(t 'unknown))))))))
|
|
|
|
|
|
|
|
|
|
(defvar after-focus-change-function #'ignore
|
|
|
|
|
"Function called after frame focus may have changed.
|
|
|
|
|
|
|
|
|
|
This function is called with no arguments when Emacs notices that
|
|
|
|
|
the set of focused frames may have changed. Code wanting to do
|
|
|
|
|
something when frame focus changes should use `add-function' to
|
|
|
|
|
add a function to this one, and in this added function, re-scan
|
|
|
|
|
the set of focused frames, calling `frame-focus-state' to
|
|
|
|
|
retrieve the last known focus state of each frame. Focus events
|
|
|
|
|
are delivered asynchronously, and frame input focus according to
|
|
|
|
|
an external system may not correspond to the notion of the Emacs
|
|
|
|
|
selected frame. Multiple frames may appear to have input focus
|
|
|
|
|
simultaneously due to focus event delivery differences, the
|
|
|
|
|
presence of multiple Emacs terminals, and other factors, and code
|
|
|
|
|
should be robust in the face of this situation.
|
|
|
|
|
|
|
|
|
|
Depending on window system, focus events may also be delivered
|
|
|
|
|
repeatedly and with different focus states before settling to the
|
|
|
|
|
expected values. Code relying on focus notifications should
|
|
|
|
|
\"debounce\" any user-visible updates arising from focus changes,
|
|
|
|
|
perhaps by deferring work until redisplay.
|
|
|
|
|
|
|
|
|
|
This function may be called in arbitrary contexts, including from
|
|
|
|
|
inside `read-event', so take the same care as you might when
|
|
|
|
|
writing a process filter.")
|
|
|
|
|
|
|
|
|
|
(defvar focus-in-hook nil
|
|
|
|
|
"Normal hook run when a frame gains focus.
|
|
|
|
|
The frame gaining focus is selected at the time this hook is run.
|
|
|
|
|
|
|
|
|
|
This hook is obsolete. Despite its name, this hook may be run in
|
|
|
|
|
situations other than when a frame obtains input focus: for
|
|
|
|
|
example, we also run this hook when switching the selected frame
|
|
|
|
|
internally to handle certain input events (like mouse wheel
|
|
|
|
|
scrolling) even when the user's notion of input focus
|
|
|
|
|
hasn't changed.
|
|
|
|
|
|
|
|
|
|
Prefer using `after-focus-change-function'.")
|
|
|
|
|
(make-obsolete-variable
|
|
|
|
|
'focus-in-hook "after-focus-change-function" "27.1" 'set)
|
|
|
|
|
|
|
|
|
|
(defvar focus-out-hook nil
|
|
|
|
|
"Normal hook run when all frames lost input focus.
|
|
|
|
|
|
|
|
|
|
This hook is obsolete; see `focus-in-hook'. Depending on timing,
|
|
|
|
|
this hook may be delivered when a frame does in fact have focus.
|
|
|
|
|
Prefer `after-focus-change-function'.")
|
|
|
|
|
(make-obsolete-variable
|
|
|
|
|
'focus-out-hook "after-focus-change-function" "27.1" 'set)
|
|
|
|
|
|
|
|
|
|
(defun handle-focus-in (event)
|
2013-11-25 02:41:02 +00:00
|
|
|
|
"Handle a focus-in event.
|
2018-06-11 21:58:09 +00:00
|
|
|
|
Focus-in events are bound to this function; do not change this
|
|
|
|
|
binding. Focus-in events occur when a frame receives focus from
|
|
|
|
|
the window system."
|
|
|
|
|
;; N.B. tty focus goes down a different path; see xterm.el.
|
2013-11-25 15:05:25 +00:00
|
|
|
|
(interactive "e")
|
2018-06-11 21:58:09 +00:00
|
|
|
|
(unless (eq (car-safe event) 'focus-in)
|
|
|
|
|
(error "handle-focus-in should handle focus-in events"))
|
|
|
|
|
(let ((frame (nth 1 event)))
|
2018-06-13 06:09:23 +00:00
|
|
|
|
(when (frame-live-p frame)
|
|
|
|
|
(internal-handle-focus-in event)
|
|
|
|
|
(setf (frame-parameter frame 'last-focus-update) t)
|
|
|
|
|
(run-hooks 'focus-in-hook)))
|
|
|
|
|
(funcall after-focus-change-function))
|
2018-06-11 21:58:09 +00:00
|
|
|
|
|
|
|
|
|
(defun handle-focus-out (event)
|
2013-11-25 02:41:02 +00:00
|
|
|
|
"Handle a focus-out event.
|
2018-06-11 21:58:09 +00:00
|
|
|
|
Focus-out events are bound to this function; do not change this
|
|
|
|
|
binding. Focus-out events occur when a frame loses focus, but
|
|
|
|
|
that's not the whole story: see `after-focus-change-function'."
|
|
|
|
|
;; N.B. tty focus goes down a different path; see xterm.el.
|
2013-11-25 15:05:25 +00:00
|
|
|
|
(interactive "e")
|
2018-06-11 21:58:09 +00:00
|
|
|
|
(unless (eq (car event) 'focus-out)
|
|
|
|
|
(error "handle-focus-out should handle focus-out events"))
|
|
|
|
|
(let ((frame (nth 1 event)))
|
2018-06-13 06:09:23 +00:00
|
|
|
|
(when (frame-live-p frame)
|
|
|
|
|
(setf (frame-parameter frame 'last-focus-update) nil)
|
|
|
|
|
(run-hooks 'focus-out-hook)))
|
|
|
|
|
(funcall after-focus-change-function))
|
2017-04-11 10:37:26 +00:00
|
|
|
|
|
|
|
|
|
(defun handle-move-frame (event)
|
|
|
|
|
"Handle a move-frame event.
|
|
|
|
|
This function runs the abnormal hook `move-frame-functions'."
|
|
|
|
|
(interactive "e")
|
|
|
|
|
(let ((frame (posn-window (event-start event))))
|
|
|
|
|
(run-hook-with-args 'move-frame-functions frame)))
|
1991-08-15 21:29:06 +00:00
|
|
|
|
|
1992-07-15 00:32:19 +00:00
|
|
|
|
;;;; Arrangement of frames at startup
|
1991-08-15 21:29:06 +00:00
|
|
|
|
|
2001-10-12 20:39:54 +00:00
|
|
|
|
;; 1) Load the window system startup file from the lisp library and read the
|
|
|
|
|
;; high-priority arguments (-q and the like). The window system startup
|
|
|
|
|
;; file should create any frames specified in the window system defaults.
|
|
|
|
|
;;
|
|
|
|
|
;; 2) If no frames have been opened, we open an initial text frame.
|
|
|
|
|
;;
|
|
|
|
|
;; 3) Once the init file is done, we apply any newly set parameters
|
|
|
|
|
;; in initial-frame-alist to the frame.
|
1991-08-15 21:29:06 +00:00
|
|
|
|
|
2001-10-12 20:39:54 +00:00
|
|
|
|
;; If we create the initial frame, this is it.
|
1992-07-15 00:32:19 +00:00
|
|
|
|
(defvar frame-initial-frame nil)
|
1991-08-15 21:29:06 +00:00
|
|
|
|
|
1993-07-27 08:34:34 +00:00
|
|
|
|
;; Record the parameters used in frame-initialize to make the initial frame.
|
|
|
|
|
(defvar frame-initial-frame-alist)
|
|
|
|
|
|
1994-05-05 22:37:47 +00:00
|
|
|
|
(defvar frame-initial-geometry-arguments nil)
|
|
|
|
|
|
2001-10-12 20:39:54 +00:00
|
|
|
|
;; startup.el calls this function before loading the user's init
|
|
|
|
|
;; file - if there is no frame with a minibuffer open now, create
|
|
|
|
|
;; one to display messages while loading the init file.
|
1992-07-15 00:32:19 +00:00
|
|
|
|
(defun frame-initialize ()
|
2001-01-29 17:01:52 +00:00
|
|
|
|
"Create an initial frame if necessary."
|
1991-08-15 21:29:06 +00:00
|
|
|
|
;; Are we actually running under a window system at all?
|
2004-01-11 21:59:40 +00:00
|
|
|
|
(if (and initial-window-system
|
|
|
|
|
(not noninteractive)
|
|
|
|
|
(not (eq initial-window-system 'pc)))
|
* frame.el: Clean up initialization code.
(initial-frame-alist): Doc fix.
(minibuffer-frame-alist): New default value, with a reasonable height.
(filtered-frame-list, minibuffer-frame-list): New functions.
(frame-initialize): Use minibuffer-frame-list, instead of writing
it out.
(frame-notice-user-settings): Thoroughly rearranged.
Notice changes to default-frame-alist as well as initial-frame-alist.
Properly handle requests to make the initial frame into a
minibufferless or minibuffer-only frame.
Create a minibuffer-only frame if the initial frame should lack a
minibuffer and there are no other minibuffer frames created by the
user's initialization file.
Fix any frames using the initial frame as a surrogate minibuffer
frame.
Restore the current buffer after creating and deleting all these
frames.
* frame.el (set-default-font, set-frame-background,
set-frame-foreground, set-cursor-color, set-pointer-color,
set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Give these docstrings.
(set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Make these toggle or look at the prefix
argument, like minor modes.
* frame.el (set-vertical-bar): Use the proper parameter symbol.
(set-horizontal-bar): Signal an error indicating that horizontal
scrollbars are not implemented.
1993-02-14 14:29:30 +00:00
|
|
|
|
(progn
|
|
|
|
|
;; If there is no frame with a minibuffer besides the terminal
|
|
|
|
|
;; frame, then we need to create the opening frame. Make sure
|
|
|
|
|
;; it has a minibuffer, but let initial-frame-alist omit the
|
|
|
|
|
;; minibuffer spec.
|
|
|
|
|
(or (delq terminal-frame (minibuffer-frame-list))
|
1993-05-25 02:28:39 +00:00
|
|
|
|
(progn
|
1993-07-27 08:34:34 +00:00
|
|
|
|
(setq frame-initial-frame-alist
|
2001-01-30 15:06:47 +00:00
|
|
|
|
(append initial-frame-alist default-frame-alist nil))
|
2004-01-11 21:59:40 +00:00
|
|
|
|
(setq frame-initial-frame-alist
|
|
|
|
|
(cons (cons 'window-system initial-window-system)
|
|
|
|
|
frame-initial-frame-alist))
|
1993-05-25 02:28:39 +00:00
|
|
|
|
(setq default-minibuffer-frame
|
|
|
|
|
(setq frame-initial-frame
|
1997-07-21 05:59:08 +00:00
|
|
|
|
(make-frame frame-initial-frame-alist)))
|
1993-06-02 19:10:31 +00:00
|
|
|
|
;; Delete any specifications for window geometry parameters
|
|
|
|
|
;; so that we won't reapply them in frame-notice-user-settings.
|
|
|
|
|
;; It would be wrong to reapply them then,
|
|
|
|
|
;; because that would override explicit user resizing.
|
1993-07-04 02:20:59 +00:00
|
|
|
|
(setq initial-frame-alist
|
1994-05-04 04:27:18 +00:00
|
|
|
|
(frame-remove-geometry-params initial-frame-alist))))
|
2006-05-26 17:37:25 +00:00
|
|
|
|
;; Copy the environment of the Emacs process into the new frame.
|
|
|
|
|
(set-frame-parameter frame-initial-frame 'environment
|
|
|
|
|
(frame-parameter terminal-frame 'environment))
|
1995-01-26 22:52:10 +00:00
|
|
|
|
;; At this point, we know that we have a frame open, so we
|
1992-07-15 00:32:19 +00:00
|
|
|
|
;; can delete the terminal frame.
|
|
|
|
|
(delete-frame terminal-frame)
|
2004-01-11 21:59:40 +00:00
|
|
|
|
(setq terminal-frame nil))))
|
1995-01-26 22:52:10 +00:00
|
|
|
|
|
2000-01-13 14:46:19 +00:00
|
|
|
|
(defvar frame-notice-user-settings t
|
|
|
|
|
"Non-nil means function `frame-notice-user-settings' wasn't run yet.")
|
|
|
|
|
|
2008-06-12 03:56:20 +00:00
|
|
|
|
(declare-function tool-bar-mode "tool-bar" (&optional arg))
|
2015-05-09 00:13:47 +00:00
|
|
|
|
(declare-function tool-bar-height "xdisp.c" (&optional frame pixelwise))
|
2008-06-12 03:56:20 +00:00
|
|
|
|
|
2021-04-12 16:32:07 +00:00
|
|
|
|
(defalias 'tool-bar-lines-needed #'tool-bar-height)
|
Support resizing frames and windows pixelwise.
* dispextern.h (enum window_part): Add ON_SCROLL_BAR,
ON_RIGHT_DIVIDER and ON_BOTTOM_DIVIDER.
(struct glyph_matrix): Replace window_left_col and
window_top_line by window_pixel_left and window_pixel_top.
(WINDOW_WANTS_MODELINE_P, WINDOW_WANTS_HEADER_LINE_P): Minor
rewrite.
(enum face_id): Add WINDOW_DIVIDER_FACE_ID.
(draw_window_divider, move_it_to, x_draw_right_divider)
(x_draw_bottom_divider, change_frame_size): Add or fix
declarations.
* dispnew.c (change_frame_size_1): Change prototype.
(adjust_glyph_matrix, required_matrix_width)
(adjust_frame_glyphs_for_window_redisplay): Use pixel
values instead of lines and columns.
(marginal_area_string): Use WINDOW_FRINGES_WIDTH instead of
WINDOW_TOTAL_FRINGE_WIDTH.
(handle_window_change_signal, do_pending_window_change)
(init_display): Adjusts calls of change_frame_size.
(change_frame_size, change_frame_size_1): Handle pixelwise
changes.
* frame.c (Qright_divider_width, Qbottom_divider_width): New
Lisp objects.
(set_menu_bar_lines_1, set_menu_bar_lines, make_frame)
(make_terminal_frame, Fmake_terminal_frame, Fframe_parameters)
(x_set_internal_border_width, x_set_vertical_scroll_bars)
(x_set_scroll_bar_width, x_figure_window_size): Handle pixel
values.
(set_frame_param): New function.
(Fframe_text_cols, Fframe_text_lines, Fframe_total_cols)
(Fframe_text_width, Fframe_text_height, Fscroll_bar_width)
(Ffringe_width, Fborder_width, Fright_divider_width)
(Fbottom_divider_width): New functions, defsubr them.
(Fset_frame_height, Fset_frame_width, Fset_frame_size): New
argument pixelwise.
(struct frame_parm_table): New members Qright_divider_width and
Qbottom_divider_width.
(x_set_frame_parameters): Handle parameters for pixelwise sizes.
(x_report_frame_params): Handle Qright_divider_width and
Qbottom_divider_width.
(x_set_right_divider_width, x_set_bottom_divider_width): New
functions.
(frame_resize_pixelwise): New option.
* frame.h (struct frame): Add tool_bar_height, menu_bar_height,
new_pixelwise, right_divider_width and bottom_divider_width;
remove total_lines; rename text_lines, text_cols, new_text_lines
and new_text_cols to text_height, text_width, new_height and
new_width respectively.
(FRAME_LINES, FRAME_COLS): Rename to FRAME_TEXT_HEIGHT and
FRAME_TEXT_WIDTH respectively.
(FRAME_MENU_BAR_HEIGHT, FRAME_TOOL_BAR_HEIGHT)
(FRAME_RIGHT_DIVIDER_WIDTH, FRAME_BOTTOM_DIVIDER_WIDTH)
(FRAME_TEXT_TO_PIXEL_WIDTH, FRAME_PIXEL_TO_TEXT_WIDTH): New
macros.
(FRAME_TOP_MARGIN_HEIGHT, FRAME_LEFT_SCROLL_BAR_AREA_WIDTH)
(FRAME_RIGHT_SCROLL_BAR_AREA_WIDTH, FRAME_SCROLL_BAR_AREA_WIDTH)
(SET_FRAME_COLS, SET_FRAME_WIDTH, SET_FRAME_HEIGHT)
(FRAME_TEXT_COLS_TO_PIXEL_WIDTH, FRAME_PIXEL_WIDTH_TO_TEXT_COLS)
(FRAME_TEXT_COLS_TO_PIXEL_WIDTH): Rewrite macros.
(FRAME_TOTAL_COLS_ARG): Remove macro.
* fringe.c (draw_fringe_bitmap_1): Handle right divder.
* gtkutil.c (xg_frame_resized, xg_frame_set_char_size)
(x_wm_set_size_hint): Handle frame pixel sizes.
* indent.c (compute_motion, Fcompute_motion): Call
window_body_width instead of window_body_cols.
* keyboard.c (Qright_divider, Qbottom_divider): New symbols.
(make_lispy_position): Handle right and bottom dividers.
(Fsuspend_emacs): Pixelize call of change_frame_size.
* keyboard.h: Extern Qright_divider, Qbottom_divider.
* lisp.h: Extern set_frame_param.
* nsfns.m (x_set_tool_bar_lines): Pixelize call of
x_set_window_size.
(Fx_create_frame): Add entry for vertical_drag_cursor. Pixelize
call of change_frame_size.
* nsterm.h (struct ns_output): Add vertical_drag_cursor.
* nsterm.m (ns_update_window_end): Optionally draw right
divider.
(x_set_window_size): Add argument pixelwise. Call
check_frame_size and change_frame_size with pixelwise zero.
(ns_draw_window_divider): New function.
(ns_redisplay_interface): Add ns_draw_window_divider.
(updateFrameSize:): Call change_frame_size with pixelwise zero.
(x_new_font): Call x_set_window_size with pixelwise zero.
* print.c (print_object): For a window print its sequence
number again.
* term.c (Fresume_tty): Pixelize call of change_frame_size.
* w32fns.c (x_set_mouse_color): Handle vertical drag cursor.
(x_set_menu_bar_lines, x_set_tool_bar_lines): Calculate pixelwise.
(w32_createwindow): Use scroll bar area width.
(w32_wnd_proc): Handle bottom divider width. For
WM_WINDOWPOSCHANGING return zero if we resize pixelwise.
(Fx_create_frame): Default divider width parameters. Caclulate
sizes pixelwise. Add vertical drag cursor support.
(x_create_tip_frame): Default divider widths to zero. Pixelize
call to change_frame_size.
(Fx_show_tip): Add handling of divider widths. Pixelize window
position and sizes.
(Fw32_frame_rect): New function.
(frame_parm_handler w32_frame_parm_handlers): Add divider
widths.
(Vx_window_vertical_drag_shape): Add variable.
* w32inevt.c (resize_event, maybe_generate_resize_event):
Pixelize change_frame_size calls.
* w32menu.c (set_frame_menubar): Pixelize x_set_window_size
call.
* w32term.c (w32_draw_window_divider): New function.
(x_update_window_end): Handle right divider.
(w32_draw_fringe_bitmap, x_scroll_run)
(w32_set_vertical_scroll_bar): Pixelize scrollbar widths.
(w32_read_socket): Handle SIZE_MAXIMIZED separately. Calculate
new frame sizes pixelwise.
(x_new_font): Pixelize call to x_set_window_size.
(x_check_fullscreen): Pixelize call to change_frame_size.
(x_set_window_size_1, x_set_window_size): New argument
pixelwise. Calculate pixelwise.
(x_wm_set_size_hint): Use scroll bar area width.
(w32_redisplay_interface): Add w32_draw_window_divider.
* w32term.h (struct w32_output): Add vertical drag cursor.
* widget.c (set_frame_size, update_wm_hints)
(EmacsFrameResize, EmacsFrameSetValues): Pixelize calls of
change_frame_size.
(EmacsFrameSetCharSize): Pixelize call of x_set_window_size.
* window.c (sequence_number): Restore.
(Fwindow_pixel_width, Fwindow_pixel_height)
(Fwindow_mode_line_height, Fwindow_header_line_height)
(window_pixel_to_total, Frun_window_scroll_functions)
(Fset_window_new_pixel, window_resize_apply_total)
(Fwindow_resize_apply_total): New functions.
(window_body_height, window_body_width): Rename from
window_body_lines. New argument PIXELWISE. Calculate
pixelwise.
(Fwindow_body_height, Fwindow_body_width): New argument
PIXELWISE.
(coordinates_in_window, window_relative_x_coord): Use window's
pixel width instead of total width.
(replace_window, recombine_windows): Initialize pixel values.
(resize_root_window, resize_frame_windows, grow_mini_window)
(shrink_mini_window): New argument PIXELWISE. Calculate
pixelwise.
(Fdelete_other_windows_internal, adjust_window_margins)
(window_resize_check, window_resize_apply)
(Fdelete_window_internal, Fresize_mini_window_internal)
(Fwindow_text_width, Fwindow_text_height): Calculate pixelwise.
(check_frame_size): Rename arguments. New argument PIXELWISE.
Calculate pixelwise.
(set_window_buffer): Make samebuf bool. Run configuration change
hook only if buffer changed.
(Fset_window_buffer): Rewrite doc-string.
(make_window): Initialize new_pixel slot.
(Fwindow_resize_apply): Check pixel size of root window.
(Fsplit_window_internal): Call 2nd argument pixel_size.
Calculate pixelwise.
(Fscroll_left, Fscroll_right): Call window_body_width instead of
window_body_cols.
(save_window_data): New slots frame_text_width,
frame_text_height, frame_menu_bar_height, frame_tool_bar_height.
(saved_window): New slots pixel_left, pixel_top, pixel_height,
pixel_width.
(Fcurrent_window_configuration, Fset_window_configuration)
(save_window_save, compare_window_configurations): Handle new
slots in save_window_data and saved_window.
(Fset_window_scroll_bars): Fix doc-string.
(window_resize_pixelwise): New variable.
(coordinates_in_window, Fcoordinates_in_window_p): Handle
dividers.
(make_parent_window): Adjust sequence_number.
(Fwindow_right_divider_width, Fwindow_bottom_divider_width): New
functions.
* window.h (struct window): New members new_pixel, pixel_left,
pixel_top, pixel_width, pixel_height. Restore sequence_number.
(wset_new_pixel): New function.
(WINDOW_PIXEL_WIDTH, WINDOW_PIXEL_HEIGHT)
(MIN_SAFE_WINDOW_PIXEL_WIDTH, MIN_SAFE_WINDOW_PIXEL_HEIGHT)
(WINDOW_LEFT_PIXEL_EDGE, WINDOW_RIGHT_PIXEL_EDGE)
(WINDOW_TOP_PIXEL_EDGE, WINDOW_BOTTOM_PIXEL_EDGE)
(WINDOW_BOTTOMMOST_P, WINDOW_BOX_LEFT_PIXEL_EDGE)
(WINDOW_BOX_RIGHT_PIXEL_EDGE, WINDOW_MARGINS_COLS)
(WINDOW_MARGINS_WIDTH, WINDOW_RIGHT_DIVIDER_WIDTH)
(WINDOW_BOTTOM_DIVIDER_WIDTH): New macros.
(WINDOW_TOTAL_FRINGE_WIDTH): Rename to WINDOW_FRINGES_WIDTH.
(WINDOW_TOTAL_WIDTH, WINDOW_TOTAL_HEIGHT): Remove macros.
(WINDOW_RIGHT_EDGE_X, WINDOW_LEFT_EDGE_X, WINDOW_TOP_EDGE_Y)
(WINDOW_BOTTOM_EDGE_Y, WINDOW_FULL_WIDTH_P, WINDOW_LEFTMOST_P)
(WINDOW_RIGHTMOST_P, WINDOW_BOX_LEFT_EDGE_X)
(WINDOW_BOX_RIGHT_EDGE_X, WINDOW_FRINGE_COLS)
(WINDOW_BOX_HEIGHT_NO_MODE_LINE, WINDOW_BOX_TEXT_HEIGHT):
Rewrite.
(resize_frame_windows, grow_mini_window, shrink_mini_window)
(window_body_width, check_frame_size): Adapt external declarations.
* xdisp.c (last_max_ascent): New integer.
(window_text_bottom_y): Handle bottom divider.
(window_box_width, window_box_height): Calculate pixelwise.
(get_glyph_string_clip_rects): Handle right divider.
(remember_mouse_glyph): When windows are resized pixelwise
proceed with width and height set to 1.
(init_iterator): Use WINDOW_PIXEL_WIDTH instead of
WINDOW_TOTAL_WIDTH.
(move_it_to): Calculate and return maximum x position
encountered.
(Fwindow_text_pixel_size): New function.
(resize_mini_window, update_tool_bar): Calculate pixelwise.
(tool_bar_lines_needed): Rename to tool_bar_height. Calculate
pixelwise.
(Ftool_bar_lines_needed): Rename to Ftool_bar_height. Calculate
pixelwise.
(redisplay_tool_bar): Calculate pixelwise.
(redisplay_window): Calculate pixelwise. Handle dividers.
(draw_glyphs, x_clear_end_of_line, note_mouse_highlight)
(x_draw_vertical_border): Handle dividers.
(define_frame_cursor1): Handle vertical drag cursor.
(x_draw_right_divider, x_draw_bottom_divider): New functions.
(expose_window): Calculate pixelwise. Handle dividers.
(init_xdisp): Initialize pixel values.
* xfaces.c (Qwindow_divider): New face.
(realize_basic_faces): Realize it.
* xfns.c (x_set_mouse_color): Handle vertical_drag_cursor.
(x_set_menu_bar_lines, x_set_tool_bar_lines): Calculate pixelwise.
(x_set_scroll_bar_default_width): Default actual width to 16.
(Fx_create_frame): Set sizes pixelwise.
(x_create_tip_frame): Default divider widths to zero. Pixelize
call of change_frame_size.
(Fx_show_tip): Handle divider widths. Initial pixel position
and sizes.
(frame_parm_handler x_frame_parm_handlers): Add divider widths.
(Vx_window_vertical_drag_shape): New option.
* xmenu.c (free_frame_menubar): Pixelize call of
x_set_window_size.
* xterm.c (x_draw_window_divider): New function.
(x_update_window_end): Optionally draw right divider.
(x_draw_fringe_bitmap, x_scroll_run, x_scroll_bar_create)
(XTset_vertical_scroll_bar): Use scroll bar pixel width.
(handle_one_xevent, x_new_font): Calculate pixelwise.
(x_set_window_size_1, x_set_window_size): New argument
pixelwise. Calculate pixelwise.
(x_wm_set_size_hint): Pixelize call of check_frame_size.
(struct x_redisplay_interface): Add x_draw_window_divider.
* xterm.h (struct x_output): Add vertical_drag_cursor.
* cus-start.el (frame-resize-pixelwise)
(window-resize-pixelwise): New entries.
* emacs-lisp/debug.el (debug): Use window-total-height instead
of window-total-size.
* frame.el (tool-bar-lines-needed): Defalias to tool-bar-height.
* help.el (describe-bindings-internal): Call help-buffer
(temp-buffer-max-width): New option.
(resize-temp-buffer-window, help-window-setup)
(with-help-window): Rewrite.
* mouse.el (mouse-drag-line): Rewrite. Add key bindings for
dragging dividers.
* window.el (frame-char-size, window-min-pixel-height)
(window-safe-min-pixel-height, window-safe-min-pixel-width)
(window-min-pixel-width, window-safe-min-pixel-size)
(window-combination-p, window-safe-min-size)
(window-resizable-p, window--size-to-pixel)
(window--pixel-to-size, window--resize-apply-p): New functions.
(window-safe-min-height): Fix doc-string.
(window-size, window-min-size, window--min-size-1)
(window-sizable, window-sizable-p, window--min-delta-1)
(window-min-delta, window--max-delta-1, window-max-delta)
(window--resizable, window--resizable-p, window-resizable)
(window-full-height-p, window-full-width-p, window-at-side-p)
(window--in-direction-2, window-in-direction)
(window--resize-reset-1, window--resize-mini-window)
(window-resize, window-resize-no-error)
(window--resize-child-windows-normal)
(window--resize-child-windows, window--resize-siblings)
(window--resize-this-window, window--resize-root-window)
(window--resize-root-window-vertically)
(adjust-window-trailing-edge, enlarge-window, shrink-window)
(maximize-window, minimize-window, delete-window)
(quit-restore-window, window-split-min-size, split-window)
(balance-windows-2, balance-windows)
(balance-windows-area-adjust, balance-windows-area)
(window--state-get-1, window-state-get, window--state-put-1)
(window--state-put-2, window-state-put)
(display-buffer-record-window, window--display-buffer): Make
functions handle pixelwise sizing of windows.
(display-buffer--action-function-custom-type)
(display-buffer-fallback-action): Add
display-buffer-in-previous-window.
(display-buffer-use-some-window): Resize window to height it had
before.
(fit-window-to-buffer-horizontally): New option.
(fit-frame-to-buffer): Describe new values.
(fit-frame-to-buffer-bottom-margin): Replace with
fit-frame-to-buffer-margins.
(window--sanitize-margin): New function.
(fit-frame-to-buffer, fit-window-to-buffer): Rewrite completely
using window-text-pixel-size.
2013-11-30 09:25:31 +00:00
|
|
|
|
|
2001-10-12 20:39:54 +00:00
|
|
|
|
;; startup.el calls this function after loading the user's init
|
|
|
|
|
;; file. Now default-frame-alist and initial-frame-alist contain
|
|
|
|
|
;; information to which we must react; do what needs to be done.
|
1992-07-15 00:32:19 +00:00
|
|
|
|
(defun frame-notice-user-settings ()
|
1999-07-30 18:39:32 +00:00
|
|
|
|
"Act on user's init file settings of frame parameters.
|
2005-09-07 23:11:21 +00:00
|
|
|
|
React to settings of `initial-frame-alist',
|
|
|
|
|
`window-system-default-frame-alist' and `default-frame-alist'
|
|
|
|
|
there (in decreasing order of priority)."
|
* frame.el: Clean up initialization code.
(initial-frame-alist): Doc fix.
(minibuffer-frame-alist): New default value, with a reasonable height.
(filtered-frame-list, minibuffer-frame-list): New functions.
(frame-initialize): Use minibuffer-frame-list, instead of writing
it out.
(frame-notice-user-settings): Thoroughly rearranged.
Notice changes to default-frame-alist as well as initial-frame-alist.
Properly handle requests to make the initial frame into a
minibufferless or minibuffer-only frame.
Create a minibuffer-only frame if the initial frame should lack a
minibuffer and there are no other minibuffer frames created by the
user's initialization file.
Fix any frames using the initial frame as a surrogate minibuffer
frame.
Restore the current buffer after creating and deleting all these
frames.
* frame.el (set-default-font, set-frame-background,
set-frame-foreground, set-cursor-color, set-pointer-color,
set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Give these docstrings.
(set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Make these toggle or look at the prefix
argument, like minor modes.
* frame.el (set-vertical-bar): Use the proper parameter symbol.
(set-horizontal-bar): Signal an error indicating that horizontal
scrollbars are not implemented.
1993-02-14 14:29:30 +00:00
|
|
|
|
;; Creating and deleting frames may shift the selected frame around,
|
|
|
|
|
;; and thus the current buffer. Protect against that. We don't
|
|
|
|
|
;; want to use save-excursion here, because that may also try to set
|
|
|
|
|
;; the buffer of the selected window, which fails when the selected
|
|
|
|
|
;; window is the minibuffer.
|
2019-03-05 09:46:19 +00:00
|
|
|
|
(let* ((old-buffer (current-buffer))
|
|
|
|
|
(window-system-frame-alist
|
|
|
|
|
(cdr (assq initial-window-system
|
|
|
|
|
window-system-default-frame-alist)))
|
|
|
|
|
(minibuffer
|
|
|
|
|
(cdr (or (assq 'minibuffer initial-frame-alist)
|
|
|
|
|
(assq 'minibuffer window-system-frame-alist)
|
|
|
|
|
(assq 'minibuffer default-frame-alist)
|
|
|
|
|
'(minibuffer . t)))))
|
* frame.el: Clean up initialization code.
(initial-frame-alist): Doc fix.
(minibuffer-frame-alist): New default value, with a reasonable height.
(filtered-frame-list, minibuffer-frame-list): New functions.
(frame-initialize): Use minibuffer-frame-list, instead of writing
it out.
(frame-notice-user-settings): Thoroughly rearranged.
Notice changes to default-frame-alist as well as initial-frame-alist.
Properly handle requests to make the initial frame into a
minibufferless or minibuffer-only frame.
Create a minibuffer-only frame if the initial frame should lack a
minibuffer and there are no other minibuffer frames created by the
user's initialization file.
Fix any frames using the initial frame as a surrogate minibuffer
frame.
Restore the current buffer after creating and deleting all these
frames.
* frame.el (set-default-font, set-frame-background,
set-frame-foreground, set-cursor-color, set-pointer-color,
set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Give these docstrings.
(set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Make these toggle or look at the prefix
argument, like minor modes.
* frame.el (set-vertical-bar): Use the proper parameter symbol.
(set-horizontal-bar): Signal an error indicating that horizontal
scrollbars are not implemented.
1993-02-14 14:29:30 +00:00
|
|
|
|
|
2000-01-13 14:46:19 +00:00
|
|
|
|
(when (and frame-notice-user-settings
|
|
|
|
|
(null frame-initial-frame))
|
2000-10-28 17:18:21 +00:00
|
|
|
|
;; This case happens when we don't have a window system, and
|
|
|
|
|
;; also for MS-DOS frames.
|
2010-11-13 18:34:02 +00:00
|
|
|
|
(let ((parms (frame-parameters)))
|
2000-01-13 14:46:19 +00:00
|
|
|
|
;; Don't change the frame names.
|
|
|
|
|
(setq parms (delq (assq 'name parms) parms))
|
|
|
|
|
;; Can't modify the minibuffer parameter, so don't try.
|
|
|
|
|
(setq parms (delq (assq 'minibuffer parms) parms))
|
2010-11-13 18:34:02 +00:00
|
|
|
|
(modify-frame-parameters
|
|
|
|
|
nil
|
|
|
|
|
(if initial-window-system
|
|
|
|
|
parms
|
|
|
|
|
;; initial-frame-alist and default-frame-alist were already
|
|
|
|
|
;; applied in pc-win.el.
|
|
|
|
|
(append initial-frame-alist window-system-frame-alist
|
|
|
|
|
default-frame-alist parms nil)))
|
2004-01-11 21:59:40 +00:00
|
|
|
|
(if (null initial-window-system) ;; MS-DOS does this differently in pc-win.el
|
2000-10-28 17:18:21 +00:00
|
|
|
|
(let ((newparms (frame-parameters))
|
|
|
|
|
(frame (selected-frame)))
|
|
|
|
|
(tty-handle-reverse-video frame newparms)
|
2015-02-08 16:17:40 +00:00
|
|
|
|
;; tty-handle-reverse-video might change the frame's
|
|
|
|
|
;; color parameters, and we need to use the updated
|
|
|
|
|
;; value below.
|
|
|
|
|
(setq newparms (frame-parameters))
|
2000-10-28 17:18:21 +00:00
|
|
|
|
;; If we changed the background color, we need to update
|
|
|
|
|
;; the background-mode parameter, and maybe some faces,
|
|
|
|
|
;; too.
|
|
|
|
|
(when (assq 'background-color newparms)
|
|
|
|
|
(unless (or (assq 'background-mode initial-frame-alist)
|
|
|
|
|
(assq 'background-mode default-frame-alist))
|
|
|
|
|
(frame-set-background-mode frame))
|
2015-02-08 16:17:40 +00:00
|
|
|
|
(face-set-after-frame-default frame newparms))))))
|
2000-01-13 14:46:19 +00:00
|
|
|
|
|
* frame.el: Clean up initialization code.
(initial-frame-alist): Doc fix.
(minibuffer-frame-alist): New default value, with a reasonable height.
(filtered-frame-list, minibuffer-frame-list): New functions.
(frame-initialize): Use minibuffer-frame-list, instead of writing
it out.
(frame-notice-user-settings): Thoroughly rearranged.
Notice changes to default-frame-alist as well as initial-frame-alist.
Properly handle requests to make the initial frame into a
minibufferless or minibuffer-only frame.
Create a minibuffer-only frame if the initial frame should lack a
minibuffer and there are no other minibuffer frames created by the
user's initialization file.
Fix any frames using the initial frame as a surrogate minibuffer
frame.
Restore the current buffer after creating and deleting all these
frames.
* frame.el (set-default-font, set-frame-background,
set-frame-foreground, set-cursor-color, set-pointer-color,
set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Give these docstrings.
(set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Make these toggle or look at the prefix
argument, like minor modes.
* frame.el (set-vertical-bar): Use the proper parameter symbol.
(set-horizontal-bar): Signal an error indicating that horizontal
scrollbars are not implemented.
1993-02-14 14:29:30 +00:00
|
|
|
|
;; If the initial frame is still around, apply initial-frame-alist
|
|
|
|
|
;; and default-frame-alist to it.
|
2001-01-30 15:06:47 +00:00
|
|
|
|
(when (frame-live-p frame-initial-frame)
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
;; When tab-bar has been switched off, correct the frame size
|
|
|
|
|
;; by the lines added in x-create-frame for the tab-bar and
|
|
|
|
|
;; switch `tab-bar-mode' off.
|
|
|
|
|
(when (display-graphic-p)
|
2021-03-26 17:13:59 +00:00
|
|
|
|
(declare-function tab-bar-height "xdisp.c" (&optional frame pixelwise))
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
(let* ((init-lines
|
|
|
|
|
(assq 'tab-bar-lines initial-frame-alist))
|
|
|
|
|
(other-lines
|
|
|
|
|
(or (assq 'tab-bar-lines window-system-frame-alist)
|
|
|
|
|
(assq 'tab-bar-lines default-frame-alist)))
|
|
|
|
|
(lines (or init-lines other-lines))
|
|
|
|
|
(height (tab-bar-height frame-initial-frame t)))
|
|
|
|
|
;; Adjust frame top if either zero (nil) tab bar lines have
|
|
|
|
|
;; been requested in the most relevant of the frame's alists
|
|
|
|
|
;; or tab bar mode has been explicitly turned off in the
|
|
|
|
|
;; user's init file.
|
|
|
|
|
(when (and (> height 0)
|
|
|
|
|
(or (and lines
|
|
|
|
|
(or (null (cdr lines))
|
|
|
|
|
(eq 0 (cdr lines))))
|
|
|
|
|
(not tab-bar-mode)))
|
|
|
|
|
(let* ((initial-top
|
|
|
|
|
(cdr (assq 'top frame-initial-geometry-arguments)))
|
|
|
|
|
(top (frame-parameter frame-initial-frame 'top)))
|
|
|
|
|
(when (and (consp initial-top) (eq '- (car initial-top)))
|
|
|
|
|
(let ((adjusted-top
|
|
|
|
|
(cond
|
|
|
|
|
((and (consp top) (eq '+ (car top)))
|
|
|
|
|
(list '+ (+ (cadr top) height)))
|
|
|
|
|
((and (consp top) (eq '- (car top)))
|
|
|
|
|
(list '- (- (cadr top) height)))
|
|
|
|
|
(t (+ top height)))))
|
|
|
|
|
(modify-frame-parameters
|
|
|
|
|
frame-initial-frame `((top . ,adjusted-top))))))
|
|
|
|
|
;; Reset `tab-bar-mode' when zero tab bar lines have been
|
|
|
|
|
;; requested for the window-system or default frame alists.
|
|
|
|
|
(when (and tab-bar-mode
|
|
|
|
|
(and other-lines
|
|
|
|
|
(or (null (cdr other-lines))
|
|
|
|
|
(eq 0 (cdr other-lines)))))
|
|
|
|
|
(tab-bar-mode -1)))))
|
|
|
|
|
|
2001-01-30 15:06:47 +00:00
|
|
|
|
;; When tool-bar has been switched off, correct the frame size
|
|
|
|
|
;; by the lines added in x-create-frame for the tool-bar and
|
|
|
|
|
;; switch `tool-bar-mode' off.
|
2001-02-02 13:55:42 +00:00
|
|
|
|
(when (display-graphic-p)
|
2015-01-12 07:18:00 +00:00
|
|
|
|
(let* ((init-lines
|
|
|
|
|
(assq 'tool-bar-lines initial-frame-alist))
|
|
|
|
|
(other-lines
|
|
|
|
|
(or (assq 'tool-bar-lines window-system-frame-alist)
|
|
|
|
|
(assq 'tool-bar-lines default-frame-alist)))
|
|
|
|
|
(lines (or init-lines other-lines))
|
|
|
|
|
(height (tool-bar-height frame-initial-frame t)))
|
|
|
|
|
;; Adjust frame top if either zero (nil) tool bar lines have
|
|
|
|
|
;; been requested in the most relevant of the frame's alists
|
|
|
|
|
;; or tool bar mode has been explicitly turned off in the
|
|
|
|
|
;; user's init file.
|
|
|
|
|
(when (and (> height 0)
|
|
|
|
|
(or (and lines
|
|
|
|
|
(or (null (cdr lines))
|
|
|
|
|
(eq 0 (cdr lines))))
|
|
|
|
|
(not tool-bar-mode)))
|
Complete pixelwise frame/window resizing, add horizontal scrollbar support.
* frame.el (frame-notice-user-settings): Rewrite using
frame-initial-frame-tool-bar-height.
* menu-bar.el (menu-bar-horizontal-scroll-bar)
(menu-bar-no-horizontal-scroll-bar): New functions.
(menu-bar-showhide-scroll-bar-menu): Add bindings for horizontal
scroll bars.
* scroll-bar.el (scroll-bar-lines)
(set-horizontal-scroll-bar-mode)
(get-horizontal-scroll-bar-mode, horizontal-scroll-bar-mode)
(scroll-bar-horizontal-drag-1, scroll-bar-horizontal-drag)
(scroll-bar-toolkit-horizontal-scroll): New functions.
(horizontal-scroll-bar-mode)
(previous-horizontal-scroll-bar-mode)
(horizontal-scroll-bar-mode-explicit): New variables.
(horizontal-scroll-bar-mode): New option.
(toggle-horizontal-scroll-bar): Do something.
(top-level): Bind horizontal-scroll-bar mouse-1.
* startup.el (tool-bar-originally-present): Remove variable.
(command-line): Don't set tool-bar-originally-present.
* window.el (window-min-height): Update doc-string.
(window--dump-frame): Dump horizontal scroll bar values.
(window--min-size-1): Handle minibuffer window separately.
Count in margins and horizontal scroll bar. Return safe value
iff IGNORE equals 'safe.
(frame-windows-min-size): New function (used by frame resizing
routines).
(fit-frame-to-buffer, fit-window-to-buffer): Count in horizontal
scroll bars.
(window--sanitize-window-sizes): New function.
(window-split-min-size): Remove.
(split-window): Count divider-width. Don't use
`window-split-min-size' any more. Reword error messages.
Sanitize windows sizes after splitting.
* buffer.h (struct buffer): New fields scroll_bar_height and
horizontal_scroll_bar_type.
* buffer.c (bset_scroll_bar_height)
(bset_horizontal_scroll_bar_type): New functions.
(Fbuffer_swap_text): Handle old_pointm field.
(init_buffer_once): Set defaults for scroll_bar_height and
horizontal_scroll_bar_type.
(syms_of_buffer): New variables scroll_bar_height and
horizontal_scroll_bar_type.
* dispextern.h (window_part): Rename ON_SCROLL_BAR to
ON_VERTICAL_SCROLL_BAR. Add ON_HORIZONTAL_SCROLL_BAR.
(set_vertical_scroll_bar): Remove prototype.
(x_change_tool_bar_height): Add prototype.
* dispnew.c (adjust_frame_glyphs_for_frame_redisplay)
(window_to_frame_vpos, update_frame_1, scrolling, init_display):
Use FRAME_TOTAL_COLS and FRAME_TOTAL_LINES instead of FRAME_COLS
and FRAME_LINES.
(adjust_frame_glyphs_for_window_redisplay): Rearrange lines.
(update_window): Start mode_line_row->y after horizontal scroll
bar.
(change_frame_size_1): Call adjust_frame_size.
(init_display): When changing the size of a tty frame do not
pass height of menu bar.
(Qframe_windows_min_size): New symbol.
* frame.h (struct frame): List tool bar fields after menu bar
fields. Add official, total_lines, horizontal_scroll_bars,
config_scroll_bar_height and config_scroll_bar_lines fields.
(FRAME_HAS_HORIZONTAL_SCROLL_BARS)
(FRAME_CONFIG_SCROLL_BAR_HEIGHT, FRAME_CONFIG_SCROLL_BAR_LINES)
(FRAME_SCROLL_BAR_AREA_HEIGHT, FRAME_SCROLL_BAR_COLS)
(FRAME_SCROLL_BAR_LINES, FRAME_TOTAL_LINES, SET_FRAME_LINES)
(FRAME_WINDOWS_HEIGHT): New macros.
(SET_FRAME_HEIGHT, FRAME_TEXT_LINES_TO_PIXEL_HEIGHT)
(FRAME_PIXEL_Y_TO_LINE, FRAME_PIXEL_HEIGHT_TO_TEXT_LINES)
(FRAME_TEXT_TO_PIXEL_HEIGHT): Separately count top margin and
horizontal scroll bar.
(frame_inhibit_resize, adjust_frame_size)
(frame_windows_min_size): Add declarations.
(Qscroll_bar_height, Qhorizontal_scroll_bars)
(x_set_scroll_bar_default_height, x_set_left_fringe)
(x_set_right_fringe, x_set_vertical_scroll_bars)
(x_set_horizontal_scroll_bars, x_set_scroll_bar_width)
(x_set_scroll_bar_height): Add external declarations.
* frame.c: (frame_inhibit_resize, frame_windows_min_size)
(adjust_frame_size): New functions.
(make_frame): Initial horizontal_scroll_bars field. Use
SET_FRAME_LINES. Don't allow horizontal scroll bar in
minibuffer window.
(make_initial_frame, make_terminal_frame): No horizontal scroll
bar in initial and terminal frames. Use adjust_frame_size.
(Fframe_total_cols): Fix doc-string.
(Fframe_total_lines, Fscroll_bar_height): New Lisp functions.
(Fset_frame_height, Fset_frame_width, Fset_frame_size): Rewrite
using adjust_frame_size.
(Qscroll_bar_height, Qhorizontal_scroll_bars)
(Qframe_windows_min_size): New symbols.
(x_set_frame_parameters): Remove call of check_frame_size.
(x_report_frame_params): Return scroll_bar_height value.
(x_set_left_fringe, x_set_right_fringe): New functions.
(adjust_frame_height, x_set_internal_border_width)
(x_set_fringe_width): Remove.
(x_set_internal_border_width, x_set_vertical_scroll_bars)
(x_set_scroll_bar_width, x_set_right_divider_width)
(x_set_bottom_divider_width): Rewrite using adjust_frame_size.
(x_set_horizontal_scroll_bars, x_set_scroll_bar_height): New
functions.
(x_figure_window_size): Rewrite to make frame display the
expected number of lines.
(Vdefault_frame_scroll_bars): Rewrite doc-string.
(Vdefault_frame_horizontal_scroll_bars)
(Vframe_initial_frame_tool_bar_height)
(frame_inhibit_implied_resize): New variables.
* fringe.c (compute_fringe_widths): Remove.
* gtkutil.h (YG_SB_MIN, YG_SB_MAX, YG_SB_RANGE): Define.
(xg_create_horizontal_scroll_bar)
(xg_update_horizontal_scrollbar_pos)
(xg_set_toolkit_horizontal_scroll_bar_thumb)
(xg_get_default_scrollbar_height)
(xg_clear_under_internal_border): Extern.
* gtkutil.c (xg_frame_resized): Don't call
do_pending_window_change.
(xg_frame_set_char_size): Use adjust_frame_size.
(style_changed_cb): Call update_theme_scrollbar_height and
x_set_scroll_bar_default_height.
(x_wm_set_size_hint): Don't call check_frame_size.
(update_theme_scrollbar_height)
(xg_get_default_scrollbar_height)
(xg_create_horizontal_scroll_bar)
(xg_update_horizontal_scrollbar_pos)
(xg_set_toolkit_horizontal_scroll_bar_thumb): New functions.
(xg_create_scroll_bar): Set horizontal slot of bar.
(xg_initialize): Call update_theme_scrollbar_height.
(xg_clear_under_internal_border): No more static.
* insdel.c (adjust_suspend_auto_hscroll): New function.
(adjust_markers_for_delete, adjust_markers_for_insert)
(adjust_markers_for_replace): Call adjust_suspend_auto_hscroll.
* keyboard.c (readable_events, discard_mouse_events)
(make_lispy_event): Handle horizontal scroll bar click events.
(Fsuspend_emacs): When changing the size of a tty frame do not
pass height of menu bar.
(Qbefore_handle, Qhorizontal_handle, Qafter_handle, Qleft)
(Qright, Qleftmost, Qrightmost): New symbols.
* menu.c (Fx_popup_dialog): Use FRAME_TOTAL_LINES instead of
FRAME_LINES.
* minibuf.c (read_minibuf): Initialize suspend_auto_hscroll.
* nsfns.m (x_set_internal_border_width): New function.
* nsterm.m (ns_draw_fringe_bitmap, ns_set_vertical_scroll_bar):
Remove extended fringe code.
(x_set_window_size, x_new_font): Don't call
compute_fringe_widths.
* term.c (Fresume_tty): When changing the size of a tty frame do
not pass height of menu bar.
(clear_tty_hooks, set_tty_hooks): Clear
horizontal_scroll_bar_hook.
(init_tty): Frame has no horizontal scroll bars.
* termhooks.h (enum scroll_bar_part): Add scroll_bar_move_ratio,
scroll_bar_before_handle, scroll_bar_horizontal_handle,
scroll_bar_after_handle, scroll_bar_left_arrow,
scroll_bar_right_arrow, scroll_bar_to_leftmost and
scroll_bar_to_rightmost entries.
(enum event_kind): Add HORIZONTAL_SCROLL_BAR_CLICK_EVENT
(struct terminal): Add set_horizontal_scroll_bar_hook.
* w32console.c (initialize_w32_display): Clear
horizontal_scroll_bar_hook.
* w32fns.c (x_set_mouse_color): Use FRAME_W32_DISPLAY instead of
FRAME_X_DISPLAY.
(x_clear_under_internal_border, x_set_internal_border_width):
New functions.
(x_set_menu_bar_lines): Rewrite using frame_inhibit_resize. Set
windows_or_buffers_changed when adding the menu bar.
(x_set_tool_bar_lines): Rewrite using adjust_frame_size.
(x_change_tool_bar_height, x_set_scroll_bar_default_height)
(w32_createhscrollbar): New functions.
(w32_createscrollbar): Rename to w32_createvscrollbar.
(w32_createwindow): Init WND_HSCROLLBAR_INDEX.
(w32_name_of_message): Replace WM_EMACS_CREATESCROLLBAR by
WM_EMACS_CREATEVSCROLLBAR and WM_EMACS_CREATEHSCROLLBAR. Add
WM_EMACS_SHOWCURSOR.
(w32_wnd_proc): Handle WM_HSCROLL case. In WM_WINDOWPOSCHANGING
case do not artificially impose WM size hints. Handle
WM_EMACS_SHOWCURSOR case. Replace WM_EMACS_CREATESCROLLBAR case
by WM_EMACS_CREATEVSCROLLBAR and WM_EMACS_CREATEHSCROLLBAR
cases.
(my_create_tip_window): Replace WND_SCROLLBAR_INDEX by
WND_VSCROLLBAR_INDEX and WND_HSCROLLBAR_INDEX.
(unwind_create_frame_1): Remove.
(Fx_create_frame): Make both scrollbars the system standard
width and height. Use official field of frame structure to
inhibit running window-configuration-change-hook.
(x_create_tip_frame): Call SET_FRAME_LINES and change_frame_size
pixelwise. Handle frame's official field.
(w32_frame_parm_handlers): Remove x_set_fringe_width
entries. Add x_set_scroll_bar_height,
x_set_horizontal_scroll_bars, x_set_left_fringe and
x_set_right_fringe.
* w32inevt.c (resize_event, maybe_generate_resize_event): Do not
pass height of menu bar to change_frame_size.
* w32menu.c (set_frame_menubar): Rewrite using
frame_inhibit_resize.
* w32term.h (struct w32_display_info): Add
horizontal_scroll_bar_cursor and cursor_display_counter.
(struct scroll_bar): Add horizontal.
(HORIZONTAL_SCROLL_BAR_INSIDE_HEIGHT)
(HORIZONTAL_SCROLL_BAR_LEFT_RANGE)
(HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH)
(HORIZONTAL_SCROLL_BAR_LEFT_BORDER)
(HORIZONTAL_SCROLL_BAR_RIGHT_BORDER)
(HORIZONTAL_SCROLL_BAR_TOP_BORDER)
(HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER)
(HORIZONTAL_SCROLL_BAR_MIN_HANDLE): New macros.
(WM_EMACS_CREATEVSCROLLBAR, WM_EMACS_CREATEHSCROLLBAR): Define
instead of WM_EMACS_CREATESCROLLBAR.
(WND_VSCROLLBAR_INDEX, WND_HSCROLLBAR_INDEX): Define instead of
WND_SCROLLBAR_INDEX.
* w32term.c (horizontal_scroll_bar_min_handle)
(horizontal_scroll_bar_left_border)
(horizontal_scroll_bar_right_border): New integers.
(x_set_frame_alpha): Replace x_highlight_frame by
w32_focus_frame.
(x_window_to_scroll_bar): New argument "type". Update callers
accordingly.
(w32_set_horizontal_scroll_bar_thumb)
(x_horizontal_scroll_bar_report_motion)
(w32_set_horizontal_scroll_bar)
(w32_horizontal_scroll_bar_handle_click)
(x_horizontal_scroll_bar_report_motion): New functions.
(w32_mouse_position): Discriminate horizontal and vertical
scrollbar cases.
(my_create_scrollbar): Replace with two new functions
my_create_vscrollbar and my_create_hscrollbar.
(x_scroll_bar_create): New argument "horizontal". Update
callers accordingly.
(x_scroll_bar_remove, w32_condemn_scroll_bars)
(w32_redeem_scroll_bar, x_scroll_bar_clear): Handle horizontal
scroll bar case.
(w32_read_socket): Handle WM_HSCROLL cae.
(x_new_font): Don't recompute fringe widths. Use
frame_inhibit_resize. Calculate new menu bar height iff we
build without toolkit. Always clear under internal border.
(x_set_window_size): Don't check frame size or recompute
fringes. Reset fullscreen status before applying sizes. Always
resize as requested by pixelwise argument. Don't call
do_pending_window_change.
(x_wm_set_size_hint): Add call for FRAME_SCROLL_BAR_AREA_HEIGHT.
(w32_initialize_display_info): Initialize dpyinfo's
horizontal_scroll_bar_cursor entry.
(w32_create_terminal): Add set_horizontal_scroll_bar_hook.
(w32_initialize): Init horizontal_scroll_bar_min_handle and
horizontal_scroll_bar_left_border.
(w32fullscreen_hook): Intermittently resize window to normal
when switching from fullscreen to maximized state.
(run_window_configuration_change_hook): Don't run it if frame is
not official yet.
(unwind_change_frame): Remove.
(Fset_window_configuration): Rewrite using frame's official field.
* widget.c (set_frame_size): Don't call compute_fringe_widths.
(EmacsFrameSetCharSize): Obey frame_inhibit_resize.
* window.h (struct window): New fields old_pointm,
horizontal_scroll_bar, horizontal_scroll_bar_type, hscroll_whole,
scroll_bar_height and suspend_auto_hscroll.
(wset_horizontal_scroll_bar, wset_horizontal_scroll_bar_type):
New functions.
(sanitize_window_sizes): Extern.
(MINI_NON_ONLY_WINDOW_P, MINI_ONLY_WINDOW_P, WINDOW_PSEUDO_P)
(WINDOW_TOPMOST_P, WINDOW_HAS_HORIZONTAL_SCROLL_BAR)
(WINDOW_CONFIG_SCROLL_BAR_HEIGHT)
(WINDOW_CONFIG_SCROLL_BAR_LINES)
(WINDOW_SCROLL_BAR_LINES, WINDOW_SCROLL_BAR_AREA_HEIGHT): New
macros.
(WINDOW_LEFT_FRINGE_COLS, WINDOW_RIGHT_FRINGE_COLS)
(WINDOW_FRINGE_COLS, WINDOW_FRINGE_EXTENDED_P): Remove macros.
(WINDOW_VERTICAL_SCROLL_BAR_TYPE)
(WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT)
(WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT)
(WINDOW_HAS_VERTICAL_SCROLL_BAR): Minor rewrite.
(WINDOW_BOX_HEIGHT_NO_MODE_LINE, WINDOW_BOX_TEXT_HEIGHT)
(WINDOW_SCROLL_BAR_AREA_Y): Count in scroll bar height.
* window.c (wset_old_pointm, Fwindow_scroll_bar_height)
(Fwindow_old_point, sanitize_window_sizes): New functions.
(Qwindow_sanitize_window_sizes): New symbol.
(window_body_height): Count in horizontal scroll bar.
(set_window_hscroll, Fscroll_left, Fscroll_right): Set
suspend_auto_hscroll slot.
(Fwindow_inside_edges): Count fringes pixelwise.
(coordinates_in_window, Fcoordinates_in_window_p): Consider
horizontal scroll bar.
(check_frame_size, adjust_window_margins): Remove functions and
corresponding calls.
(set_window_buffer): Initialize old_pointm and horizontal scroll
bars.
(temp_output_buffer_show): Reset hscroll related fields.
Initialize old_pointm.
(make_parent_window): Initialize old_pointm.
(make_window): Initialize old_pointm, horizontal scroll bar type,
and scroll bar height.
(resize_frame_windows): Don't count top margin in new sizes.
Don't use safe sizes when shrinking a frame; let the window
manager do the clipping.
(Fsplit_window_internal): Inherit horizontal scroll bar type and
height.
(Fdelete_window_internal): Unchain old_pointm marker.
(window_scroll_pixel_based, Fscroll_other_window): Adjust
old_pointm.
(Fwindow_text_width, Fwindow_text_height): New argument
"pixelwise".
(struct saved_window): New fields, old_pointm, hscroll_whole,
suspend_auto_hscroll, scroll_bar_height and
horizontal_scroll_bar_type.
(Fset_window_configuration, save_window_save): Set new fields of
saved_window.
(apply_window_adjustment): Don't call adjust_window_margins.
(set_window_margins): Don't change margins if new sizes don't
fit into window.
(set_window_scroll_bars): New argument "horizontal_type".
Handle horizontal scroll bars. Don't change scroll bars if they
don't fit into window.
(Fset_window_scroll_bars): New argument "horizontal_type".
(Fwindow_scroll_bars): Return values for horizontal scroll bars.
(compare_window_configurations): Compare horizontal scroll bar
settings.
* xdisp.c (window_text_bottom_y, window_box_height): Count in
horizontal scroll bar height.
(pixel_to_glyph_coords, init_xdisp): Use FRAME_TOTAL_LINES
instead of FRAME_LINES.
(remember_mouse_glyph): Case ON_SCROLL_BAR changed to
ON_VERTICAL_SCROLL_BAR.
(with_echo_area_buffer): Initialize old_pointm.
(with_echo_area_buffer_unwind_data): Store old_pointm values in
vector.
(unwind_with_echo_area_buffer): Handle old_pointm.
(update_tool_bar): Set do_update when the tool bar window has at
least one line (since this is what the user sets).
(MAX_FRAME_TOOL_BAR_HEIGHT): Remove macro.
(redisplay_tool_bar): Return early when toolbar has zero lines.
Call x_change_tool_bar_height. Don't use max_tool_bar_height.
(hscroll_window_tree): Handle suspension of auto_hscroll and
old_pointm.
(set_horizontal_scroll_bar): New function.
(redisplay_window): Set ignore_mouse_drag_p when tool bar has
more than one line. Handle horizontal scroll bars.
(note_mouse_highlight): Handle horizontal scrol bars.
(expose_frame): Set dimensions of XRectangle from frame's text
sizes.
(Vvoid_text_area_pointer): Update doc-string.
* xfns.c (x_set_menu_bar_lines): Use adjust_frame_size.
(x_change_tool_bar_height, x_set_scroll_bar_default_height)
(x_set_internal_border_width): New functions.
(x_set_tool_bar_lines): Call x_change_tool_bar_height.
(unwind_create_frame_1): Remove.
(Fx_create_frame): Handle horizontal scroll bars. Use official
field of frame structure to inhibit running
window-configuration-change-hook.
(x_create_tip_frame): Call SET_FRAME_LINES and change_frame_size
pixelwise. Handle frame's official field.
(x_frame_parm_handlers): Add x_set_scroll_bar_height,
x_set_horizontal_scroll_bars, x_set_left_fringe,
x_set_right_fringe.
* xmenu.c (update_frame_menubar, free_frame_menubar): Use
adjust_frame_size.
* xterm.h (struct x_display_info): Add
horizontal_scroll_bar_cursor and Xatom_Horizontal_Scrollbar
slots.
(struct scroll_bar): Add horizontal slot.
(HORIZONTAL_SCROLL_BAR_INSIDE_HEIGHT)
(HORIZONTAL_SCROLL_BAR_LEFT_RANGE)
(HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH): New macros.
(HORIZONTAL_SCROLL_BAR_LEFT_BORDER)
(HORIZONTAL_SCROLL_BAR_RIGHT_BORDER)
(HORIZONTAL_SCROLL_BAR_TOP_BORDER)
(HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER)
(HORIZONTAL_SCROLL_BAR_MIN_HANDLE): Define.
(x_clear_under_internal_border): Remove.
* xterm.c (XTmouse_position): Handle horizontal scroll bars.
(x_window_to_scroll_bar): New argument TYPE. Update callers.
(x_send_scroll_bar_event, x_scroll_bar_create): New arguments
HORIZONTAL. Update callers.
(horizontal_action_hook_id): New action hook id.
(x_horizontal_scroll_bar_to_input_event)
(x_create_horizontal_toolkit_scroll_bar)
(xt_horizontal_action_hook)
(x_set_toolkit_horizontal_scroll_bar_thumb)
(XTset_horizontal_scroll_bar, x_net_wm_state)
(x_horizontal_scroll_bar_report_motion): New functions.
(xg_scroll_callback, x_scroll_bar_handle_click): Handle
horizontal scroll bars.
(SCROLL_BAR_HORIZONTAL_NAME): Define.
(XTset_vertical_scroll_bar): Attempt to clear areas not covered
by scroll bar.
(XTcondemn_scroll_bars, XTredeem_scroll_bar): Rewrite. Handle
horizontal scroll bars.
(handle_one_xevent): Handle horizontal scroll bar events. Call
x_net_wm_state.
(x_set_window_size_1, x_wm_set_size_hint): Don't call
check_frame_size.
(x_set_window_size): Don't call check_frame_size and
do_pending_window_change.
(x_term_init): Init horizontal_scroll_bar_cursor display info.
(x_create_terminal): Add set_horizontal_scroll_bar_hook.
(x_scroll_bar_set_handle): Add some checks when calling
x_clear_area.
2014-07-27 13:21:30 +00:00
|
|
|
|
(let* ((initial-top
|
|
|
|
|
(cdr (assq 'top frame-initial-geometry-arguments)))
|
2001-02-02 13:55:42 +00:00
|
|
|
|
(top (frame-parameter frame-initial-frame 'top)))
|
|
|
|
|
(when (and (consp initial-top) (eq '- (car initial-top)))
|
2003-12-29 19:17:24 +00:00
|
|
|
|
(let ((adjusted-top
|
Complete pixelwise frame/window resizing, add horizontal scrollbar support.
* frame.el (frame-notice-user-settings): Rewrite using
frame-initial-frame-tool-bar-height.
* menu-bar.el (menu-bar-horizontal-scroll-bar)
(menu-bar-no-horizontal-scroll-bar): New functions.
(menu-bar-showhide-scroll-bar-menu): Add bindings for horizontal
scroll bars.
* scroll-bar.el (scroll-bar-lines)
(set-horizontal-scroll-bar-mode)
(get-horizontal-scroll-bar-mode, horizontal-scroll-bar-mode)
(scroll-bar-horizontal-drag-1, scroll-bar-horizontal-drag)
(scroll-bar-toolkit-horizontal-scroll): New functions.
(horizontal-scroll-bar-mode)
(previous-horizontal-scroll-bar-mode)
(horizontal-scroll-bar-mode-explicit): New variables.
(horizontal-scroll-bar-mode): New option.
(toggle-horizontal-scroll-bar): Do something.
(top-level): Bind horizontal-scroll-bar mouse-1.
* startup.el (tool-bar-originally-present): Remove variable.
(command-line): Don't set tool-bar-originally-present.
* window.el (window-min-height): Update doc-string.
(window--dump-frame): Dump horizontal scroll bar values.
(window--min-size-1): Handle minibuffer window separately.
Count in margins and horizontal scroll bar. Return safe value
iff IGNORE equals 'safe.
(frame-windows-min-size): New function (used by frame resizing
routines).
(fit-frame-to-buffer, fit-window-to-buffer): Count in horizontal
scroll bars.
(window--sanitize-window-sizes): New function.
(window-split-min-size): Remove.
(split-window): Count divider-width. Don't use
`window-split-min-size' any more. Reword error messages.
Sanitize windows sizes after splitting.
* buffer.h (struct buffer): New fields scroll_bar_height and
horizontal_scroll_bar_type.
* buffer.c (bset_scroll_bar_height)
(bset_horizontal_scroll_bar_type): New functions.
(Fbuffer_swap_text): Handle old_pointm field.
(init_buffer_once): Set defaults for scroll_bar_height and
horizontal_scroll_bar_type.
(syms_of_buffer): New variables scroll_bar_height and
horizontal_scroll_bar_type.
* dispextern.h (window_part): Rename ON_SCROLL_BAR to
ON_VERTICAL_SCROLL_BAR. Add ON_HORIZONTAL_SCROLL_BAR.
(set_vertical_scroll_bar): Remove prototype.
(x_change_tool_bar_height): Add prototype.
* dispnew.c (adjust_frame_glyphs_for_frame_redisplay)
(window_to_frame_vpos, update_frame_1, scrolling, init_display):
Use FRAME_TOTAL_COLS and FRAME_TOTAL_LINES instead of FRAME_COLS
and FRAME_LINES.
(adjust_frame_glyphs_for_window_redisplay): Rearrange lines.
(update_window): Start mode_line_row->y after horizontal scroll
bar.
(change_frame_size_1): Call adjust_frame_size.
(init_display): When changing the size of a tty frame do not
pass height of menu bar.
(Qframe_windows_min_size): New symbol.
* frame.h (struct frame): List tool bar fields after menu bar
fields. Add official, total_lines, horizontal_scroll_bars,
config_scroll_bar_height and config_scroll_bar_lines fields.
(FRAME_HAS_HORIZONTAL_SCROLL_BARS)
(FRAME_CONFIG_SCROLL_BAR_HEIGHT, FRAME_CONFIG_SCROLL_BAR_LINES)
(FRAME_SCROLL_BAR_AREA_HEIGHT, FRAME_SCROLL_BAR_COLS)
(FRAME_SCROLL_BAR_LINES, FRAME_TOTAL_LINES, SET_FRAME_LINES)
(FRAME_WINDOWS_HEIGHT): New macros.
(SET_FRAME_HEIGHT, FRAME_TEXT_LINES_TO_PIXEL_HEIGHT)
(FRAME_PIXEL_Y_TO_LINE, FRAME_PIXEL_HEIGHT_TO_TEXT_LINES)
(FRAME_TEXT_TO_PIXEL_HEIGHT): Separately count top margin and
horizontal scroll bar.
(frame_inhibit_resize, adjust_frame_size)
(frame_windows_min_size): Add declarations.
(Qscroll_bar_height, Qhorizontal_scroll_bars)
(x_set_scroll_bar_default_height, x_set_left_fringe)
(x_set_right_fringe, x_set_vertical_scroll_bars)
(x_set_horizontal_scroll_bars, x_set_scroll_bar_width)
(x_set_scroll_bar_height): Add external declarations.
* frame.c: (frame_inhibit_resize, frame_windows_min_size)
(adjust_frame_size): New functions.
(make_frame): Initial horizontal_scroll_bars field. Use
SET_FRAME_LINES. Don't allow horizontal scroll bar in
minibuffer window.
(make_initial_frame, make_terminal_frame): No horizontal scroll
bar in initial and terminal frames. Use adjust_frame_size.
(Fframe_total_cols): Fix doc-string.
(Fframe_total_lines, Fscroll_bar_height): New Lisp functions.
(Fset_frame_height, Fset_frame_width, Fset_frame_size): Rewrite
using adjust_frame_size.
(Qscroll_bar_height, Qhorizontal_scroll_bars)
(Qframe_windows_min_size): New symbols.
(x_set_frame_parameters): Remove call of check_frame_size.
(x_report_frame_params): Return scroll_bar_height value.
(x_set_left_fringe, x_set_right_fringe): New functions.
(adjust_frame_height, x_set_internal_border_width)
(x_set_fringe_width): Remove.
(x_set_internal_border_width, x_set_vertical_scroll_bars)
(x_set_scroll_bar_width, x_set_right_divider_width)
(x_set_bottom_divider_width): Rewrite using adjust_frame_size.
(x_set_horizontal_scroll_bars, x_set_scroll_bar_height): New
functions.
(x_figure_window_size): Rewrite to make frame display the
expected number of lines.
(Vdefault_frame_scroll_bars): Rewrite doc-string.
(Vdefault_frame_horizontal_scroll_bars)
(Vframe_initial_frame_tool_bar_height)
(frame_inhibit_implied_resize): New variables.
* fringe.c (compute_fringe_widths): Remove.
* gtkutil.h (YG_SB_MIN, YG_SB_MAX, YG_SB_RANGE): Define.
(xg_create_horizontal_scroll_bar)
(xg_update_horizontal_scrollbar_pos)
(xg_set_toolkit_horizontal_scroll_bar_thumb)
(xg_get_default_scrollbar_height)
(xg_clear_under_internal_border): Extern.
* gtkutil.c (xg_frame_resized): Don't call
do_pending_window_change.
(xg_frame_set_char_size): Use adjust_frame_size.
(style_changed_cb): Call update_theme_scrollbar_height and
x_set_scroll_bar_default_height.
(x_wm_set_size_hint): Don't call check_frame_size.
(update_theme_scrollbar_height)
(xg_get_default_scrollbar_height)
(xg_create_horizontal_scroll_bar)
(xg_update_horizontal_scrollbar_pos)
(xg_set_toolkit_horizontal_scroll_bar_thumb): New functions.
(xg_create_scroll_bar): Set horizontal slot of bar.
(xg_initialize): Call update_theme_scrollbar_height.
(xg_clear_under_internal_border): No more static.
* insdel.c (adjust_suspend_auto_hscroll): New function.
(adjust_markers_for_delete, adjust_markers_for_insert)
(adjust_markers_for_replace): Call adjust_suspend_auto_hscroll.
* keyboard.c (readable_events, discard_mouse_events)
(make_lispy_event): Handle horizontal scroll bar click events.
(Fsuspend_emacs): When changing the size of a tty frame do not
pass height of menu bar.
(Qbefore_handle, Qhorizontal_handle, Qafter_handle, Qleft)
(Qright, Qleftmost, Qrightmost): New symbols.
* menu.c (Fx_popup_dialog): Use FRAME_TOTAL_LINES instead of
FRAME_LINES.
* minibuf.c (read_minibuf): Initialize suspend_auto_hscroll.
* nsfns.m (x_set_internal_border_width): New function.
* nsterm.m (ns_draw_fringe_bitmap, ns_set_vertical_scroll_bar):
Remove extended fringe code.
(x_set_window_size, x_new_font): Don't call
compute_fringe_widths.
* term.c (Fresume_tty): When changing the size of a tty frame do
not pass height of menu bar.
(clear_tty_hooks, set_tty_hooks): Clear
horizontal_scroll_bar_hook.
(init_tty): Frame has no horizontal scroll bars.
* termhooks.h (enum scroll_bar_part): Add scroll_bar_move_ratio,
scroll_bar_before_handle, scroll_bar_horizontal_handle,
scroll_bar_after_handle, scroll_bar_left_arrow,
scroll_bar_right_arrow, scroll_bar_to_leftmost and
scroll_bar_to_rightmost entries.
(enum event_kind): Add HORIZONTAL_SCROLL_BAR_CLICK_EVENT
(struct terminal): Add set_horizontal_scroll_bar_hook.
* w32console.c (initialize_w32_display): Clear
horizontal_scroll_bar_hook.
* w32fns.c (x_set_mouse_color): Use FRAME_W32_DISPLAY instead of
FRAME_X_DISPLAY.
(x_clear_under_internal_border, x_set_internal_border_width):
New functions.
(x_set_menu_bar_lines): Rewrite using frame_inhibit_resize. Set
windows_or_buffers_changed when adding the menu bar.
(x_set_tool_bar_lines): Rewrite using adjust_frame_size.
(x_change_tool_bar_height, x_set_scroll_bar_default_height)
(w32_createhscrollbar): New functions.
(w32_createscrollbar): Rename to w32_createvscrollbar.
(w32_createwindow): Init WND_HSCROLLBAR_INDEX.
(w32_name_of_message): Replace WM_EMACS_CREATESCROLLBAR by
WM_EMACS_CREATEVSCROLLBAR and WM_EMACS_CREATEHSCROLLBAR. Add
WM_EMACS_SHOWCURSOR.
(w32_wnd_proc): Handle WM_HSCROLL case. In WM_WINDOWPOSCHANGING
case do not artificially impose WM size hints. Handle
WM_EMACS_SHOWCURSOR case. Replace WM_EMACS_CREATESCROLLBAR case
by WM_EMACS_CREATEVSCROLLBAR and WM_EMACS_CREATEHSCROLLBAR
cases.
(my_create_tip_window): Replace WND_SCROLLBAR_INDEX by
WND_VSCROLLBAR_INDEX and WND_HSCROLLBAR_INDEX.
(unwind_create_frame_1): Remove.
(Fx_create_frame): Make both scrollbars the system standard
width and height. Use official field of frame structure to
inhibit running window-configuration-change-hook.
(x_create_tip_frame): Call SET_FRAME_LINES and change_frame_size
pixelwise. Handle frame's official field.
(w32_frame_parm_handlers): Remove x_set_fringe_width
entries. Add x_set_scroll_bar_height,
x_set_horizontal_scroll_bars, x_set_left_fringe and
x_set_right_fringe.
* w32inevt.c (resize_event, maybe_generate_resize_event): Do not
pass height of menu bar to change_frame_size.
* w32menu.c (set_frame_menubar): Rewrite using
frame_inhibit_resize.
* w32term.h (struct w32_display_info): Add
horizontal_scroll_bar_cursor and cursor_display_counter.
(struct scroll_bar): Add horizontal.
(HORIZONTAL_SCROLL_BAR_INSIDE_HEIGHT)
(HORIZONTAL_SCROLL_BAR_LEFT_RANGE)
(HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH)
(HORIZONTAL_SCROLL_BAR_LEFT_BORDER)
(HORIZONTAL_SCROLL_BAR_RIGHT_BORDER)
(HORIZONTAL_SCROLL_BAR_TOP_BORDER)
(HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER)
(HORIZONTAL_SCROLL_BAR_MIN_HANDLE): New macros.
(WM_EMACS_CREATEVSCROLLBAR, WM_EMACS_CREATEHSCROLLBAR): Define
instead of WM_EMACS_CREATESCROLLBAR.
(WND_VSCROLLBAR_INDEX, WND_HSCROLLBAR_INDEX): Define instead of
WND_SCROLLBAR_INDEX.
* w32term.c (horizontal_scroll_bar_min_handle)
(horizontal_scroll_bar_left_border)
(horizontal_scroll_bar_right_border): New integers.
(x_set_frame_alpha): Replace x_highlight_frame by
w32_focus_frame.
(x_window_to_scroll_bar): New argument "type". Update callers
accordingly.
(w32_set_horizontal_scroll_bar_thumb)
(x_horizontal_scroll_bar_report_motion)
(w32_set_horizontal_scroll_bar)
(w32_horizontal_scroll_bar_handle_click)
(x_horizontal_scroll_bar_report_motion): New functions.
(w32_mouse_position): Discriminate horizontal and vertical
scrollbar cases.
(my_create_scrollbar): Replace with two new functions
my_create_vscrollbar and my_create_hscrollbar.
(x_scroll_bar_create): New argument "horizontal". Update
callers accordingly.
(x_scroll_bar_remove, w32_condemn_scroll_bars)
(w32_redeem_scroll_bar, x_scroll_bar_clear): Handle horizontal
scroll bar case.
(w32_read_socket): Handle WM_HSCROLL cae.
(x_new_font): Don't recompute fringe widths. Use
frame_inhibit_resize. Calculate new menu bar height iff we
build without toolkit. Always clear under internal border.
(x_set_window_size): Don't check frame size or recompute
fringes. Reset fullscreen status before applying sizes. Always
resize as requested by pixelwise argument. Don't call
do_pending_window_change.
(x_wm_set_size_hint): Add call for FRAME_SCROLL_BAR_AREA_HEIGHT.
(w32_initialize_display_info): Initialize dpyinfo's
horizontal_scroll_bar_cursor entry.
(w32_create_terminal): Add set_horizontal_scroll_bar_hook.
(w32_initialize): Init horizontal_scroll_bar_min_handle and
horizontal_scroll_bar_left_border.
(w32fullscreen_hook): Intermittently resize window to normal
when switching from fullscreen to maximized state.
(run_window_configuration_change_hook): Don't run it if frame is
not official yet.
(unwind_change_frame): Remove.
(Fset_window_configuration): Rewrite using frame's official field.
* widget.c (set_frame_size): Don't call compute_fringe_widths.
(EmacsFrameSetCharSize): Obey frame_inhibit_resize.
* window.h (struct window): New fields old_pointm,
horizontal_scroll_bar, horizontal_scroll_bar_type, hscroll_whole,
scroll_bar_height and suspend_auto_hscroll.
(wset_horizontal_scroll_bar, wset_horizontal_scroll_bar_type):
New functions.
(sanitize_window_sizes): Extern.
(MINI_NON_ONLY_WINDOW_P, MINI_ONLY_WINDOW_P, WINDOW_PSEUDO_P)
(WINDOW_TOPMOST_P, WINDOW_HAS_HORIZONTAL_SCROLL_BAR)
(WINDOW_CONFIG_SCROLL_BAR_HEIGHT)
(WINDOW_CONFIG_SCROLL_BAR_LINES)
(WINDOW_SCROLL_BAR_LINES, WINDOW_SCROLL_BAR_AREA_HEIGHT): New
macros.
(WINDOW_LEFT_FRINGE_COLS, WINDOW_RIGHT_FRINGE_COLS)
(WINDOW_FRINGE_COLS, WINDOW_FRINGE_EXTENDED_P): Remove macros.
(WINDOW_VERTICAL_SCROLL_BAR_TYPE)
(WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT)
(WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT)
(WINDOW_HAS_VERTICAL_SCROLL_BAR): Minor rewrite.
(WINDOW_BOX_HEIGHT_NO_MODE_LINE, WINDOW_BOX_TEXT_HEIGHT)
(WINDOW_SCROLL_BAR_AREA_Y): Count in scroll bar height.
* window.c (wset_old_pointm, Fwindow_scroll_bar_height)
(Fwindow_old_point, sanitize_window_sizes): New functions.
(Qwindow_sanitize_window_sizes): New symbol.
(window_body_height): Count in horizontal scroll bar.
(set_window_hscroll, Fscroll_left, Fscroll_right): Set
suspend_auto_hscroll slot.
(Fwindow_inside_edges): Count fringes pixelwise.
(coordinates_in_window, Fcoordinates_in_window_p): Consider
horizontal scroll bar.
(check_frame_size, adjust_window_margins): Remove functions and
corresponding calls.
(set_window_buffer): Initialize old_pointm and horizontal scroll
bars.
(temp_output_buffer_show): Reset hscroll related fields.
Initialize old_pointm.
(make_parent_window): Initialize old_pointm.
(make_window): Initialize old_pointm, horizontal scroll bar type,
and scroll bar height.
(resize_frame_windows): Don't count top margin in new sizes.
Don't use safe sizes when shrinking a frame; let the window
manager do the clipping.
(Fsplit_window_internal): Inherit horizontal scroll bar type and
height.
(Fdelete_window_internal): Unchain old_pointm marker.
(window_scroll_pixel_based, Fscroll_other_window): Adjust
old_pointm.
(Fwindow_text_width, Fwindow_text_height): New argument
"pixelwise".
(struct saved_window): New fields, old_pointm, hscroll_whole,
suspend_auto_hscroll, scroll_bar_height and
horizontal_scroll_bar_type.
(Fset_window_configuration, save_window_save): Set new fields of
saved_window.
(apply_window_adjustment): Don't call adjust_window_margins.
(set_window_margins): Don't change margins if new sizes don't
fit into window.
(set_window_scroll_bars): New argument "horizontal_type".
Handle horizontal scroll bars. Don't change scroll bars if they
don't fit into window.
(Fset_window_scroll_bars): New argument "horizontal_type".
(Fwindow_scroll_bars): Return values for horizontal scroll bars.
(compare_window_configurations): Compare horizontal scroll bar
settings.
* xdisp.c (window_text_bottom_y, window_box_height): Count in
horizontal scroll bar height.
(pixel_to_glyph_coords, init_xdisp): Use FRAME_TOTAL_LINES
instead of FRAME_LINES.
(remember_mouse_glyph): Case ON_SCROLL_BAR changed to
ON_VERTICAL_SCROLL_BAR.
(with_echo_area_buffer): Initialize old_pointm.
(with_echo_area_buffer_unwind_data): Store old_pointm values in
vector.
(unwind_with_echo_area_buffer): Handle old_pointm.
(update_tool_bar): Set do_update when the tool bar window has at
least one line (since this is what the user sets).
(MAX_FRAME_TOOL_BAR_HEIGHT): Remove macro.
(redisplay_tool_bar): Return early when toolbar has zero lines.
Call x_change_tool_bar_height. Don't use max_tool_bar_height.
(hscroll_window_tree): Handle suspension of auto_hscroll and
old_pointm.
(set_horizontal_scroll_bar): New function.
(redisplay_window): Set ignore_mouse_drag_p when tool bar has
more than one line. Handle horizontal scroll bars.
(note_mouse_highlight): Handle horizontal scrol bars.
(expose_frame): Set dimensions of XRectangle from frame's text
sizes.
(Vvoid_text_area_pointer): Update doc-string.
* xfns.c (x_set_menu_bar_lines): Use adjust_frame_size.
(x_change_tool_bar_height, x_set_scroll_bar_default_height)
(x_set_internal_border_width): New functions.
(x_set_tool_bar_lines): Call x_change_tool_bar_height.
(unwind_create_frame_1): Remove.
(Fx_create_frame): Handle horizontal scroll bars. Use official
field of frame structure to inhibit running
window-configuration-change-hook.
(x_create_tip_frame): Call SET_FRAME_LINES and change_frame_size
pixelwise. Handle frame's official field.
(x_frame_parm_handlers): Add x_set_scroll_bar_height,
x_set_horizontal_scroll_bars, x_set_left_fringe,
x_set_right_fringe.
* xmenu.c (update_frame_menubar, free_frame_menubar): Use
adjust_frame_size.
* xterm.h (struct x_display_info): Add
horizontal_scroll_bar_cursor and Xatom_Horizontal_Scrollbar
slots.
(struct scroll_bar): Add horizontal slot.
(HORIZONTAL_SCROLL_BAR_INSIDE_HEIGHT)
(HORIZONTAL_SCROLL_BAR_LEFT_RANGE)
(HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH): New macros.
(HORIZONTAL_SCROLL_BAR_LEFT_BORDER)
(HORIZONTAL_SCROLL_BAR_RIGHT_BORDER)
(HORIZONTAL_SCROLL_BAR_TOP_BORDER)
(HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER)
(HORIZONTAL_SCROLL_BAR_MIN_HANDLE): Define.
(x_clear_under_internal_border): Remove.
* xterm.c (XTmouse_position): Handle horizontal scroll bars.
(x_window_to_scroll_bar): New argument TYPE. Update callers.
(x_send_scroll_bar_event, x_scroll_bar_create): New arguments
HORIZONTAL. Update callers.
(horizontal_action_hook_id): New action hook id.
(x_horizontal_scroll_bar_to_input_event)
(x_create_horizontal_toolkit_scroll_bar)
(xt_horizontal_action_hook)
(x_set_toolkit_horizontal_scroll_bar_thumb)
(XTset_horizontal_scroll_bar, x_net_wm_state)
(x_horizontal_scroll_bar_report_motion): New functions.
(xg_scroll_callback, x_scroll_bar_handle_click): Handle
horizontal scroll bars.
(SCROLL_BAR_HORIZONTAL_NAME): Define.
(XTset_vertical_scroll_bar): Attempt to clear areas not covered
by scroll bar.
(XTcondemn_scroll_bars, XTredeem_scroll_bar): Rewrite. Handle
horizontal scroll bars.
(handle_one_xevent): Handle horizontal scroll bar events. Call
x_net_wm_state.
(x_set_window_size_1, x_wm_set_size_hint): Don't call
check_frame_size.
(x_set_window_size): Don't call check_frame_size and
do_pending_window_change.
(x_term_init): Init horizontal_scroll_bar_cursor display info.
(x_create_terminal): Add set_horizontal_scroll_bar_hook.
(x_scroll_bar_set_handle): Add some checks when calling
x_clear_area.
2014-07-27 13:21:30 +00:00
|
|
|
|
(cond
|
|
|
|
|
((and (consp top) (eq '+ (car top)))
|
2015-01-12 07:18:00 +00:00
|
|
|
|
(list '+ (+ (cadr top) height)))
|
Complete pixelwise frame/window resizing, add horizontal scrollbar support.
* frame.el (frame-notice-user-settings): Rewrite using
frame-initial-frame-tool-bar-height.
* menu-bar.el (menu-bar-horizontal-scroll-bar)
(menu-bar-no-horizontal-scroll-bar): New functions.
(menu-bar-showhide-scroll-bar-menu): Add bindings for horizontal
scroll bars.
* scroll-bar.el (scroll-bar-lines)
(set-horizontal-scroll-bar-mode)
(get-horizontal-scroll-bar-mode, horizontal-scroll-bar-mode)
(scroll-bar-horizontal-drag-1, scroll-bar-horizontal-drag)
(scroll-bar-toolkit-horizontal-scroll): New functions.
(horizontal-scroll-bar-mode)
(previous-horizontal-scroll-bar-mode)
(horizontal-scroll-bar-mode-explicit): New variables.
(horizontal-scroll-bar-mode): New option.
(toggle-horizontal-scroll-bar): Do something.
(top-level): Bind horizontal-scroll-bar mouse-1.
* startup.el (tool-bar-originally-present): Remove variable.
(command-line): Don't set tool-bar-originally-present.
* window.el (window-min-height): Update doc-string.
(window--dump-frame): Dump horizontal scroll bar values.
(window--min-size-1): Handle minibuffer window separately.
Count in margins and horizontal scroll bar. Return safe value
iff IGNORE equals 'safe.
(frame-windows-min-size): New function (used by frame resizing
routines).
(fit-frame-to-buffer, fit-window-to-buffer): Count in horizontal
scroll bars.
(window--sanitize-window-sizes): New function.
(window-split-min-size): Remove.
(split-window): Count divider-width. Don't use
`window-split-min-size' any more. Reword error messages.
Sanitize windows sizes after splitting.
* buffer.h (struct buffer): New fields scroll_bar_height and
horizontal_scroll_bar_type.
* buffer.c (bset_scroll_bar_height)
(bset_horizontal_scroll_bar_type): New functions.
(Fbuffer_swap_text): Handle old_pointm field.
(init_buffer_once): Set defaults for scroll_bar_height and
horizontal_scroll_bar_type.
(syms_of_buffer): New variables scroll_bar_height and
horizontal_scroll_bar_type.
* dispextern.h (window_part): Rename ON_SCROLL_BAR to
ON_VERTICAL_SCROLL_BAR. Add ON_HORIZONTAL_SCROLL_BAR.
(set_vertical_scroll_bar): Remove prototype.
(x_change_tool_bar_height): Add prototype.
* dispnew.c (adjust_frame_glyphs_for_frame_redisplay)
(window_to_frame_vpos, update_frame_1, scrolling, init_display):
Use FRAME_TOTAL_COLS and FRAME_TOTAL_LINES instead of FRAME_COLS
and FRAME_LINES.
(adjust_frame_glyphs_for_window_redisplay): Rearrange lines.
(update_window): Start mode_line_row->y after horizontal scroll
bar.
(change_frame_size_1): Call adjust_frame_size.
(init_display): When changing the size of a tty frame do not
pass height of menu bar.
(Qframe_windows_min_size): New symbol.
* frame.h (struct frame): List tool bar fields after menu bar
fields. Add official, total_lines, horizontal_scroll_bars,
config_scroll_bar_height and config_scroll_bar_lines fields.
(FRAME_HAS_HORIZONTAL_SCROLL_BARS)
(FRAME_CONFIG_SCROLL_BAR_HEIGHT, FRAME_CONFIG_SCROLL_BAR_LINES)
(FRAME_SCROLL_BAR_AREA_HEIGHT, FRAME_SCROLL_BAR_COLS)
(FRAME_SCROLL_BAR_LINES, FRAME_TOTAL_LINES, SET_FRAME_LINES)
(FRAME_WINDOWS_HEIGHT): New macros.
(SET_FRAME_HEIGHT, FRAME_TEXT_LINES_TO_PIXEL_HEIGHT)
(FRAME_PIXEL_Y_TO_LINE, FRAME_PIXEL_HEIGHT_TO_TEXT_LINES)
(FRAME_TEXT_TO_PIXEL_HEIGHT): Separately count top margin and
horizontal scroll bar.
(frame_inhibit_resize, adjust_frame_size)
(frame_windows_min_size): Add declarations.
(Qscroll_bar_height, Qhorizontal_scroll_bars)
(x_set_scroll_bar_default_height, x_set_left_fringe)
(x_set_right_fringe, x_set_vertical_scroll_bars)
(x_set_horizontal_scroll_bars, x_set_scroll_bar_width)
(x_set_scroll_bar_height): Add external declarations.
* frame.c: (frame_inhibit_resize, frame_windows_min_size)
(adjust_frame_size): New functions.
(make_frame): Initial horizontal_scroll_bars field. Use
SET_FRAME_LINES. Don't allow horizontal scroll bar in
minibuffer window.
(make_initial_frame, make_terminal_frame): No horizontal scroll
bar in initial and terminal frames. Use adjust_frame_size.
(Fframe_total_cols): Fix doc-string.
(Fframe_total_lines, Fscroll_bar_height): New Lisp functions.
(Fset_frame_height, Fset_frame_width, Fset_frame_size): Rewrite
using adjust_frame_size.
(Qscroll_bar_height, Qhorizontal_scroll_bars)
(Qframe_windows_min_size): New symbols.
(x_set_frame_parameters): Remove call of check_frame_size.
(x_report_frame_params): Return scroll_bar_height value.
(x_set_left_fringe, x_set_right_fringe): New functions.
(adjust_frame_height, x_set_internal_border_width)
(x_set_fringe_width): Remove.
(x_set_internal_border_width, x_set_vertical_scroll_bars)
(x_set_scroll_bar_width, x_set_right_divider_width)
(x_set_bottom_divider_width): Rewrite using adjust_frame_size.
(x_set_horizontal_scroll_bars, x_set_scroll_bar_height): New
functions.
(x_figure_window_size): Rewrite to make frame display the
expected number of lines.
(Vdefault_frame_scroll_bars): Rewrite doc-string.
(Vdefault_frame_horizontal_scroll_bars)
(Vframe_initial_frame_tool_bar_height)
(frame_inhibit_implied_resize): New variables.
* fringe.c (compute_fringe_widths): Remove.
* gtkutil.h (YG_SB_MIN, YG_SB_MAX, YG_SB_RANGE): Define.
(xg_create_horizontal_scroll_bar)
(xg_update_horizontal_scrollbar_pos)
(xg_set_toolkit_horizontal_scroll_bar_thumb)
(xg_get_default_scrollbar_height)
(xg_clear_under_internal_border): Extern.
* gtkutil.c (xg_frame_resized): Don't call
do_pending_window_change.
(xg_frame_set_char_size): Use adjust_frame_size.
(style_changed_cb): Call update_theme_scrollbar_height and
x_set_scroll_bar_default_height.
(x_wm_set_size_hint): Don't call check_frame_size.
(update_theme_scrollbar_height)
(xg_get_default_scrollbar_height)
(xg_create_horizontal_scroll_bar)
(xg_update_horizontal_scrollbar_pos)
(xg_set_toolkit_horizontal_scroll_bar_thumb): New functions.
(xg_create_scroll_bar): Set horizontal slot of bar.
(xg_initialize): Call update_theme_scrollbar_height.
(xg_clear_under_internal_border): No more static.
* insdel.c (adjust_suspend_auto_hscroll): New function.
(adjust_markers_for_delete, adjust_markers_for_insert)
(adjust_markers_for_replace): Call adjust_suspend_auto_hscroll.
* keyboard.c (readable_events, discard_mouse_events)
(make_lispy_event): Handle horizontal scroll bar click events.
(Fsuspend_emacs): When changing the size of a tty frame do not
pass height of menu bar.
(Qbefore_handle, Qhorizontal_handle, Qafter_handle, Qleft)
(Qright, Qleftmost, Qrightmost): New symbols.
* menu.c (Fx_popup_dialog): Use FRAME_TOTAL_LINES instead of
FRAME_LINES.
* minibuf.c (read_minibuf): Initialize suspend_auto_hscroll.
* nsfns.m (x_set_internal_border_width): New function.
* nsterm.m (ns_draw_fringe_bitmap, ns_set_vertical_scroll_bar):
Remove extended fringe code.
(x_set_window_size, x_new_font): Don't call
compute_fringe_widths.
* term.c (Fresume_tty): When changing the size of a tty frame do
not pass height of menu bar.
(clear_tty_hooks, set_tty_hooks): Clear
horizontal_scroll_bar_hook.
(init_tty): Frame has no horizontal scroll bars.
* termhooks.h (enum scroll_bar_part): Add scroll_bar_move_ratio,
scroll_bar_before_handle, scroll_bar_horizontal_handle,
scroll_bar_after_handle, scroll_bar_left_arrow,
scroll_bar_right_arrow, scroll_bar_to_leftmost and
scroll_bar_to_rightmost entries.
(enum event_kind): Add HORIZONTAL_SCROLL_BAR_CLICK_EVENT
(struct terminal): Add set_horizontal_scroll_bar_hook.
* w32console.c (initialize_w32_display): Clear
horizontal_scroll_bar_hook.
* w32fns.c (x_set_mouse_color): Use FRAME_W32_DISPLAY instead of
FRAME_X_DISPLAY.
(x_clear_under_internal_border, x_set_internal_border_width):
New functions.
(x_set_menu_bar_lines): Rewrite using frame_inhibit_resize. Set
windows_or_buffers_changed when adding the menu bar.
(x_set_tool_bar_lines): Rewrite using adjust_frame_size.
(x_change_tool_bar_height, x_set_scroll_bar_default_height)
(w32_createhscrollbar): New functions.
(w32_createscrollbar): Rename to w32_createvscrollbar.
(w32_createwindow): Init WND_HSCROLLBAR_INDEX.
(w32_name_of_message): Replace WM_EMACS_CREATESCROLLBAR by
WM_EMACS_CREATEVSCROLLBAR and WM_EMACS_CREATEHSCROLLBAR. Add
WM_EMACS_SHOWCURSOR.
(w32_wnd_proc): Handle WM_HSCROLL case. In WM_WINDOWPOSCHANGING
case do not artificially impose WM size hints. Handle
WM_EMACS_SHOWCURSOR case. Replace WM_EMACS_CREATESCROLLBAR case
by WM_EMACS_CREATEVSCROLLBAR and WM_EMACS_CREATEHSCROLLBAR
cases.
(my_create_tip_window): Replace WND_SCROLLBAR_INDEX by
WND_VSCROLLBAR_INDEX and WND_HSCROLLBAR_INDEX.
(unwind_create_frame_1): Remove.
(Fx_create_frame): Make both scrollbars the system standard
width and height. Use official field of frame structure to
inhibit running window-configuration-change-hook.
(x_create_tip_frame): Call SET_FRAME_LINES and change_frame_size
pixelwise. Handle frame's official field.
(w32_frame_parm_handlers): Remove x_set_fringe_width
entries. Add x_set_scroll_bar_height,
x_set_horizontal_scroll_bars, x_set_left_fringe and
x_set_right_fringe.
* w32inevt.c (resize_event, maybe_generate_resize_event): Do not
pass height of menu bar to change_frame_size.
* w32menu.c (set_frame_menubar): Rewrite using
frame_inhibit_resize.
* w32term.h (struct w32_display_info): Add
horizontal_scroll_bar_cursor and cursor_display_counter.
(struct scroll_bar): Add horizontal.
(HORIZONTAL_SCROLL_BAR_INSIDE_HEIGHT)
(HORIZONTAL_SCROLL_BAR_LEFT_RANGE)
(HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH)
(HORIZONTAL_SCROLL_BAR_LEFT_BORDER)
(HORIZONTAL_SCROLL_BAR_RIGHT_BORDER)
(HORIZONTAL_SCROLL_BAR_TOP_BORDER)
(HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER)
(HORIZONTAL_SCROLL_BAR_MIN_HANDLE): New macros.
(WM_EMACS_CREATEVSCROLLBAR, WM_EMACS_CREATEHSCROLLBAR): Define
instead of WM_EMACS_CREATESCROLLBAR.
(WND_VSCROLLBAR_INDEX, WND_HSCROLLBAR_INDEX): Define instead of
WND_SCROLLBAR_INDEX.
* w32term.c (horizontal_scroll_bar_min_handle)
(horizontal_scroll_bar_left_border)
(horizontal_scroll_bar_right_border): New integers.
(x_set_frame_alpha): Replace x_highlight_frame by
w32_focus_frame.
(x_window_to_scroll_bar): New argument "type". Update callers
accordingly.
(w32_set_horizontal_scroll_bar_thumb)
(x_horizontal_scroll_bar_report_motion)
(w32_set_horizontal_scroll_bar)
(w32_horizontal_scroll_bar_handle_click)
(x_horizontal_scroll_bar_report_motion): New functions.
(w32_mouse_position): Discriminate horizontal and vertical
scrollbar cases.
(my_create_scrollbar): Replace with two new functions
my_create_vscrollbar and my_create_hscrollbar.
(x_scroll_bar_create): New argument "horizontal". Update
callers accordingly.
(x_scroll_bar_remove, w32_condemn_scroll_bars)
(w32_redeem_scroll_bar, x_scroll_bar_clear): Handle horizontal
scroll bar case.
(w32_read_socket): Handle WM_HSCROLL cae.
(x_new_font): Don't recompute fringe widths. Use
frame_inhibit_resize. Calculate new menu bar height iff we
build without toolkit. Always clear under internal border.
(x_set_window_size): Don't check frame size or recompute
fringes. Reset fullscreen status before applying sizes. Always
resize as requested by pixelwise argument. Don't call
do_pending_window_change.
(x_wm_set_size_hint): Add call for FRAME_SCROLL_BAR_AREA_HEIGHT.
(w32_initialize_display_info): Initialize dpyinfo's
horizontal_scroll_bar_cursor entry.
(w32_create_terminal): Add set_horizontal_scroll_bar_hook.
(w32_initialize): Init horizontal_scroll_bar_min_handle and
horizontal_scroll_bar_left_border.
(w32fullscreen_hook): Intermittently resize window to normal
when switching from fullscreen to maximized state.
(run_window_configuration_change_hook): Don't run it if frame is
not official yet.
(unwind_change_frame): Remove.
(Fset_window_configuration): Rewrite using frame's official field.
* widget.c (set_frame_size): Don't call compute_fringe_widths.
(EmacsFrameSetCharSize): Obey frame_inhibit_resize.
* window.h (struct window): New fields old_pointm,
horizontal_scroll_bar, horizontal_scroll_bar_type, hscroll_whole,
scroll_bar_height and suspend_auto_hscroll.
(wset_horizontal_scroll_bar, wset_horizontal_scroll_bar_type):
New functions.
(sanitize_window_sizes): Extern.
(MINI_NON_ONLY_WINDOW_P, MINI_ONLY_WINDOW_P, WINDOW_PSEUDO_P)
(WINDOW_TOPMOST_P, WINDOW_HAS_HORIZONTAL_SCROLL_BAR)
(WINDOW_CONFIG_SCROLL_BAR_HEIGHT)
(WINDOW_CONFIG_SCROLL_BAR_LINES)
(WINDOW_SCROLL_BAR_LINES, WINDOW_SCROLL_BAR_AREA_HEIGHT): New
macros.
(WINDOW_LEFT_FRINGE_COLS, WINDOW_RIGHT_FRINGE_COLS)
(WINDOW_FRINGE_COLS, WINDOW_FRINGE_EXTENDED_P): Remove macros.
(WINDOW_VERTICAL_SCROLL_BAR_TYPE)
(WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT)
(WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT)
(WINDOW_HAS_VERTICAL_SCROLL_BAR): Minor rewrite.
(WINDOW_BOX_HEIGHT_NO_MODE_LINE, WINDOW_BOX_TEXT_HEIGHT)
(WINDOW_SCROLL_BAR_AREA_Y): Count in scroll bar height.
* window.c (wset_old_pointm, Fwindow_scroll_bar_height)
(Fwindow_old_point, sanitize_window_sizes): New functions.
(Qwindow_sanitize_window_sizes): New symbol.
(window_body_height): Count in horizontal scroll bar.
(set_window_hscroll, Fscroll_left, Fscroll_right): Set
suspend_auto_hscroll slot.
(Fwindow_inside_edges): Count fringes pixelwise.
(coordinates_in_window, Fcoordinates_in_window_p): Consider
horizontal scroll bar.
(check_frame_size, adjust_window_margins): Remove functions and
corresponding calls.
(set_window_buffer): Initialize old_pointm and horizontal scroll
bars.
(temp_output_buffer_show): Reset hscroll related fields.
Initialize old_pointm.
(make_parent_window): Initialize old_pointm.
(make_window): Initialize old_pointm, horizontal scroll bar type,
and scroll bar height.
(resize_frame_windows): Don't count top margin in new sizes.
Don't use safe sizes when shrinking a frame; let the window
manager do the clipping.
(Fsplit_window_internal): Inherit horizontal scroll bar type and
height.
(Fdelete_window_internal): Unchain old_pointm marker.
(window_scroll_pixel_based, Fscroll_other_window): Adjust
old_pointm.
(Fwindow_text_width, Fwindow_text_height): New argument
"pixelwise".
(struct saved_window): New fields, old_pointm, hscroll_whole,
suspend_auto_hscroll, scroll_bar_height and
horizontal_scroll_bar_type.
(Fset_window_configuration, save_window_save): Set new fields of
saved_window.
(apply_window_adjustment): Don't call adjust_window_margins.
(set_window_margins): Don't change margins if new sizes don't
fit into window.
(set_window_scroll_bars): New argument "horizontal_type".
Handle horizontal scroll bars. Don't change scroll bars if they
don't fit into window.
(Fset_window_scroll_bars): New argument "horizontal_type".
(Fwindow_scroll_bars): Return values for horizontal scroll bars.
(compare_window_configurations): Compare horizontal scroll bar
settings.
* xdisp.c (window_text_bottom_y, window_box_height): Count in
horizontal scroll bar height.
(pixel_to_glyph_coords, init_xdisp): Use FRAME_TOTAL_LINES
instead of FRAME_LINES.
(remember_mouse_glyph): Case ON_SCROLL_BAR changed to
ON_VERTICAL_SCROLL_BAR.
(with_echo_area_buffer): Initialize old_pointm.
(with_echo_area_buffer_unwind_data): Store old_pointm values in
vector.
(unwind_with_echo_area_buffer): Handle old_pointm.
(update_tool_bar): Set do_update when the tool bar window has at
least one line (since this is what the user sets).
(MAX_FRAME_TOOL_BAR_HEIGHT): Remove macro.
(redisplay_tool_bar): Return early when toolbar has zero lines.
Call x_change_tool_bar_height. Don't use max_tool_bar_height.
(hscroll_window_tree): Handle suspension of auto_hscroll and
old_pointm.
(set_horizontal_scroll_bar): New function.
(redisplay_window): Set ignore_mouse_drag_p when tool bar has
more than one line. Handle horizontal scroll bars.
(note_mouse_highlight): Handle horizontal scrol bars.
(expose_frame): Set dimensions of XRectangle from frame's text
sizes.
(Vvoid_text_area_pointer): Update doc-string.
* xfns.c (x_set_menu_bar_lines): Use adjust_frame_size.
(x_change_tool_bar_height, x_set_scroll_bar_default_height)
(x_set_internal_border_width): New functions.
(x_set_tool_bar_lines): Call x_change_tool_bar_height.
(unwind_create_frame_1): Remove.
(Fx_create_frame): Handle horizontal scroll bars. Use official
field of frame structure to inhibit running
window-configuration-change-hook.
(x_create_tip_frame): Call SET_FRAME_LINES and change_frame_size
pixelwise. Handle frame's official field.
(x_frame_parm_handlers): Add x_set_scroll_bar_height,
x_set_horizontal_scroll_bars, x_set_left_fringe,
x_set_right_fringe.
* xmenu.c (update_frame_menubar, free_frame_menubar): Use
adjust_frame_size.
* xterm.h (struct x_display_info): Add
horizontal_scroll_bar_cursor and Xatom_Horizontal_Scrollbar
slots.
(struct scroll_bar): Add horizontal slot.
(HORIZONTAL_SCROLL_BAR_INSIDE_HEIGHT)
(HORIZONTAL_SCROLL_BAR_LEFT_RANGE)
(HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH): New macros.
(HORIZONTAL_SCROLL_BAR_LEFT_BORDER)
(HORIZONTAL_SCROLL_BAR_RIGHT_BORDER)
(HORIZONTAL_SCROLL_BAR_TOP_BORDER)
(HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER)
(HORIZONTAL_SCROLL_BAR_MIN_HANDLE): Define.
(x_clear_under_internal_border): Remove.
* xterm.c (XTmouse_position): Handle horizontal scroll bars.
(x_window_to_scroll_bar): New argument TYPE. Update callers.
(x_send_scroll_bar_event, x_scroll_bar_create): New arguments
HORIZONTAL. Update callers.
(horizontal_action_hook_id): New action hook id.
(x_horizontal_scroll_bar_to_input_event)
(x_create_horizontal_toolkit_scroll_bar)
(xt_horizontal_action_hook)
(x_set_toolkit_horizontal_scroll_bar_thumb)
(XTset_horizontal_scroll_bar, x_net_wm_state)
(x_horizontal_scroll_bar_report_motion): New functions.
(xg_scroll_callback, x_scroll_bar_handle_click): Handle
horizontal scroll bars.
(SCROLL_BAR_HORIZONTAL_NAME): Define.
(XTset_vertical_scroll_bar): Attempt to clear areas not covered
by scroll bar.
(XTcondemn_scroll_bars, XTredeem_scroll_bar): Rewrite. Handle
horizontal scroll bars.
(handle_one_xevent): Handle horizontal scroll bar events. Call
x_net_wm_state.
(x_set_window_size_1, x_wm_set_size_hint): Don't call
check_frame_size.
(x_set_window_size): Don't call check_frame_size and
do_pending_window_change.
(x_term_init): Init horizontal_scroll_bar_cursor display info.
(x_create_terminal): Add set_horizontal_scroll_bar_hook.
(x_scroll_bar_set_handle): Add some checks when calling
x_clear_area.
2014-07-27 13:21:30 +00:00
|
|
|
|
((and (consp top) (eq '- (car top)))
|
2015-01-12 07:18:00 +00:00
|
|
|
|
(list '- (- (cadr top) height)))
|
|
|
|
|
(t (+ top height)))))
|
Complete pixelwise frame/window resizing, add horizontal scrollbar support.
* frame.el (frame-notice-user-settings): Rewrite using
frame-initial-frame-tool-bar-height.
* menu-bar.el (menu-bar-horizontal-scroll-bar)
(menu-bar-no-horizontal-scroll-bar): New functions.
(menu-bar-showhide-scroll-bar-menu): Add bindings for horizontal
scroll bars.
* scroll-bar.el (scroll-bar-lines)
(set-horizontal-scroll-bar-mode)
(get-horizontal-scroll-bar-mode, horizontal-scroll-bar-mode)
(scroll-bar-horizontal-drag-1, scroll-bar-horizontal-drag)
(scroll-bar-toolkit-horizontal-scroll): New functions.
(horizontal-scroll-bar-mode)
(previous-horizontal-scroll-bar-mode)
(horizontal-scroll-bar-mode-explicit): New variables.
(horizontal-scroll-bar-mode): New option.
(toggle-horizontal-scroll-bar): Do something.
(top-level): Bind horizontal-scroll-bar mouse-1.
* startup.el (tool-bar-originally-present): Remove variable.
(command-line): Don't set tool-bar-originally-present.
* window.el (window-min-height): Update doc-string.
(window--dump-frame): Dump horizontal scroll bar values.
(window--min-size-1): Handle minibuffer window separately.
Count in margins and horizontal scroll bar. Return safe value
iff IGNORE equals 'safe.
(frame-windows-min-size): New function (used by frame resizing
routines).
(fit-frame-to-buffer, fit-window-to-buffer): Count in horizontal
scroll bars.
(window--sanitize-window-sizes): New function.
(window-split-min-size): Remove.
(split-window): Count divider-width. Don't use
`window-split-min-size' any more. Reword error messages.
Sanitize windows sizes after splitting.
* buffer.h (struct buffer): New fields scroll_bar_height and
horizontal_scroll_bar_type.
* buffer.c (bset_scroll_bar_height)
(bset_horizontal_scroll_bar_type): New functions.
(Fbuffer_swap_text): Handle old_pointm field.
(init_buffer_once): Set defaults for scroll_bar_height and
horizontal_scroll_bar_type.
(syms_of_buffer): New variables scroll_bar_height and
horizontal_scroll_bar_type.
* dispextern.h (window_part): Rename ON_SCROLL_BAR to
ON_VERTICAL_SCROLL_BAR. Add ON_HORIZONTAL_SCROLL_BAR.
(set_vertical_scroll_bar): Remove prototype.
(x_change_tool_bar_height): Add prototype.
* dispnew.c (adjust_frame_glyphs_for_frame_redisplay)
(window_to_frame_vpos, update_frame_1, scrolling, init_display):
Use FRAME_TOTAL_COLS and FRAME_TOTAL_LINES instead of FRAME_COLS
and FRAME_LINES.
(adjust_frame_glyphs_for_window_redisplay): Rearrange lines.
(update_window): Start mode_line_row->y after horizontal scroll
bar.
(change_frame_size_1): Call adjust_frame_size.
(init_display): When changing the size of a tty frame do not
pass height of menu bar.
(Qframe_windows_min_size): New symbol.
* frame.h (struct frame): List tool bar fields after menu bar
fields. Add official, total_lines, horizontal_scroll_bars,
config_scroll_bar_height and config_scroll_bar_lines fields.
(FRAME_HAS_HORIZONTAL_SCROLL_BARS)
(FRAME_CONFIG_SCROLL_BAR_HEIGHT, FRAME_CONFIG_SCROLL_BAR_LINES)
(FRAME_SCROLL_BAR_AREA_HEIGHT, FRAME_SCROLL_BAR_COLS)
(FRAME_SCROLL_BAR_LINES, FRAME_TOTAL_LINES, SET_FRAME_LINES)
(FRAME_WINDOWS_HEIGHT): New macros.
(SET_FRAME_HEIGHT, FRAME_TEXT_LINES_TO_PIXEL_HEIGHT)
(FRAME_PIXEL_Y_TO_LINE, FRAME_PIXEL_HEIGHT_TO_TEXT_LINES)
(FRAME_TEXT_TO_PIXEL_HEIGHT): Separately count top margin and
horizontal scroll bar.
(frame_inhibit_resize, adjust_frame_size)
(frame_windows_min_size): Add declarations.
(Qscroll_bar_height, Qhorizontal_scroll_bars)
(x_set_scroll_bar_default_height, x_set_left_fringe)
(x_set_right_fringe, x_set_vertical_scroll_bars)
(x_set_horizontal_scroll_bars, x_set_scroll_bar_width)
(x_set_scroll_bar_height): Add external declarations.
* frame.c: (frame_inhibit_resize, frame_windows_min_size)
(adjust_frame_size): New functions.
(make_frame): Initial horizontal_scroll_bars field. Use
SET_FRAME_LINES. Don't allow horizontal scroll bar in
minibuffer window.
(make_initial_frame, make_terminal_frame): No horizontal scroll
bar in initial and terminal frames. Use adjust_frame_size.
(Fframe_total_cols): Fix doc-string.
(Fframe_total_lines, Fscroll_bar_height): New Lisp functions.
(Fset_frame_height, Fset_frame_width, Fset_frame_size): Rewrite
using adjust_frame_size.
(Qscroll_bar_height, Qhorizontal_scroll_bars)
(Qframe_windows_min_size): New symbols.
(x_set_frame_parameters): Remove call of check_frame_size.
(x_report_frame_params): Return scroll_bar_height value.
(x_set_left_fringe, x_set_right_fringe): New functions.
(adjust_frame_height, x_set_internal_border_width)
(x_set_fringe_width): Remove.
(x_set_internal_border_width, x_set_vertical_scroll_bars)
(x_set_scroll_bar_width, x_set_right_divider_width)
(x_set_bottom_divider_width): Rewrite using adjust_frame_size.
(x_set_horizontal_scroll_bars, x_set_scroll_bar_height): New
functions.
(x_figure_window_size): Rewrite to make frame display the
expected number of lines.
(Vdefault_frame_scroll_bars): Rewrite doc-string.
(Vdefault_frame_horizontal_scroll_bars)
(Vframe_initial_frame_tool_bar_height)
(frame_inhibit_implied_resize): New variables.
* fringe.c (compute_fringe_widths): Remove.
* gtkutil.h (YG_SB_MIN, YG_SB_MAX, YG_SB_RANGE): Define.
(xg_create_horizontal_scroll_bar)
(xg_update_horizontal_scrollbar_pos)
(xg_set_toolkit_horizontal_scroll_bar_thumb)
(xg_get_default_scrollbar_height)
(xg_clear_under_internal_border): Extern.
* gtkutil.c (xg_frame_resized): Don't call
do_pending_window_change.
(xg_frame_set_char_size): Use adjust_frame_size.
(style_changed_cb): Call update_theme_scrollbar_height and
x_set_scroll_bar_default_height.
(x_wm_set_size_hint): Don't call check_frame_size.
(update_theme_scrollbar_height)
(xg_get_default_scrollbar_height)
(xg_create_horizontal_scroll_bar)
(xg_update_horizontal_scrollbar_pos)
(xg_set_toolkit_horizontal_scroll_bar_thumb): New functions.
(xg_create_scroll_bar): Set horizontal slot of bar.
(xg_initialize): Call update_theme_scrollbar_height.
(xg_clear_under_internal_border): No more static.
* insdel.c (adjust_suspend_auto_hscroll): New function.
(adjust_markers_for_delete, adjust_markers_for_insert)
(adjust_markers_for_replace): Call adjust_suspend_auto_hscroll.
* keyboard.c (readable_events, discard_mouse_events)
(make_lispy_event): Handle horizontal scroll bar click events.
(Fsuspend_emacs): When changing the size of a tty frame do not
pass height of menu bar.
(Qbefore_handle, Qhorizontal_handle, Qafter_handle, Qleft)
(Qright, Qleftmost, Qrightmost): New symbols.
* menu.c (Fx_popup_dialog): Use FRAME_TOTAL_LINES instead of
FRAME_LINES.
* minibuf.c (read_minibuf): Initialize suspend_auto_hscroll.
* nsfns.m (x_set_internal_border_width): New function.
* nsterm.m (ns_draw_fringe_bitmap, ns_set_vertical_scroll_bar):
Remove extended fringe code.
(x_set_window_size, x_new_font): Don't call
compute_fringe_widths.
* term.c (Fresume_tty): When changing the size of a tty frame do
not pass height of menu bar.
(clear_tty_hooks, set_tty_hooks): Clear
horizontal_scroll_bar_hook.
(init_tty): Frame has no horizontal scroll bars.
* termhooks.h (enum scroll_bar_part): Add scroll_bar_move_ratio,
scroll_bar_before_handle, scroll_bar_horizontal_handle,
scroll_bar_after_handle, scroll_bar_left_arrow,
scroll_bar_right_arrow, scroll_bar_to_leftmost and
scroll_bar_to_rightmost entries.
(enum event_kind): Add HORIZONTAL_SCROLL_BAR_CLICK_EVENT
(struct terminal): Add set_horizontal_scroll_bar_hook.
* w32console.c (initialize_w32_display): Clear
horizontal_scroll_bar_hook.
* w32fns.c (x_set_mouse_color): Use FRAME_W32_DISPLAY instead of
FRAME_X_DISPLAY.
(x_clear_under_internal_border, x_set_internal_border_width):
New functions.
(x_set_menu_bar_lines): Rewrite using frame_inhibit_resize. Set
windows_or_buffers_changed when adding the menu bar.
(x_set_tool_bar_lines): Rewrite using adjust_frame_size.
(x_change_tool_bar_height, x_set_scroll_bar_default_height)
(w32_createhscrollbar): New functions.
(w32_createscrollbar): Rename to w32_createvscrollbar.
(w32_createwindow): Init WND_HSCROLLBAR_INDEX.
(w32_name_of_message): Replace WM_EMACS_CREATESCROLLBAR by
WM_EMACS_CREATEVSCROLLBAR and WM_EMACS_CREATEHSCROLLBAR. Add
WM_EMACS_SHOWCURSOR.
(w32_wnd_proc): Handle WM_HSCROLL case. In WM_WINDOWPOSCHANGING
case do not artificially impose WM size hints. Handle
WM_EMACS_SHOWCURSOR case. Replace WM_EMACS_CREATESCROLLBAR case
by WM_EMACS_CREATEVSCROLLBAR and WM_EMACS_CREATEHSCROLLBAR
cases.
(my_create_tip_window): Replace WND_SCROLLBAR_INDEX by
WND_VSCROLLBAR_INDEX and WND_HSCROLLBAR_INDEX.
(unwind_create_frame_1): Remove.
(Fx_create_frame): Make both scrollbars the system standard
width and height. Use official field of frame structure to
inhibit running window-configuration-change-hook.
(x_create_tip_frame): Call SET_FRAME_LINES and change_frame_size
pixelwise. Handle frame's official field.
(w32_frame_parm_handlers): Remove x_set_fringe_width
entries. Add x_set_scroll_bar_height,
x_set_horizontal_scroll_bars, x_set_left_fringe and
x_set_right_fringe.
* w32inevt.c (resize_event, maybe_generate_resize_event): Do not
pass height of menu bar to change_frame_size.
* w32menu.c (set_frame_menubar): Rewrite using
frame_inhibit_resize.
* w32term.h (struct w32_display_info): Add
horizontal_scroll_bar_cursor and cursor_display_counter.
(struct scroll_bar): Add horizontal.
(HORIZONTAL_SCROLL_BAR_INSIDE_HEIGHT)
(HORIZONTAL_SCROLL_BAR_LEFT_RANGE)
(HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH)
(HORIZONTAL_SCROLL_BAR_LEFT_BORDER)
(HORIZONTAL_SCROLL_BAR_RIGHT_BORDER)
(HORIZONTAL_SCROLL_BAR_TOP_BORDER)
(HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER)
(HORIZONTAL_SCROLL_BAR_MIN_HANDLE): New macros.
(WM_EMACS_CREATEVSCROLLBAR, WM_EMACS_CREATEHSCROLLBAR): Define
instead of WM_EMACS_CREATESCROLLBAR.
(WND_VSCROLLBAR_INDEX, WND_HSCROLLBAR_INDEX): Define instead of
WND_SCROLLBAR_INDEX.
* w32term.c (horizontal_scroll_bar_min_handle)
(horizontal_scroll_bar_left_border)
(horizontal_scroll_bar_right_border): New integers.
(x_set_frame_alpha): Replace x_highlight_frame by
w32_focus_frame.
(x_window_to_scroll_bar): New argument "type". Update callers
accordingly.
(w32_set_horizontal_scroll_bar_thumb)
(x_horizontal_scroll_bar_report_motion)
(w32_set_horizontal_scroll_bar)
(w32_horizontal_scroll_bar_handle_click)
(x_horizontal_scroll_bar_report_motion): New functions.
(w32_mouse_position): Discriminate horizontal and vertical
scrollbar cases.
(my_create_scrollbar): Replace with two new functions
my_create_vscrollbar and my_create_hscrollbar.
(x_scroll_bar_create): New argument "horizontal". Update
callers accordingly.
(x_scroll_bar_remove, w32_condemn_scroll_bars)
(w32_redeem_scroll_bar, x_scroll_bar_clear): Handle horizontal
scroll bar case.
(w32_read_socket): Handle WM_HSCROLL cae.
(x_new_font): Don't recompute fringe widths. Use
frame_inhibit_resize. Calculate new menu bar height iff we
build without toolkit. Always clear under internal border.
(x_set_window_size): Don't check frame size or recompute
fringes. Reset fullscreen status before applying sizes. Always
resize as requested by pixelwise argument. Don't call
do_pending_window_change.
(x_wm_set_size_hint): Add call for FRAME_SCROLL_BAR_AREA_HEIGHT.
(w32_initialize_display_info): Initialize dpyinfo's
horizontal_scroll_bar_cursor entry.
(w32_create_terminal): Add set_horizontal_scroll_bar_hook.
(w32_initialize): Init horizontal_scroll_bar_min_handle and
horizontal_scroll_bar_left_border.
(w32fullscreen_hook): Intermittently resize window to normal
when switching from fullscreen to maximized state.
(run_window_configuration_change_hook): Don't run it if frame is
not official yet.
(unwind_change_frame): Remove.
(Fset_window_configuration): Rewrite using frame's official field.
* widget.c (set_frame_size): Don't call compute_fringe_widths.
(EmacsFrameSetCharSize): Obey frame_inhibit_resize.
* window.h (struct window): New fields old_pointm,
horizontal_scroll_bar, horizontal_scroll_bar_type, hscroll_whole,
scroll_bar_height and suspend_auto_hscroll.
(wset_horizontal_scroll_bar, wset_horizontal_scroll_bar_type):
New functions.
(sanitize_window_sizes): Extern.
(MINI_NON_ONLY_WINDOW_P, MINI_ONLY_WINDOW_P, WINDOW_PSEUDO_P)
(WINDOW_TOPMOST_P, WINDOW_HAS_HORIZONTAL_SCROLL_BAR)
(WINDOW_CONFIG_SCROLL_BAR_HEIGHT)
(WINDOW_CONFIG_SCROLL_BAR_LINES)
(WINDOW_SCROLL_BAR_LINES, WINDOW_SCROLL_BAR_AREA_HEIGHT): New
macros.
(WINDOW_LEFT_FRINGE_COLS, WINDOW_RIGHT_FRINGE_COLS)
(WINDOW_FRINGE_COLS, WINDOW_FRINGE_EXTENDED_P): Remove macros.
(WINDOW_VERTICAL_SCROLL_BAR_TYPE)
(WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT)
(WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT)
(WINDOW_HAS_VERTICAL_SCROLL_BAR): Minor rewrite.
(WINDOW_BOX_HEIGHT_NO_MODE_LINE, WINDOW_BOX_TEXT_HEIGHT)
(WINDOW_SCROLL_BAR_AREA_Y): Count in scroll bar height.
* window.c (wset_old_pointm, Fwindow_scroll_bar_height)
(Fwindow_old_point, sanitize_window_sizes): New functions.
(Qwindow_sanitize_window_sizes): New symbol.
(window_body_height): Count in horizontal scroll bar.
(set_window_hscroll, Fscroll_left, Fscroll_right): Set
suspend_auto_hscroll slot.
(Fwindow_inside_edges): Count fringes pixelwise.
(coordinates_in_window, Fcoordinates_in_window_p): Consider
horizontal scroll bar.
(check_frame_size, adjust_window_margins): Remove functions and
corresponding calls.
(set_window_buffer): Initialize old_pointm and horizontal scroll
bars.
(temp_output_buffer_show): Reset hscroll related fields.
Initialize old_pointm.
(make_parent_window): Initialize old_pointm.
(make_window): Initialize old_pointm, horizontal scroll bar type,
and scroll bar height.
(resize_frame_windows): Don't count top margin in new sizes.
Don't use safe sizes when shrinking a frame; let the window
manager do the clipping.
(Fsplit_window_internal): Inherit horizontal scroll bar type and
height.
(Fdelete_window_internal): Unchain old_pointm marker.
(window_scroll_pixel_based, Fscroll_other_window): Adjust
old_pointm.
(Fwindow_text_width, Fwindow_text_height): New argument
"pixelwise".
(struct saved_window): New fields, old_pointm, hscroll_whole,
suspend_auto_hscroll, scroll_bar_height and
horizontal_scroll_bar_type.
(Fset_window_configuration, save_window_save): Set new fields of
saved_window.
(apply_window_adjustment): Don't call adjust_window_margins.
(set_window_margins): Don't change margins if new sizes don't
fit into window.
(set_window_scroll_bars): New argument "horizontal_type".
Handle horizontal scroll bars. Don't change scroll bars if they
don't fit into window.
(Fset_window_scroll_bars): New argument "horizontal_type".
(Fwindow_scroll_bars): Return values for horizontal scroll bars.
(compare_window_configurations): Compare horizontal scroll bar
settings.
* xdisp.c (window_text_bottom_y, window_box_height): Count in
horizontal scroll bar height.
(pixel_to_glyph_coords, init_xdisp): Use FRAME_TOTAL_LINES
instead of FRAME_LINES.
(remember_mouse_glyph): Case ON_SCROLL_BAR changed to
ON_VERTICAL_SCROLL_BAR.
(with_echo_area_buffer): Initialize old_pointm.
(with_echo_area_buffer_unwind_data): Store old_pointm values in
vector.
(unwind_with_echo_area_buffer): Handle old_pointm.
(update_tool_bar): Set do_update when the tool bar window has at
least one line (since this is what the user sets).
(MAX_FRAME_TOOL_BAR_HEIGHT): Remove macro.
(redisplay_tool_bar): Return early when toolbar has zero lines.
Call x_change_tool_bar_height. Don't use max_tool_bar_height.
(hscroll_window_tree): Handle suspension of auto_hscroll and
old_pointm.
(set_horizontal_scroll_bar): New function.
(redisplay_window): Set ignore_mouse_drag_p when tool bar has
more than one line. Handle horizontal scroll bars.
(note_mouse_highlight): Handle horizontal scrol bars.
(expose_frame): Set dimensions of XRectangle from frame's text
sizes.
(Vvoid_text_area_pointer): Update doc-string.
* xfns.c (x_set_menu_bar_lines): Use adjust_frame_size.
(x_change_tool_bar_height, x_set_scroll_bar_default_height)
(x_set_internal_border_width): New functions.
(x_set_tool_bar_lines): Call x_change_tool_bar_height.
(unwind_create_frame_1): Remove.
(Fx_create_frame): Handle horizontal scroll bars. Use official
field of frame structure to inhibit running
window-configuration-change-hook.
(x_create_tip_frame): Call SET_FRAME_LINES and change_frame_size
pixelwise. Handle frame's official field.
(x_frame_parm_handlers): Add x_set_scroll_bar_height,
x_set_horizontal_scroll_bars, x_set_left_fringe,
x_set_right_fringe.
* xmenu.c (update_frame_menubar, free_frame_menubar): Use
adjust_frame_size.
* xterm.h (struct x_display_info): Add
horizontal_scroll_bar_cursor and Xatom_Horizontal_Scrollbar
slots.
(struct scroll_bar): Add horizontal slot.
(HORIZONTAL_SCROLL_BAR_INSIDE_HEIGHT)
(HORIZONTAL_SCROLL_BAR_LEFT_RANGE)
(HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH): New macros.
(HORIZONTAL_SCROLL_BAR_LEFT_BORDER)
(HORIZONTAL_SCROLL_BAR_RIGHT_BORDER)
(HORIZONTAL_SCROLL_BAR_TOP_BORDER)
(HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER)
(HORIZONTAL_SCROLL_BAR_MIN_HANDLE): Define.
(x_clear_under_internal_border): Remove.
* xterm.c (XTmouse_position): Handle horizontal scroll bars.
(x_window_to_scroll_bar): New argument TYPE. Update callers.
(x_send_scroll_bar_event, x_scroll_bar_create): New arguments
HORIZONTAL. Update callers.
(horizontal_action_hook_id): New action hook id.
(x_horizontal_scroll_bar_to_input_event)
(x_create_horizontal_toolkit_scroll_bar)
(xt_horizontal_action_hook)
(x_set_toolkit_horizontal_scroll_bar_thumb)
(XTset_horizontal_scroll_bar, x_net_wm_state)
(x_horizontal_scroll_bar_report_motion): New functions.
(xg_scroll_callback, x_scroll_bar_handle_click): Handle
horizontal scroll bars.
(SCROLL_BAR_HORIZONTAL_NAME): Define.
(XTset_vertical_scroll_bar): Attempt to clear areas not covered
by scroll bar.
(XTcondemn_scroll_bars, XTredeem_scroll_bar): Rewrite. Handle
horizontal scroll bars.
(handle_one_xevent): Handle horizontal scroll bar events. Call
x_net_wm_state.
(x_set_window_size_1, x_wm_set_size_hint): Don't call
check_frame_size.
(x_set_window_size): Don't call check_frame_size and
do_pending_window_change.
(x_term_init): Init horizontal_scroll_bar_cursor display info.
(x_create_terminal): Add set_horizontal_scroll_bar_hook.
(x_scroll_bar_set_handle): Add some checks when calling
x_clear_area.
2014-07-27 13:21:30 +00:00
|
|
|
|
(modify-frame-parameters
|
2014-10-23 01:38:59 +00:00
|
|
|
|
frame-initial-frame `((top . ,adjusted-top))))))
|
2015-01-12 07:18:00 +00:00
|
|
|
|
;; Reset `tool-bar-mode' when zero tool bar lines have been
|
|
|
|
|
;; requested for the window-system or default frame alists.
|
|
|
|
|
(when (and tool-bar-mode
|
|
|
|
|
(and other-lines
|
|
|
|
|
(or (null (cdr other-lines))
|
|
|
|
|
(eq 0 (cdr other-lines)))))
|
|
|
|
|
(tool-bar-mode -1)))))
|
2001-01-30 15:06:47 +00:00
|
|
|
|
|
|
|
|
|
;; The initial frame we create above always has a minibuffer.
|
|
|
|
|
;; If the user wants to remove it, or make it a minibuffer-only
|
|
|
|
|
;; frame, then we'll have to delete the current frame and make a
|
|
|
|
|
;; new one; you can't remove or add a root window to/from an
|
|
|
|
|
;; existing frame.
|
|
|
|
|
;;
|
|
|
|
|
;; NOTE: default-frame-alist was nil when we created the
|
|
|
|
|
;; existing frame. We need to explicitly include
|
|
|
|
|
;; default-frame-alist in the parameters of the screen we
|
|
|
|
|
;; create here, so that its new value, gleaned from the user's
|
2012-09-17 05:41:04 +00:00
|
|
|
|
;; init file, will be applied to the existing screen.
|
2019-03-05 09:46:19 +00:00
|
|
|
|
(if (not (eq minibuffer t))
|
2001-01-30 15:18:13 +00:00
|
|
|
|
;; Create the new frame.
|
|
|
|
|
(let (parms new)
|
2013-07-29 16:34:53 +00:00
|
|
|
|
;; MS-Windows needs this to avoid inflooping below.
|
|
|
|
|
(if (eq system-type 'windows-nt)
|
|
|
|
|
(sit-for 0 t))
|
2001-01-30 15:18:13 +00:00
|
|
|
|
;; If the frame isn't visible yet, wait till it is.
|
|
|
|
|
;; If the user has to position the window,
|
|
|
|
|
;; Emacs doesn't know its real position until
|
|
|
|
|
;; the frame is seen to be visible.
|
|
|
|
|
(while (not (cdr (assq 'visibility
|
|
|
|
|
(frame-parameters frame-initial-frame))))
|
|
|
|
|
(sleep-for 1))
|
|
|
|
|
(setq parms (frame-parameters frame-initial-frame))
|
2001-01-30 15:06:47 +00:00
|
|
|
|
|
2001-11-26 18:20:20 +00:00
|
|
|
|
;; Get rid of `name' unless it was specified explicitly before.
|
2001-01-30 15:18:13 +00:00
|
|
|
|
(or (assq 'name frame-initial-frame-alist)
|
|
|
|
|
(setq parms (delq (assq 'name parms) parms)))
|
2008-02-14 21:16:36 +00:00
|
|
|
|
;; An explicit parent-id is a request to XEmbed the frame.
|
|
|
|
|
(or (assq 'parent-id frame-initial-frame-alist)
|
|
|
|
|
(setq parms (delq (assq 'parent-id parms) parms)))
|
2001-01-30 15:18:13 +00:00
|
|
|
|
|
|
|
|
|
(setq parms (append initial-frame-alist
|
2005-09-07 23:11:21 +00:00
|
|
|
|
window-system-frame-alist
|
2001-01-30 15:18:13 +00:00
|
|
|
|
default-frame-alist
|
|
|
|
|
parms
|
|
|
|
|
nil))
|
|
|
|
|
|
2019-03-05 09:46:19 +00:00
|
|
|
|
(when (eq minibuffer 'child-frame)
|
|
|
|
|
;; When the minibuffer shall be shown in a child frame,
|
|
|
|
|
;; remove the 'minibuffer' parameter from PARMS. It
|
|
|
|
|
;; will get assigned by the usual routines to the child
|
|
|
|
|
;; frame's root window below.
|
|
|
|
|
(setq parms (cons '(minibuffer)
|
|
|
|
|
(delq (assq 'minibuffer parms) parms))))
|
|
|
|
|
|
|
|
|
|
;; Get rid of `reverse', because that was handled
|
2001-01-30 15:18:13 +00:00
|
|
|
|
;; when we first made the frame.
|
|
|
|
|
(setq parms (cons '(reverse) (delq (assq 'reverse parms) parms)))
|
|
|
|
|
|
|
|
|
|
(if (assq 'height frame-initial-geometry-arguments)
|
|
|
|
|
(setq parms (assq-delete-all 'height parms)))
|
|
|
|
|
(if (assq 'width frame-initial-geometry-arguments)
|
|
|
|
|
(setq parms (assq-delete-all 'width parms)))
|
|
|
|
|
(if (assq 'left frame-initial-geometry-arguments)
|
|
|
|
|
(setq parms (assq-delete-all 'left parms)))
|
|
|
|
|
(if (assq 'top frame-initial-geometry-arguments)
|
|
|
|
|
(setq parms (assq-delete-all 'top parms)))
|
|
|
|
|
(setq new
|
|
|
|
|
(make-frame
|
|
|
|
|
;; Use the geometry args that created the existing
|
|
|
|
|
;; frame, rather than the parms we get for it.
|
|
|
|
|
(append frame-initial-geometry-arguments
|
|
|
|
|
'((user-size . t) (user-position . t))
|
|
|
|
|
parms)))
|
|
|
|
|
;; The initial frame, which we are about to delete, may be
|
|
|
|
|
;; the only frame with a minibuffer. If it is, create a
|
|
|
|
|
;; new one.
|
|
|
|
|
(or (delq frame-initial-frame (minibuffer-frame-list))
|
2019-03-05 09:46:19 +00:00
|
|
|
|
(and (eq minibuffer 'child-frame)
|
|
|
|
|
;; Create a minibuffer child frame and parent it
|
|
|
|
|
;; immediately. Take any other parameters for
|
|
|
|
|
;; the child frame from 'minibuffer-frame-list'.
|
|
|
|
|
(let* ((minibuffer-frame-alist
|
|
|
|
|
(cons `(parent-frame . ,new) minibuffer-frame-alist)))
|
|
|
|
|
(make-initial-minibuffer-frame nil)
|
|
|
|
|
;; With a minibuffer child frame we do not want
|
|
|
|
|
;; to select the minibuffer frame initially as
|
|
|
|
|
;; we do for standard minibuffer-only frames.
|
|
|
|
|
(select-frame new)))
|
|
|
|
|
(make-initial-minibuffer-frame nil))
|
2001-01-30 15:18:13 +00:00
|
|
|
|
|
|
|
|
|
;; If the initial frame is serving as a surrogate
|
|
|
|
|
;; minibuffer frame for any frames, we need to wean them
|
|
|
|
|
;; onto a new frame. The default-minibuffer-frame
|
|
|
|
|
;; variable must be handled similarly.
|
|
|
|
|
(let ((users-of-initial
|
|
|
|
|
(filtered-frame-list
|
2007-07-25 19:37:21 +00:00
|
|
|
|
(lambda (frame)
|
|
|
|
|
(and (not (eq frame frame-initial-frame))
|
|
|
|
|
(eq (window-frame
|
|
|
|
|
(minibuffer-window frame))
|
|
|
|
|
frame-initial-frame))))))
|
|
|
|
|
(if (or users-of-initial
|
2001-01-30 15:18:13 +00:00
|
|
|
|
(eq default-minibuffer-frame frame-initial-frame))
|
|
|
|
|
|
|
|
|
|
;; Choose an appropriate frame. Prefer frames which
|
|
|
|
|
;; are only minibuffers.
|
|
|
|
|
(let* ((new-surrogate
|
|
|
|
|
(car
|
|
|
|
|
(or (filtered-frame-list
|
2007-07-25 19:37:21 +00:00
|
|
|
|
(lambda (frame)
|
|
|
|
|
(eq (cdr (assq 'minibuffer
|
|
|
|
|
(frame-parameters frame)))
|
|
|
|
|
'only)))
|
2001-01-30 15:18:13 +00:00
|
|
|
|
(minibuffer-frame-list))))
|
|
|
|
|
(new-minibuffer (minibuffer-window new-surrogate)))
|
|
|
|
|
|
|
|
|
|
(if (eq default-minibuffer-frame frame-initial-frame)
|
|
|
|
|
(setq default-minibuffer-frame new-surrogate))
|
|
|
|
|
|
|
|
|
|
;; Wean the frames using frame-initial-frame as
|
|
|
|
|
;; their minibuffer frame.
|
2007-07-25 19:37:21 +00:00
|
|
|
|
(dolist (frame users-of-initial)
|
|
|
|
|
(modify-frame-parameters
|
|
|
|
|
frame (list (cons 'minibuffer new-minibuffer)))))))
|
|
|
|
|
|
|
|
|
|
;; Redirect events enqueued at this frame to the new frame.
|
2001-01-30 15:18:13 +00:00
|
|
|
|
;; Is this a good idea?
|
|
|
|
|
(redirect-frame-focus frame-initial-frame new)
|
|
|
|
|
|
|
|
|
|
;; Finally, get rid of the old frame.
|
|
|
|
|
(delete-frame frame-initial-frame t))
|
2001-01-30 15:06:47 +00:00
|
|
|
|
|
2011-12-30 02:52:49 +00:00
|
|
|
|
;; Otherwise, we don't need all that rigmarole; just apply
|
2001-01-30 15:06:47 +00:00
|
|
|
|
;; the new parameters.
|
|
|
|
|
(let (newparms allparms tail)
|
|
|
|
|
(setq allparms (append initial-frame-alist
|
2005-09-07 23:11:21 +00:00
|
|
|
|
window-system-frame-alist
|
2001-01-30 15:06:47 +00:00
|
|
|
|
default-frame-alist nil))
|
|
|
|
|
(if (assq 'height frame-initial-geometry-arguments)
|
|
|
|
|
(setq allparms (assq-delete-all 'height allparms)))
|
|
|
|
|
(if (assq 'width frame-initial-geometry-arguments)
|
|
|
|
|
(setq allparms (assq-delete-all 'width allparms)))
|
|
|
|
|
(if (assq 'left frame-initial-geometry-arguments)
|
|
|
|
|
(setq allparms (assq-delete-all 'left allparms)))
|
|
|
|
|
(if (assq 'top frame-initial-geometry-arguments)
|
|
|
|
|
(setq allparms (assq-delete-all 'top allparms)))
|
|
|
|
|
(setq tail allparms)
|
|
|
|
|
;; Find just the parms that have changed since we first
|
|
|
|
|
;; made this frame. Those are the ones actually set by
|
2001-11-26 18:20:20 +00:00
|
|
|
|
;; the init file. For those parms whose values we already knew
|
2001-01-30 15:06:47 +00:00
|
|
|
|
;; (such as those spec'd by command line options)
|
|
|
|
|
;; it is undesirable to specify the parm again
|
2001-11-26 18:20:20 +00:00
|
|
|
|
;; once the user has seen the frame and been able to alter it
|
2001-01-30 15:06:47 +00:00
|
|
|
|
;; manually.
|
2010-11-13 18:34:02 +00:00
|
|
|
|
(let (newval oldval)
|
|
|
|
|
(dolist (entry tail)
|
|
|
|
|
(setq oldval (assq (car entry) frame-initial-frame-alist))
|
|
|
|
|
(setq newval (cdr (assq (car entry) allparms)))
|
2001-01-30 15:06:47 +00:00
|
|
|
|
(or (and oldval (eq (cdr oldval) newval))
|
|
|
|
|
(setq newparms
|
2010-11-13 18:34:02 +00:00
|
|
|
|
(cons (cons (car entry) newval) newparms)))))
|
2001-01-30 15:06:47 +00:00
|
|
|
|
(setq newparms (nreverse newparms))
|
2010-11-13 18:34:02 +00:00
|
|
|
|
|
|
|
|
|
(let ((new-bg (assq 'background-color newparms)))
|
|
|
|
|
;; If the `background-color' parameter is changed, apply
|
|
|
|
|
;; it first, then make sure that the `background-mode'
|
|
|
|
|
;; parameter and other faces are updated, before applying
|
|
|
|
|
;; the other parameters.
|
|
|
|
|
(when new-bg
|
|
|
|
|
(modify-frame-parameters frame-initial-frame
|
|
|
|
|
(list new-bg))
|
|
|
|
|
(unless (assq 'background-mode newparms)
|
|
|
|
|
(frame-set-background-mode frame-initial-frame))
|
|
|
|
|
(face-set-after-frame-default frame-initial-frame)
|
|
|
|
|
(setq newparms (delq new-bg newparms)))
|
Try to improve handling of fullwidth/-height frames.
* frame.el (frame-notice-user-settings): Update
`frame-size-history'.
(make-frame): Update `frame-size-history'. Call
`frame-after-make-frame'.
* faces.el (face-set-after-frame-default): Remove call to
frame-can-run-window-configuration-change-hook.
* frame.c (frame_size_history_add): New function.
(frame_inhibit_resize): Consider frame_inhibit_implied_resize
only after frame's after_make_frame slot is true. Inhibit
resizing fullwidth-/height frames in one direction only. Update
frame_size_history.
(adjust_frame_size): Call frame_size_history_add.
(make_frame): Initalize after_make_frame slot.
(Fmake_terminal_frame): Adjust adjust_frame_size call.
(Fcan_run_window_configuration_change_hook): Rename to
Fframe_after_make_frame. Set after_make_frame slot. Return
second argument.
(x_set_frame_parameters): Postpone handling fullscreen parameter
until after width and height parameters have been set. Apply
width and height changes only if can_x_set_window_size is true.
Update frame_size_history.
(Qadjust_frame_size_1, Qadjust_frame_size_2)
(Qadjust_frame_size_3, QEmacsFrameResize, Qframe_inhibit_resize)
(Qx_set_fullscreen, Qx_check_fullscreen, Qx_set_window_size_1)
(Qxg_frame_resized, Qxg_frame_set_char_size_1)
(Qxg_frame_set_char_size_2, Qxg_frame_set_char_size_3)
(Qxg_change_toolbar_position, Qx_net_wm_state)
(Qx_handle_net_wm_state, Qtb_size_cb, Qupdate_frame_tool_bar)
(Qfree_frame_tool_bar): New symbol for updating
frame_size_history.
(Qtip_frame, Qterminal_frame): New symbols.
(Vframe_adjust_size_history): Rename to frame_size_history.
* frame.h (struct frame): Rename
can_run_window_configuration_change_hook slot to
after_make_frame.
(frame_size_history_add): Extern.
* gtkutil.c (xg_frame_resized): Call frame_size_history_add.
Don't set FRAME_PIXEL_WIDTH and FRAME_PIXEL_HEIGHT here.
(xg_frame_set_char_size): Try to preserve the status of
fullwidth/-height frames. Call frame_size_history_add.
(tb_size_cb, update_frame_tool_bar, free_frame_tool_bar)
(xg_change_toolbar_position): Call frame_size_history_add.
* w32fns.c (x_change_tool_bar_height): Handle frame's fullscreen
status.
(Fx_create_frame): Process fullscreen parameter after frame has
been resized.
(x_create_tip_frame): Pass Qtip_frame to adjust_frame_size.
(Fx_frame_geometry): Don't pollute pure storage.
* w32term.c (w32_read_socket): For WM_WINDOWPOSCHANGED,
WM_ACTIVATE and WM_ACTIVATEAPP set frame's visibility before
calling w32fullscreen_hook. For WM_DISPLAYCHANGE call
w32fullscreen_hook immediately.
(x_fullscreen_adjust, x_check_fullscreen): Remove.
(w32fullscreen_hook): Call change_frame_size just as with a
"normal" frame resize operation. Call do_pending_window_change.
(x_set_window_size): Try to handle fullwidth and fullheight more
accurately. Don't rely on w32_enable_frame_resize_hack.
(w32_enable_frame_resize_hack): Remove variable.
* widget.c (EmacsFrameResize): Remove dead code. Call
frame_size_history_add
* window.c (run_window_configuration_change_hook): Check
f->after_make_frame instead of
f->can_run_window_configuration_change_hook.
* xfns.c (x_change_tool_bar_height): Handle frame's fullscreen status.
(Fx_create_frame): Process fullscreen parameter after frame has
been resized.
(Fx_frame_geometry): Don't pollute pure storage.
* xterm.c (x_net_wm_state, x_handle_net_wm_state): Call
frame_size_history_add.
(do_ewmh_fullscreen): Handle x_frame_normalize_before_maximize.
(x_check_fullscreen): Count in menubar when calling
XResizeWindow. Wait for ConfigureNotify event. Call
frame_size_history_add.
(x_set_window_size_1): Remove PIXELWISE argument. Try to handle
changing a fullheight frame's width or a fullwidth frame's
height. Call frame_size_history_add.
(x_set_window_size): Simplify xg_frame_set_char_size and
x_set_window_size_1 calls.
(x_frame_normalize_before_maximize): New variable.
2015-02-07 10:51:03 +00:00
|
|
|
|
|
2010-11-13 18:34:02 +00:00
|
|
|
|
(modify-frame-parameters frame-initial-frame newparms)))))
|
1991-08-15 21:29:06 +00:00
|
|
|
|
|
* frame.el: Clean up initialization code.
(initial-frame-alist): Doc fix.
(minibuffer-frame-alist): New default value, with a reasonable height.
(filtered-frame-list, minibuffer-frame-list): New functions.
(frame-initialize): Use minibuffer-frame-list, instead of writing
it out.
(frame-notice-user-settings): Thoroughly rearranged.
Notice changes to default-frame-alist as well as initial-frame-alist.
Properly handle requests to make the initial frame into a
minibufferless or minibuffer-only frame.
Create a minibuffer-only frame if the initial frame should lack a
minibuffer and there are no other minibuffer frames created by the
user's initialization file.
Fix any frames using the initial frame as a surrogate minibuffer
frame.
Restore the current buffer after creating and deleting all these
frames.
* frame.el (set-default-font, set-frame-background,
set-frame-foreground, set-cursor-color, set-pointer-color,
set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Give these docstrings.
(set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Make these toggle or look at the prefix
argument, like minor modes.
* frame.el (set-vertical-bar): Use the proper parameter symbol.
(set-horizontal-bar): Signal an error indicating that horizontal
scrollbars are not implemented.
1993-02-14 14:29:30 +00:00
|
|
|
|
;; Restore the original buffer.
|
|
|
|
|
(set-buffer old-buffer)
|
|
|
|
|
|
|
|
|
|
;; Make sure the initial frame can be GC'd if it is ever deleted.
|
1993-05-18 22:40:43 +00:00
|
|
|
|
;; Make sure frame-notice-user-settings does nothing if called twice.
|
2000-01-13 14:46:19 +00:00
|
|
|
|
(setq frame-notice-user-settings nil)
|
1993-05-18 22:40:43 +00:00
|
|
|
|
(setq frame-initial-frame nil)))
|
1991-08-15 21:29:06 +00:00
|
|
|
|
|
1995-05-30 06:54:44 +00:00
|
|
|
|
(defun make-initial-minibuffer-frame (display)
|
|
|
|
|
(let ((parms (append minibuffer-frame-alist '((minibuffer . only)))))
|
|
|
|
|
(if display
|
|
|
|
|
(make-frame-on-display display parms)
|
|
|
|
|
(make-frame parms))))
|
|
|
|
|
|
* frame.el: Clean up initialization code.
(initial-frame-alist): Doc fix.
(minibuffer-frame-alist): New default value, with a reasonable height.
(filtered-frame-list, minibuffer-frame-list): New functions.
(frame-initialize): Use minibuffer-frame-list, instead of writing
it out.
(frame-notice-user-settings): Thoroughly rearranged.
Notice changes to default-frame-alist as well as initial-frame-alist.
Properly handle requests to make the initial frame into a
minibufferless or minibuffer-only frame.
Create a minibuffer-only frame if the initial frame should lack a
minibuffer and there are no other minibuffer frames created by the
user's initialization file.
Fix any frames using the initial frame as a surrogate minibuffer
frame.
Restore the current buffer after creating and deleting all these
frames.
* frame.el (set-default-font, set-frame-background,
set-frame-foreground, set-cursor-color, set-pointer-color,
set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Give these docstrings.
(set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Make these toggle or look at the prefix
argument, like minor modes.
* frame.el (set-vertical-bar): Use the proper parameter symbol.
(set-horizontal-bar): Signal an error indicating that horizontal
scrollbars are not implemented.
1993-02-14 14:29:30 +00:00
|
|
|
|
;;;; Creation of additional frames, and other frame miscellanea
|
1992-07-15 00:32:19 +00:00
|
|
|
|
|
2003-07-13 17:48:58 +00:00
|
|
|
|
(defun modify-all-frames-parameters (alist)
|
2004-07-23 12:20:22 +00:00
|
|
|
|
"Modify all current and future frames' parameters according to ALIST.
|
2003-07-13 17:48:58 +00:00
|
|
|
|
This changes `default-frame-alist' and possibly `initial-frame-alist'.
|
2006-03-26 13:57:43 +00:00
|
|
|
|
Furthermore, this function removes all parameters in ALIST from
|
|
|
|
|
`window-system-default-frame-alist'.
|
2003-07-13 17:48:58 +00:00
|
|
|
|
See help of `modify-frame-parameters' for more information."
|
2006-03-26 13:57:43 +00:00
|
|
|
|
(dolist (frame (frame-list))
|
|
|
|
|
(modify-frame-parameters frame alist))
|
|
|
|
|
|
|
|
|
|
(dolist (pair alist) ;; conses to add/replace
|
|
|
|
|
;; initial-frame-alist needs setting only when
|
|
|
|
|
;; frame-notice-user-settings is true.
|
|
|
|
|
(and frame-notice-user-settings
|
|
|
|
|
(setq initial-frame-alist
|
|
|
|
|
(assq-delete-all (car pair) initial-frame-alist)))
|
|
|
|
|
(setq default-frame-alist
|
|
|
|
|
(assq-delete-all (car pair) default-frame-alist))
|
|
|
|
|
;; Remove any similar settings from the window-system specific
|
|
|
|
|
;; parameters---they would override default-frame-alist.
|
|
|
|
|
(dolist (w window-system-default-frame-alist)
|
|
|
|
|
(setcdr w (assq-delete-all (car pair) (cdr w)))))
|
|
|
|
|
|
2003-07-13 17:48:58 +00:00
|
|
|
|
(and frame-notice-user-settings
|
|
|
|
|
(setq initial-frame-alist (append initial-frame-alist alist)))
|
|
|
|
|
(setq default-frame-alist (append default-frame-alist alist)))
|
|
|
|
|
|
1992-07-21 06:30:52 +00:00
|
|
|
|
(defun get-other-frame ()
|
1999-07-30 18:39:32 +00:00
|
|
|
|
"Return some frame other than the current frame.
|
|
|
|
|
Create one if necessary. Note that the minibuffer frame, if separate,
|
|
|
|
|
is not considered (see `next-frame')."
|
2013-08-06 10:59:39 +00:00
|
|
|
|
(if (equal (next-frame) (selected-frame)) (make-frame) (next-frame)))
|
1991-08-15 21:29:06 +00:00
|
|
|
|
|
2019-11-05 23:49:02 +00:00
|
|
|
|
(defun next-window-any-frame ()
|
1992-07-15 00:32:19 +00:00
|
|
|
|
"Select the next window, regardless of which frame it is on."
|
1991-08-15 21:29:06 +00:00
|
|
|
|
(interactive)
|
|
|
|
|
(select-window (next-window (selected-window)
|
|
|
|
|
(> (minibuffer-depth) 0)
|
2004-04-22 21:08:10 +00:00
|
|
|
|
0))
|
2001-08-10 13:47:18 +00:00
|
|
|
|
(select-frame-set-input-focus (selected-frame)))
|
1991-08-15 21:29:06 +00:00
|
|
|
|
|
2019-11-05 23:49:02 +00:00
|
|
|
|
(defun previous-window-any-frame ()
|
1992-07-15 00:32:19 +00:00
|
|
|
|
"Select the previous window, regardless of which frame it is on."
|
1991-08-15 21:29:06 +00:00
|
|
|
|
(interactive)
|
|
|
|
|
(select-window (previous-window (selected-window)
|
|
|
|
|
(> (minibuffer-depth) 0)
|
2004-04-22 21:08:10 +00:00
|
|
|
|
0))
|
2001-08-10 13:47:18 +00:00
|
|
|
|
(select-frame-set-input-focus (selected-frame)))
|
1991-08-15 21:29:06 +00:00
|
|
|
|
|
2021-04-12 16:32:07 +00:00
|
|
|
|
(defalias 'next-multiframe-window #'next-window-any-frame)
|
|
|
|
|
(defalias 'previous-multiframe-window #'previous-window-any-frame)
|
2019-11-05 23:49:02 +00:00
|
|
|
|
|
2012-09-17 11:55:05 +00:00
|
|
|
|
(defun window-system-for-display (display)
|
|
|
|
|
"Return the window system for DISPLAY.
|
|
|
|
|
Return nil if we don't know how to interpret DISPLAY."
|
2013-12-28 11:47:26 +00:00
|
|
|
|
;; MS-Windows doesn't know how to create a GUI frame in a -nw session.
|
|
|
|
|
(if (and (eq system-type 'windows-nt)
|
2015-02-27 10:43:30 +00:00
|
|
|
|
(null (window-system))
|
|
|
|
|
(not (daemonp)))
|
2013-12-28 11:47:26 +00:00
|
|
|
|
nil
|
|
|
|
|
(cl-loop for descriptor in display-format-alist
|
|
|
|
|
for pattern = (car descriptor)
|
|
|
|
|
for system = (cdr descriptor)
|
|
|
|
|
when (string-match-p pattern display) return system)))
|
2007-11-22 13:50:36 +00:00
|
|
|
|
|
1994-10-25 09:49:53 +00:00
|
|
|
|
(defun make-frame-on-display (display &optional parameters)
|
2008-11-04 16:39:46 +00:00
|
|
|
|
"Make a frame on display DISPLAY.
|
|
|
|
|
The optional argument PARAMETERS specifies additional frame parameters."
|
2021-03-26 17:13:59 +00:00
|
|
|
|
(interactive (if (fboundp 'x-display-list)
|
2021-09-21 15:52:53 +00:00
|
|
|
|
(list (completing-read "Make frame on display: "
|
|
|
|
|
(x-display-list)))
|
2021-03-26 17:13:59 +00:00
|
|
|
|
(user-error "This Emacs build does not support X displays")))
|
2012-09-17 11:55:05 +00:00
|
|
|
|
(make-frame (cons (cons 'display display) parameters)))
|
1994-10-25 09:49:53 +00:00
|
|
|
|
|
2020-03-06 00:19:00 +00:00
|
|
|
|
(defun make-frame-on-current-monitor (&optional parameters)
|
|
|
|
|
"Make a frame on the currently selected monitor.
|
|
|
|
|
Like `make-frame-on-monitor' and with the same PARAMETERS as in `make-frame'."
|
|
|
|
|
(interactive)
|
|
|
|
|
(let* ((monitor-workarea
|
|
|
|
|
(cdr (assq 'workarea (frame-monitor-attributes))))
|
|
|
|
|
(geometry-parameters
|
|
|
|
|
(when monitor-workarea
|
|
|
|
|
`((top . ,(nth 1 monitor-workarea))
|
|
|
|
|
(left . ,(nth 0 monitor-workarea))))))
|
|
|
|
|
(make-frame (append geometry-parameters parameters))))
|
|
|
|
|
|
2019-02-25 21:11:34 +00:00
|
|
|
|
(defun make-frame-on-monitor (monitor &optional display parameters)
|
|
|
|
|
"Make a frame on monitor MONITOR.
|
|
|
|
|
The optional argument DISPLAY can be a display name, and the optional
|
|
|
|
|
argument PARAMETERS specifies additional frame parameters."
|
2019-03-27 21:46:39 +00:00
|
|
|
|
(interactive
|
|
|
|
|
(list
|
|
|
|
|
(let* ((default (cdr (assq 'name (frame-monitor-attributes)))))
|
|
|
|
|
(completing-read
|
Use `format-prompt' when prompting with default values
* lisp/woman.el (woman-file-name):
* lisp/wid-edit.el (widget-file-prompt-value)
(widget-coding-system-prompt-value):
* lisp/w32-fns.el (w32-set-system-coding-system):
* lisp/vc/vc.el (vc-print-root-log):
* lisp/vc/vc-annotate.el (vc-annotate):
* lisp/vc/emerge.el (emerge-read-file-name):
* lisp/vc/ediff.el (ediff-directories)
(ediff-directory-revisions, ediff-directories3)
(ediff-merge-directories, )
(ediff-merge-directories-with-ancestor)
(ediff-merge-directory-revisions)
(ediff-merge-directory-revisions-with-ancestor)
(ediff-merge-revisions, ediff-merge-revisions-with-ancestor)
(ediff-revision):
* lisp/vc/ediff-util.el (ediff-toggle-regexp-match):
* lisp/vc/ediff-mult.el (ediff-filegroup-action):
* lisp/vc/add-log.el (prompt-for-change-log-name):
* lisp/textmodes/table.el (table-insert-row-column)
(table-span-cell, table-split-cell-horizontally)
(table-split-cell, table-justify, table-generate-source)
(table-insert-sequence, table-capture)
(table--read-from-minibuffer, table--query-justification):
* lisp/textmodes/sgml-mode.el (sgml-tag, sgml-tag-help):
* lisp/textmodes/reftex-ref.el (reftex-goto-label):
* lisp/textmodes/refer.el (refer-get-bib-files):
* lisp/textmodes/css-mode.el (css-lookup-symbol):
* lisp/term.el (serial-read-name, serial-read-speed):
* lisp/speedbar.el (speedbar-change-initial-expansion-list):
* lisp/simple.el (previous-matching-history-element)
(set-variable):
* lisp/ses.el (ses-read-cell, ses-set-column-width):
* lisp/replace.el (query-replace-read-from)
(occur-read-primary-args):
* lisp/rect.el (string-rectangle, string-insert-rectangle):
* lisp/progmodes/tcl.el (tcl-help-on-word):
* lisp/progmodes/sh-script.el (sh-set-shell):
* lisp/progmodes/python.el (python-eldoc-at-point):
* lisp/progmodes/octave.el (octave-completing-read)
(octave-update-function-file-comment, octave-insert-defun):
* lisp/progmodes/inf-lisp.el (lisp-symprompt):
* lisp/progmodes/cperl-mode.el (cperl-info-on-command)
(cperl-perldoc):
* lisp/progmodes/compile.el (compilation-find-file):
* lisp/net/rcirc.el (rcirc-prompt-for-encryption):
* lisp/net/eww.el (eww):
* lisp/net/browse-url.el (browse-url-with-browser-kind):
* lisp/man.el (man):
* lisp/mail/sendmail.el (sendmail-query-user-about-smtp):
* lisp/mail/mailalias.el (build-mail-aliases):
* lisp/mail/mailabbrev.el (merge-mail-abbrevs)
(rebuild-mail-abbrevs):
* lisp/locate.el (locate-prompt-for-search-string):
* lisp/isearch.el (isearch-occur):
* lisp/international/ogonek.el (ogonek-read-encoding)
(ogonek-read-prefix):
* lisp/international/mule.el (read-buffer-file-coding-system)
(set-terminal-coding-system, set-keyboard-coding-system)
(set-next-selection-coding-system, recode-region):
* lisp/international/mule-cmds.el ()
(universal-coding-system-argument, search-unencodable-char)
(select-safe-coding-system-interactively):
* lisp/info.el (Info-search, Info-search-backward, Info-menu):
* lisp/info-look.el (info-lookup-interactive-arguments):
* lisp/imenu.el (imenu--completion-buffer):
* lisp/ibuf-ext.el (mode, used-mode, ibuffer-mark-by-mode):
* lisp/hi-lock.el (hi-lock-unface-buffer)
(hi-lock-read-face-name):
* lisp/help.el (view-emacs-news, where-is):
* lisp/help-fns.el (describe-variable, describe-symbol)
(describe-keymap):
* lisp/gnus/mm-decode.el (mm-save-part):
* lisp/gnus/gnus-sum.el (gnus-summary-browse-url):
* lisp/gnus/gnus-group.el (gnus-group--read-bug-ids)
(gnus-group-set-current-level):
* lisp/frame.el (make-frame-on-monitor)
(close-display-connection, select-frame-by-name):
* lisp/format.el (format-encode-buffer, format-encode-region):
* lisp/files.el (recode-file-name):
* lisp/files-x.el (read-file-local-variable)
(read-file-local-variable-value, )
(read-file-local-variable-mode):
* lisp/ffap.el (ffap-menu-ask):
* lisp/faces.el (face-read-string):
* lisp/facemenu.el (facemenu-set-charset):
* lisp/erc/erc-dcc.el (erc-dcc-do-GET-command):
* lisp/emulation/edt-mapper.el (edt-mapper):
* lisp/emacs-lisp/trace.el (trace--read-args)
(trace-function-foreground, trace-function-background):
* lisp/emacs-lisp/smie.el (smie-config-set-indent):
* lisp/emacs-lisp/re-builder.el (reb-change-syntax):
* lisp/emacs-lisp/package.el (describe-package):
* lisp/emacs-lisp/find-func.el (read-library-name)
(find-function-read):
* lisp/emacs-lisp/ert.el (ert-read-test-name)
(ert-run-tests-interactively):
* lisp/emacs-lisp/disass.el (disassemble):
* lisp/emacs-lisp/debug.el (debug-on-entry)
(debug-on-variable-change):
* lisp/emacs-lisp/advice.el (ad-read-advised-function)
(ad-read-advice-class, ad-read-advice-name, ad-read-regexp):
* lisp/dired-x.el (dired--mark-suffix-interactive-spec):
* lisp/dired-aux.el (dired-diff):
* lisp/cus-edit.el (custom-variable-prompt, customize-mode)
(customize-changed-options):
* lisp/completion.el (interactive-completion-string-reader):
* lisp/calendar/timeclock.el (timeclock-ask-for-project):
* lisp/calc/calcalg3.el (calc-get-fit-variables):
* lisp/calc/calc-store.el (calc-edit-variable):
* lisp/calc/calc-bin.el (calc-word-size):
* lisp/bookmark.el (bookmark-set-internal):
* lisp/abbrev.el (read-abbrev-file): Use `format-prompt' for
prompting (bug#12443).
2020-09-06 14:56:44 +00:00
|
|
|
|
(format-prompt "Make frame on monitor" default)
|
2019-03-27 21:46:39 +00:00
|
|
|
|
(or (delq nil (mapcar (lambda (a)
|
|
|
|
|
(cdr (assq 'name a)))
|
|
|
|
|
(display-monitor-attributes-list)))
|
|
|
|
|
'(""))
|
|
|
|
|
nil nil nil nil default))))
|
2019-03-19 21:32:48 +00:00
|
|
|
|
(let* ((monitor-workarea
|
|
|
|
|
(catch 'done
|
|
|
|
|
(dolist (a (display-monitor-attributes-list display))
|
|
|
|
|
(when (equal (cdr (assq 'name a)) monitor)
|
|
|
|
|
(throw 'done (cdr (assq 'workarea a)))))))
|
|
|
|
|
(geometry-parameters
|
|
|
|
|
(when monitor-workarea
|
|
|
|
|
`((top . ,(nth 1 monitor-workarea))
|
|
|
|
|
(left . ,(nth 0 monitor-workarea))))))
|
|
|
|
|
(make-frame (append geometry-parameters parameters))))
|
2019-02-25 21:11:34 +00:00
|
|
|
|
|
2008-06-12 03:56:20 +00:00
|
|
|
|
(declare-function x-close-connection "xfns.c" (terminal))
|
|
|
|
|
|
2007-07-25 19:37:21 +00:00
|
|
|
|
(defun close-display-connection (display)
|
|
|
|
|
"Close the connection to a display, deleting all its associated frames.
|
|
|
|
|
For DISPLAY, specify either a frame or a display name (a string).
|
|
|
|
|
If DISPLAY is nil, that stands for the selected frame's display."
|
|
|
|
|
(interactive
|
|
|
|
|
(list
|
|
|
|
|
(let* ((default (frame-parameter nil 'display))
|
|
|
|
|
(display (completing-read
|
Use `format-prompt' when prompting with default values
* lisp/woman.el (woman-file-name):
* lisp/wid-edit.el (widget-file-prompt-value)
(widget-coding-system-prompt-value):
* lisp/w32-fns.el (w32-set-system-coding-system):
* lisp/vc/vc.el (vc-print-root-log):
* lisp/vc/vc-annotate.el (vc-annotate):
* lisp/vc/emerge.el (emerge-read-file-name):
* lisp/vc/ediff.el (ediff-directories)
(ediff-directory-revisions, ediff-directories3)
(ediff-merge-directories, )
(ediff-merge-directories-with-ancestor)
(ediff-merge-directory-revisions)
(ediff-merge-directory-revisions-with-ancestor)
(ediff-merge-revisions, ediff-merge-revisions-with-ancestor)
(ediff-revision):
* lisp/vc/ediff-util.el (ediff-toggle-regexp-match):
* lisp/vc/ediff-mult.el (ediff-filegroup-action):
* lisp/vc/add-log.el (prompt-for-change-log-name):
* lisp/textmodes/table.el (table-insert-row-column)
(table-span-cell, table-split-cell-horizontally)
(table-split-cell, table-justify, table-generate-source)
(table-insert-sequence, table-capture)
(table--read-from-minibuffer, table--query-justification):
* lisp/textmodes/sgml-mode.el (sgml-tag, sgml-tag-help):
* lisp/textmodes/reftex-ref.el (reftex-goto-label):
* lisp/textmodes/refer.el (refer-get-bib-files):
* lisp/textmodes/css-mode.el (css-lookup-symbol):
* lisp/term.el (serial-read-name, serial-read-speed):
* lisp/speedbar.el (speedbar-change-initial-expansion-list):
* lisp/simple.el (previous-matching-history-element)
(set-variable):
* lisp/ses.el (ses-read-cell, ses-set-column-width):
* lisp/replace.el (query-replace-read-from)
(occur-read-primary-args):
* lisp/rect.el (string-rectangle, string-insert-rectangle):
* lisp/progmodes/tcl.el (tcl-help-on-word):
* lisp/progmodes/sh-script.el (sh-set-shell):
* lisp/progmodes/python.el (python-eldoc-at-point):
* lisp/progmodes/octave.el (octave-completing-read)
(octave-update-function-file-comment, octave-insert-defun):
* lisp/progmodes/inf-lisp.el (lisp-symprompt):
* lisp/progmodes/cperl-mode.el (cperl-info-on-command)
(cperl-perldoc):
* lisp/progmodes/compile.el (compilation-find-file):
* lisp/net/rcirc.el (rcirc-prompt-for-encryption):
* lisp/net/eww.el (eww):
* lisp/net/browse-url.el (browse-url-with-browser-kind):
* lisp/man.el (man):
* lisp/mail/sendmail.el (sendmail-query-user-about-smtp):
* lisp/mail/mailalias.el (build-mail-aliases):
* lisp/mail/mailabbrev.el (merge-mail-abbrevs)
(rebuild-mail-abbrevs):
* lisp/locate.el (locate-prompt-for-search-string):
* lisp/isearch.el (isearch-occur):
* lisp/international/ogonek.el (ogonek-read-encoding)
(ogonek-read-prefix):
* lisp/international/mule.el (read-buffer-file-coding-system)
(set-terminal-coding-system, set-keyboard-coding-system)
(set-next-selection-coding-system, recode-region):
* lisp/international/mule-cmds.el ()
(universal-coding-system-argument, search-unencodable-char)
(select-safe-coding-system-interactively):
* lisp/info.el (Info-search, Info-search-backward, Info-menu):
* lisp/info-look.el (info-lookup-interactive-arguments):
* lisp/imenu.el (imenu--completion-buffer):
* lisp/ibuf-ext.el (mode, used-mode, ibuffer-mark-by-mode):
* lisp/hi-lock.el (hi-lock-unface-buffer)
(hi-lock-read-face-name):
* lisp/help.el (view-emacs-news, where-is):
* lisp/help-fns.el (describe-variable, describe-symbol)
(describe-keymap):
* lisp/gnus/mm-decode.el (mm-save-part):
* lisp/gnus/gnus-sum.el (gnus-summary-browse-url):
* lisp/gnus/gnus-group.el (gnus-group--read-bug-ids)
(gnus-group-set-current-level):
* lisp/frame.el (make-frame-on-monitor)
(close-display-connection, select-frame-by-name):
* lisp/format.el (format-encode-buffer, format-encode-region):
* lisp/files.el (recode-file-name):
* lisp/files-x.el (read-file-local-variable)
(read-file-local-variable-value, )
(read-file-local-variable-mode):
* lisp/ffap.el (ffap-menu-ask):
* lisp/faces.el (face-read-string):
* lisp/facemenu.el (facemenu-set-charset):
* lisp/erc/erc-dcc.el (erc-dcc-do-GET-command):
* lisp/emulation/edt-mapper.el (edt-mapper):
* lisp/emacs-lisp/trace.el (trace--read-args)
(trace-function-foreground, trace-function-background):
* lisp/emacs-lisp/smie.el (smie-config-set-indent):
* lisp/emacs-lisp/re-builder.el (reb-change-syntax):
* lisp/emacs-lisp/package.el (describe-package):
* lisp/emacs-lisp/find-func.el (read-library-name)
(find-function-read):
* lisp/emacs-lisp/ert.el (ert-read-test-name)
(ert-run-tests-interactively):
* lisp/emacs-lisp/disass.el (disassemble):
* lisp/emacs-lisp/debug.el (debug-on-entry)
(debug-on-variable-change):
* lisp/emacs-lisp/advice.el (ad-read-advised-function)
(ad-read-advice-class, ad-read-advice-name, ad-read-regexp):
* lisp/dired-x.el (dired--mark-suffix-interactive-spec):
* lisp/dired-aux.el (dired-diff):
* lisp/cus-edit.el (custom-variable-prompt, customize-mode)
(customize-changed-options):
* lisp/completion.el (interactive-completion-string-reader):
* lisp/calendar/timeclock.el (timeclock-ask-for-project):
* lisp/calc/calcalg3.el (calc-get-fit-variables):
* lisp/calc/calc-store.el (calc-edit-variable):
* lisp/calc/calc-bin.el (calc-word-size):
* lisp/bookmark.el (bookmark-set-internal):
* lisp/abbrev.el (read-abbrev-file): Use `format-prompt' for
prompting (bug#12443).
2020-09-06 14:56:44 +00:00
|
|
|
|
(format-prompt "Close display" default)
|
2007-07-25 19:37:21 +00:00
|
|
|
|
(delete-dups
|
|
|
|
|
(mapcar (lambda (frame)
|
|
|
|
|
(frame-parameter frame 'display))
|
|
|
|
|
(frame-list)))
|
|
|
|
|
nil t nil nil
|
|
|
|
|
default)))
|
|
|
|
|
(if (zerop (length display)) default display))))
|
|
|
|
|
(let ((frames (delq nil
|
|
|
|
|
(mapcar (lambda (frame)
|
|
|
|
|
(if (equal display
|
|
|
|
|
(frame-parameter frame 'display))
|
|
|
|
|
frame))
|
|
|
|
|
(frame-list)))))
|
|
|
|
|
(if (and (consp frames)
|
|
|
|
|
(not (y-or-n-p (if (cdr frames)
|
|
|
|
|
(format "Delete %s frames? " (length frames))
|
|
|
|
|
(format "Delete %s ? " (car frames))))))
|
|
|
|
|
(error "Abort!")
|
2021-04-12 16:32:07 +00:00
|
|
|
|
(mapc #'delete-frame frames)
|
2007-07-25 19:37:21 +00:00
|
|
|
|
(x-close-connection display))))
|
|
|
|
|
|
1996-06-07 14:52:28 +00:00
|
|
|
|
(defun make-frame-command ()
|
2008-10-22 21:09:48 +00:00
|
|
|
|
"Make a new frame, on the same terminal as the selected frame.
|
|
|
|
|
If the terminal is a text-only terminal, this also selects the
|
2019-03-08 09:45:55 +00:00
|
|
|
|
new frame.
|
|
|
|
|
|
|
|
|
|
When called from Lisp, returns the new frame."
|
1996-06-07 14:52:28 +00:00
|
|
|
|
(interactive)
|
2008-10-22 21:09:48 +00:00
|
|
|
|
(if (display-graphic-p)
|
1996-06-07 14:52:28 +00:00
|
|
|
|
(make-frame)
|
|
|
|
|
(select-frame (make-frame))))
|
|
|
|
|
|
2021-10-06 16:38:09 +00:00
|
|
|
|
(defun clone-frame (&optional frame no-windows)
|
|
|
|
|
"Make a new frame with the same parameters and windows as FRAME.
|
|
|
|
|
With a prefix arg NO-WINDOWS, don't clone the window configuration.
|
2021-09-01 09:42:48 +00:00
|
|
|
|
|
|
|
|
|
FRAME defaults to the selected frame. The frame is created on the
|
|
|
|
|
same terminal as FRAME. If the terminal is a text-only terminal then
|
|
|
|
|
also select the new frame."
|
2021-10-06 16:38:09 +00:00
|
|
|
|
(interactive (list (selected-frame) current-prefix-arg))
|
|
|
|
|
(let* ((frame (or frame (selected-frame)))
|
|
|
|
|
(windows (unless no-windows
|
|
|
|
|
(window-state-get (frame-root-window frame))))
|
|
|
|
|
(default-frame-alist
|
|
|
|
|
(seq-remove (lambda (elem) (eq (car elem) 'name))
|
|
|
|
|
(frame-parameters frame)))
|
|
|
|
|
(new-frame (make-frame)))
|
|
|
|
|
(when windows
|
|
|
|
|
(window-state-put windows (frame-root-window new-frame) 'safe))
|
|
|
|
|
(unless (display-graphic-p)
|
|
|
|
|
(select-frame new-frame))
|
|
|
|
|
new-frame))
|
2021-09-01 09:42:48 +00:00
|
|
|
|
|
1997-03-15 13:23:49 +00:00
|
|
|
|
(defvar before-make-frame-hook nil
|
2021-12-05 20:14:26 +00:00
|
|
|
|
"Functions to run before `make-frame' creates a new frame.")
|
1997-03-15 13:23:49 +00:00
|
|
|
|
|
|
|
|
|
(defvar after-make-frame-functions nil
|
2017-09-25 08:09:32 +00:00
|
|
|
|
"Functions to run after `make-frame' created a new frame.
|
|
|
|
|
The functions are run with one argument, the newly created
|
2021-12-05 20:14:26 +00:00
|
|
|
|
frame.")
|
1997-03-15 13:23:49 +00:00
|
|
|
|
|
2000-11-03 22:15:51 +00:00
|
|
|
|
(defvar after-setting-font-hook nil
|
1999-07-21 21:43:03 +00:00
|
|
|
|
"Functions to run after a frame's font has been changed.")
|
|
|
|
|
|
2007-10-10 20:44:34 +00:00
|
|
|
|
(defvar frame-inherited-parameters '()
|
2017-09-25 08:09:32 +00:00
|
|
|
|
"Parameters `make-frame' copies from the selected to the new frame.")
|
2007-10-10 20:18:45 +00:00
|
|
|
|
|
2013-09-18 03:58:26 +00:00
|
|
|
|
(defvar x-display-name)
|
|
|
|
|
|
1997-03-15 13:23:49 +00:00
|
|
|
|
(defun make-frame (&optional parameters)
|
|
|
|
|
"Return a newly created frame displaying the current buffer.
|
2010-07-01 00:14:17 +00:00
|
|
|
|
Optional argument PARAMETERS is an alist of frame parameters for
|
|
|
|
|
the new frame. Each element of PARAMETERS should have the
|
|
|
|
|
form (NAME . VALUE), for example:
|
1995-01-28 00:32:33 +00:00
|
|
|
|
|
1997-03-15 13:23:49 +00:00
|
|
|
|
(name . STRING) The frame should be named STRING.
|
1992-02-10 05:20:54 +00:00
|
|
|
|
|
1997-03-15 13:23:49 +00:00
|
|
|
|
(width . NUMBER) The frame should be NUMBER characters in width.
|
|
|
|
|
(height . NUMBER) The frame should be NUMBER text lines high.
|
1992-02-10 05:20:54 +00:00
|
|
|
|
|
1997-03-15 13:23:49 +00:00
|
|
|
|
(minibuffer . t) The frame should have a minibuffer.
|
|
|
|
|
(minibuffer . nil) The frame should have no minibuffer.
|
|
|
|
|
(minibuffer . only) The frame should contain only a minibuffer.
|
|
|
|
|
(minibuffer . WINDOW) The frame should use WINDOW as its minibuffer window.
|
1992-02-10 05:20:54 +00:00
|
|
|
|
|
2004-01-11 21:59:40 +00:00
|
|
|
|
(window-system . nil) The frame should be displayed on a terminal device.
|
|
|
|
|
(window-system . x) The frame should be displayed in an X window.
|
|
|
|
|
|
2012-09-17 11:55:05 +00:00
|
|
|
|
(display . \":0\") The frame should appear on display :0.
|
|
|
|
|
|
2009-04-04 14:44:10 +00:00
|
|
|
|
(terminal . TERMINAL) The frame should use the terminal object TERMINAL.
|
Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
* lisp/frame.el (make-frame-on-display): Update doc.
(make-frame): Handle display-id parameter. Update doc.
(frames-on-display-list): Update for display ids.
(framep-on-display): Ditto.
(suspend-frame): Use display-name, not frame-tty-name.
(selected-display): New function.
* lisp/server.el (server-delete-client): Use delete-display, not delete-tty.
(server-tty-live-p, server-handle-delete-tty): Removed.
(server-handle-delete-frame): Delete tty clients, if needed.
(server-process-filter): Set the display parameter, and use it when appropriate.
(server-handle-suspend-tty): Use the display parameter.
(server-start, server-unload-hook): Removed obsolete delete-tty hook.
* lisp/talk.el (talk): Always use talk-add-display.
(talk-add-tty-frame, talk-handle-delete-tty): Removed.
(talk-handle-delete-frame): New function.
(talk-add-display): Open a new frame only if parameter was not a frame.
* src/dispextern.h (get_display, Fdisplay_tty_type): New prototypes.
(Fframe_tty_type): Removed.
* src/dispnew.c (init_display): Use Fdisplay_tty_type, not Fframe_tty_type.
* src/frame.c (Qdisplay_id, Qdisplay_live_p): New symbols.
(make_terminal_frame): Get display as a parameter.
(Fmake_terminal_frame): Get/create display here; pass it to
make_terminal_frame.
(Fframe_display): New function.
(Fdelete_frame): Stop if the hook deleted the frame.
(syms_of_frame): Register new stuff.
* src/frame.h (Qdisplay_id, Qdisplay_live_p, make_terminal_frame):
Updated prototypes.
* src/keyboard.c (interrupt_signal): Updated comment.
* src/term.c (Vdelete_tty_after_functions): Removed variable.
(Qframe_tty_name, Qframe_tty_type): Removed.
(next_display_id): New var.
(tty_ring_bell): Don't do anything on suspended frames.
(Ftty_display_color_p, Ftty_display_color_cells): Doc update.
(get_display): New function.
(get_tty_display): Use it.
(get_named_tty_display): Ignore suspended displays.
(Fframe_tty_name): Renamed to Fdisplay_name. Handle all kinds of
displays.
(Fframe_tty_type): Renamed to Fdisplay_tty_type.
(init_initial_display): Set display name.
(term_init): Allow more displays on the same device. Set display name.
(Fdelete_tty): Removed.
(delete_tty): Don't run hooks.
(create_display): Set display id.
(delete_display): Free display name.
(Fdelete_display, Fdisplay_live_p, Fdisplay_list): New functions.
(Fsuspend_tty): Call hook with display id. Doc update.
(Fresume_tty): Refuse to resume when there is already an active display
on the same device. Call hook with display id. Doc update.
(syms_of_term): Reflect above changes.
* src/termhooks.h (struct display): Added `id' and `name' members.
(DISPLAY_ACTIVE_P): New macro.
* src/xfns.c (check_x_display_info): Handle display ids.
(Fx_create_frame): Try to get display from `display-id' parameter.
* src/xterm.c (x_term_init): Set display name.
(x_delete_display): Handle the case when `font_table' is NULL.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-207
2004-07-04 04:48:55 +00:00
|
|
|
|
|
2010-07-01 00:14:17 +00:00
|
|
|
|
In addition, any parameter specified in `default-frame-alist',
|
|
|
|
|
but not present in PARAMETERS, is applied.
|
2004-07-24 21:45:28 +00:00
|
|
|
|
|
2017-09-25 08:09:32 +00:00
|
|
|
|
Before creating the frame (via `frame-creation-function'), this
|
|
|
|
|
function runs the hook `before-make-frame-hook'. After creating
|
|
|
|
|
the frame, it runs the hook `after-make-frame-functions' with one
|
|
|
|
|
argument, the newly created frame.
|
2010-07-01 00:14:17 +00:00
|
|
|
|
|
2012-09-17 11:55:05 +00:00
|
|
|
|
If a display parameter is supplied and a window-system is not,
|
|
|
|
|
guess the window-system from the display.
|
|
|
|
|
|
2010-07-01 00:14:17 +00:00
|
|
|
|
On graphical displays, this function does not itself make the new
|
|
|
|
|
frame the selected frame. However, the window system may select
|
|
|
|
|
the new frame according to its own rules."
|
1991-08-15 21:29:06 +00:00
|
|
|
|
(interactive)
|
2012-09-17 11:55:05 +00:00
|
|
|
|
(let* ((display (cdr (assq 'display parameters)))
|
Get rid of backend-dependent selection-handling functions for kill/yank
and make it generic instead by relying on the lower-level selection
management functions.
* select.el (select-enable-clipboard): Rename from
gui-select-enable-clipboard.
(select-enable-primary): Move from x-win.el and rename from
x-select-enable-primary.
(gui-last-selected-text): Remove.
(gui--last-selected-text-clipboard, gui--last-selected-text-primary):
New vars.
(gui-select-text): Rewrite, based on x-win.el's old x-select-text.
(gui-select-text-alist, gui-selection-value-alist): Remove.
(x-select-request-type): Move from x-win.el.
(gui--selection-value-internal): New function, taken from x-win's
x-selection-value-internal.
(gui-selection-value): Rewrite, based on x-win.el's old x-selection-value.
(gui-set-selection-alist): Rename from gui-own-selection-alist and
extend it to handle a nil value as a "disown" request.
(gui-disown-selection-alist): Remove.
(xselect-convert-to-delete): Adjust accordingly.
(gui-set-selection): Simplify accordingly as well. Use dotimes.
* lisp/frame.el (gui-method): Use window-system rather than framep.
(gui-method-declare): The tty case is now nil rather than t.
(make-frame): Adjust accordingly.
* lisp/term/x-win.el (x-last-selected-text-primary)
(x-select-enable-primary): Remove (moved to select.el).
(x-select-request-type): Move to select.el.
(x-selection-value-internal, x--selection-value): Remove functions.
(gui-selection-value, gui-select-text): Remove moethods.
(gui-set-selection): Merge own and disown methods.
* lisp/startup.el (command-line): Adjust now that `gui-method' expects nil
for ttys.
* lisp/term/ns-win.el (ns-get-pasteboard, ns-set-pasteboard)
(ns-selection-value): Remove functions.
(gui-select-text, gui-selection-value): Don't define method any more.
(gui-set-selection): Merge the old own and disown methods.
(gui-selection-exists-p, gui-get-selection): Adjust to new name of
underlying C primitive.
* lisp/term/pc-win.el (w16-get-selection-value): Add dummy argument and drop
test of gui-select-enable-clipboard, to make it usable as
a gui-get-selection method.
(gui-selection-exists-p): Adjust to new name of C primitive.
(gui-set-selection): Merge own and disown methods.
(gui-select-text, gui-selection-value): Delete methods.
(w16--select-text): Delete function.
* lisp/term/w32-win.el (w32--select-text, w32--get-selection-value):
Delete function (move functionality into w32--set-selection and
w32--get-selection).
(gui-select-text, gui-selection-value): Don't define methods.
(w32--set-selection, w32--get-selection, w32--selection-owner-p):
New functions.
(gui-get-selection, gui-selection-owner-p, gui-selection-exists-p):
Use them.
(gui-selection-exists-p): Adjust to new name of C primitive.
* src/nsselect.m (ns_get_local_selection): Signal error rather than `quit'.
(Fns_own_selection_internal): Tighten scoping.
(Fns_selection_exists_p): Rename from Fx_selection_exists_p.
(Fns_get_selection): Rename from Fx_get_selection_internal.
(Fns_get_selection_internal, Fns_store_selection_internal):
Remove functions.
(syms_of_nsselect): Adjust accordingly.
* src/w16select.c (Fw16_selection_exists_p): Rename from
Fx_selection_exists_p.
(syms_of_win16select): Adjust accordingly.
* src/w32select.c (Fw32_selection_exists_p): Rename from
Fx_selection_exists_p.
(syms_of_w32select): Adjust accordingly.
2014-10-21 15:27:18 +00:00
|
|
|
|
(w (cond
|
|
|
|
|
((assq 'terminal parameters)
|
|
|
|
|
(let ((type (terminal-live-p
|
|
|
|
|
(cdr (assq 'terminal parameters)))))
|
|
|
|
|
(cond
|
|
|
|
|
((eq t type) nil)
|
|
|
|
|
((null type) (error "Terminal %s does not exist"
|
|
|
|
|
(cdr (assq 'terminal parameters))))
|
|
|
|
|
(t type))))
|
|
|
|
|
((assq 'window-system parameters)
|
|
|
|
|
(cdr (assq 'window-system parameters)))
|
|
|
|
|
(display
|
|
|
|
|
(or (window-system-for-display display)
|
|
|
|
|
(error "Don't know how to interpret display %S"
|
|
|
|
|
display)))
|
|
|
|
|
(t window-system)))
|
2005-12-29 04:31:04 +00:00
|
|
|
|
(oldframe (selected-frame))
|
2010-07-01 00:14:17 +00:00
|
|
|
|
(params parameters)
|
2019-03-05 09:46:19 +00:00
|
|
|
|
frame child-frame)
|
2012-09-17 11:55:05 +00:00
|
|
|
|
|
|
|
|
|
(unless (get w 'window-system-initialized)
|
Replace gui-method macros with cl-generic with &context
* lisp/frame.el (gui-method--name, gui-method, gui-method-define)
(gui-method-declare, gui-call): Remove.
(frame-creation-function): Use cl-defgeneric.
(make-frame): Adjust callers.
* lisp/menu-bar.el (menu-bar-edit-menu):
Use gui-backend-selection-exists-p.
* lisp/select.el (x-get-clipboard): Use gui-backend-get-selection.
(gui-backend-get-selection): New cl-generic to replace
gui-get-selection method.
(gui-backend-set-selection): New cl-generic to replace
gui-set-selection method.
(gui-selection-owner-p): New cl-generic to replace
gui-selection-owner-p method.
(gui-backend-selection-exists-p): New cl-generic to replace
gui-selection-exists-p method. Adjust all callers.
* lisp/server.el (server-create-window-system-frame): Don't ignore
window-system spec even when unsupported.
* lisp/simple.el (deactivate-mark): Use new gui-backend-* functions.
* lisp/startup.el (handle-args-function, window-system-initialization):
Use cl-defgeneric.
(command-line): Adjust calls accordingly.
* lisp/term/ns-win.el (ns-window-system-initialization): Turn into
a window-system-initialization method.
(handle-args-function, frame-creation-function): Use cl-defmethod.
(gui-set-selection, gui-selection-owner-p, gui-selection-exists-p)
(gui-get-selection): Use cl-defmethod on the new functions instead.
* lisp/term/pc-win.el (w16-get-selection-value): Turn into
a gui-backend-get-selection method.
(gui-selection-exists-p, gui-selection-owner-p, gui-set-selection):
Use cl-defmethod on the new functions instead.
(msdos-window-system-initialization): Turn into
a window-system-initialization method.
(frame-creation-function, handle-args-function): Use cl-defmethod.
* lisp/term/w32-win.el (w32-window-system-initialization): Turn into
a window-system-initialization method.
(handle-args-function, frame-creation-function): Use cl-defmethod.
(gui-set-selection, gui-selection-owner-p, gui-selection-exists-p)
(gui-get-selection): Use cl-defmethod on the new functions instead.
* lisp/term/x-win.el (x-window-system-initialization): Turn into
a window-system-initialization method.
(handle-args-function, frame-creation-function): Use cl-defmethod.
(gui-set-selection, gui-selection-owner-p, gui-selection-exists-p)
(gui-get-selection): Use cl-defmethod on the new functions instead.
* lisp/term/xterm.el (xterm--set-selection): Turn into
a gui-backend-set-selection method.
* src/nsselect.m (Fns_selection_exists_p): Remove unused arg `terminal'.
(Fns_selection_owner_p): Remove unused arg `terminal'.
(Fns_get_selection): Remove unused args `time_stamp' and `terminal'.
2015-05-23 15:32:29 +00:00
|
|
|
|
(let ((window-system w)) ;Hack attack!
|
|
|
|
|
(window-system-initialization display))
|
2013-04-06 14:06:39 +00:00
|
|
|
|
(setq x-display-name display)
|
2012-09-17 11:55:05 +00:00
|
|
|
|
(put w 'window-system-initialized t))
|
|
|
|
|
|
2010-07-01 00:14:17 +00:00
|
|
|
|
;; Add parameters from `window-system-default-frame-alist'.
|
|
|
|
|
(dolist (p (cdr (assq w window-system-default-frame-alist)))
|
2010-07-13 17:02:27 +00:00
|
|
|
|
(unless (assq (car p) params)
|
2010-07-01 00:14:17 +00:00
|
|
|
|
(push p params)))
|
|
|
|
|
;; Add parameters from `default-frame-alist'.
|
|
|
|
|
(dolist (p default-frame-alist)
|
2010-07-13 17:02:27 +00:00
|
|
|
|
(unless (assq (car p) params)
|
2010-07-01 00:14:17 +00:00
|
|
|
|
(push p params)))
|
2015-01-12 07:18:00 +00:00
|
|
|
|
|
Try to improve handling of fullwidth/-height frames.
* frame.el (frame-notice-user-settings): Update
`frame-size-history'.
(make-frame): Update `frame-size-history'. Call
`frame-after-make-frame'.
* faces.el (face-set-after-frame-default): Remove call to
frame-can-run-window-configuration-change-hook.
* frame.c (frame_size_history_add): New function.
(frame_inhibit_resize): Consider frame_inhibit_implied_resize
only after frame's after_make_frame slot is true. Inhibit
resizing fullwidth-/height frames in one direction only. Update
frame_size_history.
(adjust_frame_size): Call frame_size_history_add.
(make_frame): Initalize after_make_frame slot.
(Fmake_terminal_frame): Adjust adjust_frame_size call.
(Fcan_run_window_configuration_change_hook): Rename to
Fframe_after_make_frame. Set after_make_frame slot. Return
second argument.
(x_set_frame_parameters): Postpone handling fullscreen parameter
until after width and height parameters have been set. Apply
width and height changes only if can_x_set_window_size is true.
Update frame_size_history.
(Qadjust_frame_size_1, Qadjust_frame_size_2)
(Qadjust_frame_size_3, QEmacsFrameResize, Qframe_inhibit_resize)
(Qx_set_fullscreen, Qx_check_fullscreen, Qx_set_window_size_1)
(Qxg_frame_resized, Qxg_frame_set_char_size_1)
(Qxg_frame_set_char_size_2, Qxg_frame_set_char_size_3)
(Qxg_change_toolbar_position, Qx_net_wm_state)
(Qx_handle_net_wm_state, Qtb_size_cb, Qupdate_frame_tool_bar)
(Qfree_frame_tool_bar): New symbol for updating
frame_size_history.
(Qtip_frame, Qterminal_frame): New symbols.
(Vframe_adjust_size_history): Rename to frame_size_history.
* frame.h (struct frame): Rename
can_run_window_configuration_change_hook slot to
after_make_frame.
(frame_size_history_add): Extern.
* gtkutil.c (xg_frame_resized): Call frame_size_history_add.
Don't set FRAME_PIXEL_WIDTH and FRAME_PIXEL_HEIGHT here.
(xg_frame_set_char_size): Try to preserve the status of
fullwidth/-height frames. Call frame_size_history_add.
(tb_size_cb, update_frame_tool_bar, free_frame_tool_bar)
(xg_change_toolbar_position): Call frame_size_history_add.
* w32fns.c (x_change_tool_bar_height): Handle frame's fullscreen
status.
(Fx_create_frame): Process fullscreen parameter after frame has
been resized.
(x_create_tip_frame): Pass Qtip_frame to adjust_frame_size.
(Fx_frame_geometry): Don't pollute pure storage.
* w32term.c (w32_read_socket): For WM_WINDOWPOSCHANGED,
WM_ACTIVATE and WM_ACTIVATEAPP set frame's visibility before
calling w32fullscreen_hook. For WM_DISPLAYCHANGE call
w32fullscreen_hook immediately.
(x_fullscreen_adjust, x_check_fullscreen): Remove.
(w32fullscreen_hook): Call change_frame_size just as with a
"normal" frame resize operation. Call do_pending_window_change.
(x_set_window_size): Try to handle fullwidth and fullheight more
accurately. Don't rely on w32_enable_frame_resize_hack.
(w32_enable_frame_resize_hack): Remove variable.
* widget.c (EmacsFrameResize): Remove dead code. Call
frame_size_history_add
* window.c (run_window_configuration_change_hook): Check
f->after_make_frame instead of
f->can_run_window_configuration_change_hook.
* xfns.c (x_change_tool_bar_height): Handle frame's fullscreen status.
(Fx_create_frame): Process fullscreen parameter after frame has
been resized.
(Fx_frame_geometry): Don't pollute pure storage.
* xterm.c (x_net_wm_state, x_handle_net_wm_state): Call
frame_size_history_add.
(do_ewmh_fullscreen): Handle x_frame_normalize_before_maximize.
(x_check_fullscreen): Count in menubar when calling
XResizeWindow. Wait for ConfigureNotify event. Call
frame_size_history_add.
(x_set_window_size_1): Remove PIXELWISE argument. Try to handle
changing a fullheight frame's width or a fullwidth frame's
height. Call frame_size_history_add.
(x_set_window_size): Simplify xg_frame_set_char_size and
x_set_window_size_1 calls.
(x_frame_normalize_before_maximize): New variable.
2015-02-07 10:51:03 +00:00
|
|
|
|
;; (setq frame-size-history '(1000))
|
2015-01-12 07:18:00 +00:00
|
|
|
|
|
2019-03-05 09:46:19 +00:00
|
|
|
|
(when (eq (cdr (or (assq 'minibuffer params) '(minibuffer . t)))
|
|
|
|
|
'child-frame)
|
|
|
|
|
;; If the 'minibuffer' parameter equals 'child-frame' make a
|
|
|
|
|
;; frame without minibuffer first using the root window of
|
|
|
|
|
;; 'default-minibuffer-frame' as its minibuffer window
|
|
|
|
|
(setq child-frame t)
|
|
|
|
|
(setq params (cons '(minibuffer)
|
|
|
|
|
(delq (assq 'minibuffer params) params))))
|
|
|
|
|
|
|
|
|
|
;; Now make the frame.
|
|
|
|
|
(run-hooks 'before-make-frame-hook)
|
|
|
|
|
|
|
|
|
|
(setq frame (let ((window-system w)) ; Hack attack!
|
Replace gui-method macros with cl-generic with &context
* lisp/frame.el (gui-method--name, gui-method, gui-method-define)
(gui-method-declare, gui-call): Remove.
(frame-creation-function): Use cl-defgeneric.
(make-frame): Adjust callers.
* lisp/menu-bar.el (menu-bar-edit-menu):
Use gui-backend-selection-exists-p.
* lisp/select.el (x-get-clipboard): Use gui-backend-get-selection.
(gui-backend-get-selection): New cl-generic to replace
gui-get-selection method.
(gui-backend-set-selection): New cl-generic to replace
gui-set-selection method.
(gui-selection-owner-p): New cl-generic to replace
gui-selection-owner-p method.
(gui-backend-selection-exists-p): New cl-generic to replace
gui-selection-exists-p method. Adjust all callers.
* lisp/server.el (server-create-window-system-frame): Don't ignore
window-system spec even when unsupported.
* lisp/simple.el (deactivate-mark): Use new gui-backend-* functions.
* lisp/startup.el (handle-args-function, window-system-initialization):
Use cl-defgeneric.
(command-line): Adjust calls accordingly.
* lisp/term/ns-win.el (ns-window-system-initialization): Turn into
a window-system-initialization method.
(handle-args-function, frame-creation-function): Use cl-defmethod.
(gui-set-selection, gui-selection-owner-p, gui-selection-exists-p)
(gui-get-selection): Use cl-defmethod on the new functions instead.
* lisp/term/pc-win.el (w16-get-selection-value): Turn into
a gui-backend-get-selection method.
(gui-selection-exists-p, gui-selection-owner-p, gui-set-selection):
Use cl-defmethod on the new functions instead.
(msdos-window-system-initialization): Turn into
a window-system-initialization method.
(frame-creation-function, handle-args-function): Use cl-defmethod.
* lisp/term/w32-win.el (w32-window-system-initialization): Turn into
a window-system-initialization method.
(handle-args-function, frame-creation-function): Use cl-defmethod.
(gui-set-selection, gui-selection-owner-p, gui-selection-exists-p)
(gui-get-selection): Use cl-defmethod on the new functions instead.
* lisp/term/x-win.el (x-window-system-initialization): Turn into
a window-system-initialization method.
(handle-args-function, frame-creation-function): Use cl-defmethod.
(gui-set-selection, gui-selection-owner-p, gui-selection-exists-p)
(gui-get-selection): Use cl-defmethod on the new functions instead.
* lisp/term/xterm.el (xterm--set-selection): Turn into
a gui-backend-set-selection method.
* src/nsselect.m (Fns_selection_exists_p): Remove unused arg `terminal'.
(Fns_selection_owner_p): Remove unused arg `terminal'.
(Fns_get_selection): Remove unused args `time_stamp' and `terminal'.
2015-05-23 15:32:29 +00:00
|
|
|
|
(frame-creation-function params)))
|
2019-03-05 09:46:19 +00:00
|
|
|
|
|
|
|
|
|
(when child-frame
|
|
|
|
|
;; When we want to equip the new frame with a minibuffer-only
|
|
|
|
|
;; child frame, make that frame and reparent it immediately.
|
|
|
|
|
(setq child-frame
|
|
|
|
|
(make-frame
|
|
|
|
|
(append
|
|
|
|
|
`((display . ,display) (minibuffer . only)
|
|
|
|
|
(parent-frame . ,frame))
|
|
|
|
|
minibuffer-frame-alist)))
|
|
|
|
|
(when (frame-live-p child-frame)
|
|
|
|
|
;; Have the 'minibuffer' parameter of our new frame refer to
|
|
|
|
|
;; its child frame's root window.
|
|
|
|
|
(set-frame-parameter
|
|
|
|
|
frame 'minibuffer (frame-root-window child-frame))))
|
|
|
|
|
|
2005-10-23 22:11:22 +00:00
|
|
|
|
(normal-erase-is-backspace-setup-frame frame)
|
2019-03-05 09:46:19 +00:00
|
|
|
|
;; Inherit original frame's parameters unless they are overridden
|
|
|
|
|
;; by explicit parameters.
|
2007-10-10 20:18:45 +00:00
|
|
|
|
(dolist (param frame-inherited-parameters)
|
2019-03-05 09:46:19 +00:00
|
|
|
|
(unless (assq param parameters)
|
2007-10-10 20:18:45 +00:00
|
|
|
|
(let ((val (frame-parameter oldframe param)))
|
|
|
|
|
(when val (set-frame-parameter frame param val)))))
|
2015-01-12 07:18:00 +00:00
|
|
|
|
|
Try to improve handling of fullwidth/-height frames.
* frame.el (frame-notice-user-settings): Update
`frame-size-history'.
(make-frame): Update `frame-size-history'. Call
`frame-after-make-frame'.
* faces.el (face-set-after-frame-default): Remove call to
frame-can-run-window-configuration-change-hook.
* frame.c (frame_size_history_add): New function.
(frame_inhibit_resize): Consider frame_inhibit_implied_resize
only after frame's after_make_frame slot is true. Inhibit
resizing fullwidth-/height frames in one direction only. Update
frame_size_history.
(adjust_frame_size): Call frame_size_history_add.
(make_frame): Initalize after_make_frame slot.
(Fmake_terminal_frame): Adjust adjust_frame_size call.
(Fcan_run_window_configuration_change_hook): Rename to
Fframe_after_make_frame. Set after_make_frame slot. Return
second argument.
(x_set_frame_parameters): Postpone handling fullscreen parameter
until after width and height parameters have been set. Apply
width and height changes only if can_x_set_window_size is true.
Update frame_size_history.
(Qadjust_frame_size_1, Qadjust_frame_size_2)
(Qadjust_frame_size_3, QEmacsFrameResize, Qframe_inhibit_resize)
(Qx_set_fullscreen, Qx_check_fullscreen, Qx_set_window_size_1)
(Qxg_frame_resized, Qxg_frame_set_char_size_1)
(Qxg_frame_set_char_size_2, Qxg_frame_set_char_size_3)
(Qxg_change_toolbar_position, Qx_net_wm_state)
(Qx_handle_net_wm_state, Qtb_size_cb, Qupdate_frame_tool_bar)
(Qfree_frame_tool_bar): New symbol for updating
frame_size_history.
(Qtip_frame, Qterminal_frame): New symbols.
(Vframe_adjust_size_history): Rename to frame_size_history.
* frame.h (struct frame): Rename
can_run_window_configuration_change_hook slot to
after_make_frame.
(frame_size_history_add): Extern.
* gtkutil.c (xg_frame_resized): Call frame_size_history_add.
Don't set FRAME_PIXEL_WIDTH and FRAME_PIXEL_HEIGHT here.
(xg_frame_set_char_size): Try to preserve the status of
fullwidth/-height frames. Call frame_size_history_add.
(tb_size_cb, update_frame_tool_bar, free_frame_tool_bar)
(xg_change_toolbar_position): Call frame_size_history_add.
* w32fns.c (x_change_tool_bar_height): Handle frame's fullscreen
status.
(Fx_create_frame): Process fullscreen parameter after frame has
been resized.
(x_create_tip_frame): Pass Qtip_frame to adjust_frame_size.
(Fx_frame_geometry): Don't pollute pure storage.
* w32term.c (w32_read_socket): For WM_WINDOWPOSCHANGED,
WM_ACTIVATE and WM_ACTIVATEAPP set frame's visibility before
calling w32fullscreen_hook. For WM_DISPLAYCHANGE call
w32fullscreen_hook immediately.
(x_fullscreen_adjust, x_check_fullscreen): Remove.
(w32fullscreen_hook): Call change_frame_size just as with a
"normal" frame resize operation. Call do_pending_window_change.
(x_set_window_size): Try to handle fullwidth and fullheight more
accurately. Don't rely on w32_enable_frame_resize_hack.
(w32_enable_frame_resize_hack): Remove variable.
* widget.c (EmacsFrameResize): Remove dead code. Call
frame_size_history_add
* window.c (run_window_configuration_change_hook): Check
f->after_make_frame instead of
f->can_run_window_configuration_change_hook.
* xfns.c (x_change_tool_bar_height): Handle frame's fullscreen status.
(Fx_create_frame): Process fullscreen parameter after frame has
been resized.
(Fx_frame_geometry): Don't pollute pure storage.
* xterm.c (x_net_wm_state, x_handle_net_wm_state): Call
frame_size_history_add.
(do_ewmh_fullscreen): Handle x_frame_normalize_before_maximize.
(x_check_fullscreen): Count in menubar when calling
XResizeWindow. Wait for ConfigureNotify event. Call
frame_size_history_add.
(x_set_window_size_1): Remove PIXELWISE argument. Try to handle
changing a fullheight frame's width or a fullwidth frame's
height. Call frame_size_history_add.
(x_set_window_size): Simplify xg_frame_set_char_size and
x_set_window_size_1 calls.
(x_frame_normalize_before_maximize): New variable.
2015-02-07 10:51:03 +00:00
|
|
|
|
;; We can run `window-configuration-change-hook' for this frame now.
|
|
|
|
|
(frame-after-make-frame frame t)
|
1997-03-15 13:23:49 +00:00
|
|
|
|
(run-hook-with-args 'after-make-frame-functions frame)
|
|
|
|
|
frame))
|
1991-08-15 21:29:06 +00:00
|
|
|
|
|
* frame.el: Clean up initialization code.
(initial-frame-alist): Doc fix.
(minibuffer-frame-alist): New default value, with a reasonable height.
(filtered-frame-list, minibuffer-frame-list): New functions.
(frame-initialize): Use minibuffer-frame-list, instead of writing
it out.
(frame-notice-user-settings): Thoroughly rearranged.
Notice changes to default-frame-alist as well as initial-frame-alist.
Properly handle requests to make the initial frame into a
minibufferless or minibuffer-only frame.
Create a minibuffer-only frame if the initial frame should lack a
minibuffer and there are no other minibuffer frames created by the
user's initialization file.
Fix any frames using the initial frame as a surrogate minibuffer
frame.
Restore the current buffer after creating and deleting all these
frames.
* frame.el (set-default-font, set-frame-background,
set-frame-foreground, set-cursor-color, set-pointer-color,
set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Give these docstrings.
(set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Make these toggle or look at the prefix
argument, like minor modes.
* frame.el (set-vertical-bar): Use the proper parameter symbol.
(set-horizontal-bar): Signal an error indicating that horizontal
scrollbars are not implemented.
1993-02-14 14:29:30 +00:00
|
|
|
|
(defun filtered-frame-list (predicate)
|
|
|
|
|
"Return a list of all live frames which satisfy PREDICATE."
|
2000-09-07 11:39:07 +00:00
|
|
|
|
(let* ((frames (frame-list))
|
|
|
|
|
(list frames))
|
* frame.el: Clean up initialization code.
(initial-frame-alist): Doc fix.
(minibuffer-frame-alist): New default value, with a reasonable height.
(filtered-frame-list, minibuffer-frame-list): New functions.
(frame-initialize): Use minibuffer-frame-list, instead of writing
it out.
(frame-notice-user-settings): Thoroughly rearranged.
Notice changes to default-frame-alist as well as initial-frame-alist.
Properly handle requests to make the initial frame into a
minibufferless or minibuffer-only frame.
Create a minibuffer-only frame if the initial frame should lack a
minibuffer and there are no other minibuffer frames created by the
user's initialization file.
Fix any frames using the initial frame as a surrogate minibuffer
frame.
Restore the current buffer after creating and deleting all these
frames.
* frame.el (set-default-font, set-frame-background,
set-frame-foreground, set-cursor-color, set-pointer-color,
set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Give these docstrings.
(set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Make these toggle or look at the prefix
argument, like minor modes.
* frame.el (set-vertical-bar): Use the proper parameter symbol.
(set-horizontal-bar): Signal an error indicating that horizontal
scrollbars are not implemented.
1993-02-14 14:29:30 +00:00
|
|
|
|
(while (consp frames)
|
2000-09-07 11:39:07 +00:00
|
|
|
|
(unless (funcall predicate (car frames))
|
|
|
|
|
(setcar frames nil))
|
* frame.el: Clean up initialization code.
(initial-frame-alist): Doc fix.
(minibuffer-frame-alist): New default value, with a reasonable height.
(filtered-frame-list, minibuffer-frame-list): New functions.
(frame-initialize): Use minibuffer-frame-list, instead of writing
it out.
(frame-notice-user-settings): Thoroughly rearranged.
Notice changes to default-frame-alist as well as initial-frame-alist.
Properly handle requests to make the initial frame into a
minibufferless or minibuffer-only frame.
Create a minibuffer-only frame if the initial frame should lack a
minibuffer and there are no other minibuffer frames created by the
user's initialization file.
Fix any frames using the initial frame as a surrogate minibuffer
frame.
Restore the current buffer after creating and deleting all these
frames.
* frame.el (set-default-font, set-frame-background,
set-frame-foreground, set-cursor-color, set-pointer-color,
set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Give these docstrings.
(set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Make these toggle or look at the prefix
argument, like minor modes.
* frame.el (set-vertical-bar): Use the proper parameter symbol.
(set-horizontal-bar): Signal an error indicating that horizontal
scrollbars are not implemented.
1993-02-14 14:29:30 +00:00
|
|
|
|
(setq frames (cdr frames)))
|
2000-09-07 11:39:07 +00:00
|
|
|
|
(delq nil list)))
|
* frame.el: Clean up initialization code.
(initial-frame-alist): Doc fix.
(minibuffer-frame-alist): New default value, with a reasonable height.
(filtered-frame-list, minibuffer-frame-list): New functions.
(frame-initialize): Use minibuffer-frame-list, instead of writing
it out.
(frame-notice-user-settings): Thoroughly rearranged.
Notice changes to default-frame-alist as well as initial-frame-alist.
Properly handle requests to make the initial frame into a
minibufferless or minibuffer-only frame.
Create a minibuffer-only frame if the initial frame should lack a
minibuffer and there are no other minibuffer frames created by the
user's initialization file.
Fix any frames using the initial frame as a surrogate minibuffer
frame.
Restore the current buffer after creating and deleting all these
frames.
* frame.el (set-default-font, set-frame-background,
set-frame-foreground, set-cursor-color, set-pointer-color,
set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Give these docstrings.
(set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Make these toggle or look at the prefix
argument, like minor modes.
* frame.el (set-vertical-bar): Use the proper parameter symbol.
(set-horizontal-bar): Signal an error indicating that horizontal
scrollbars are not implemented.
1993-02-14 14:29:30 +00:00
|
|
|
|
|
|
|
|
|
(defun minibuffer-frame-list ()
|
|
|
|
|
"Return a list of all frames with their own minibuffers."
|
|
|
|
|
(filtered-frame-list
|
2007-07-25 19:37:21 +00:00
|
|
|
|
(lambda (frame)
|
|
|
|
|
(eq frame (window-frame (minibuffer-window frame))))))
|
* frame.el: Clean up initialization code.
(initial-frame-alist): Doc fix.
(minibuffer-frame-alist): New default value, with a reasonable height.
(filtered-frame-list, minibuffer-frame-list): New functions.
(frame-initialize): Use minibuffer-frame-list, instead of writing
it out.
(frame-notice-user-settings): Thoroughly rearranged.
Notice changes to default-frame-alist as well as initial-frame-alist.
Properly handle requests to make the initial frame into a
minibufferless or minibuffer-only frame.
Create a minibuffer-only frame if the initial frame should lack a
minibuffer and there are no other minibuffer frames created by the
user's initialization file.
Fix any frames using the initial frame as a surrogate minibuffer
frame.
Restore the current buffer after creating and deleting all these
frames.
* frame.el (set-default-font, set-frame-background,
set-frame-foreground, set-cursor-color, set-pointer-color,
set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Give these docstrings.
(set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Make these toggle or look at the prefix
argument, like minor modes.
* frame.el (set-vertical-bar): Use the proper parameter symbol.
(set-horizontal-bar): Signal an error indicating that horizontal
scrollbars are not implemented.
1993-02-14 14:29:30 +00:00
|
|
|
|
|
2007-09-20 21:57:23 +00:00
|
|
|
|
;; Used to be called `terminal-id' in termdev.el.
|
|
|
|
|
(defun get-device-terminal (device)
|
|
|
|
|
"Return the terminal corresponding to DEVICE.
|
|
|
|
|
DEVICE can be a terminal, a frame, nil (meaning the selected frame's terminal),
|
|
|
|
|
the name of an X display device (HOST.SERVER.SCREEN) or a tty device file."
|
|
|
|
|
(cond
|
|
|
|
|
((or (null device) (framep device))
|
|
|
|
|
(frame-terminal device))
|
|
|
|
|
((stringp device)
|
|
|
|
|
(let ((f (car (filtered-frame-list
|
|
|
|
|
(lambda (frame)
|
|
|
|
|
(or (equal (frame-parameter frame 'display) device)
|
|
|
|
|
(equal (frame-parameter frame 'tty) device)))))))
|
|
|
|
|
(or f (error "Display %s does not exist" device))
|
|
|
|
|
(frame-terminal f)))
|
|
|
|
|
((terminal-live-p device) device)
|
|
|
|
|
(t
|
Go back to grave quoting in source-code docstrings etc.
This reverts almost all my recent changes to use curved quotes
in docstrings and/or strings used for error diagnostics.
There are a few exceptions, e.g., Bahá’í proper names.
* admin/unidata/unidata-gen.el (unidata-gen-table):
* lisp/abbrev.el (expand-region-abbrevs):
* lisp/align.el (align-region):
* lisp/allout.el (allout-mode, allout-solicit-alternate-bullet)
(outlineify-sticky):
* lisp/apropos.el (apropos-library):
* lisp/bookmark.el (bookmark-default-annotation-text):
* lisp/button.el (button-category-symbol, button-put)
(make-text-button):
* lisp/calc/calc-aent.el (math-read-if, math-read-factor):
* lisp/calc/calc-embed.el (calc-do-embedded):
* lisp/calc/calc-ext.el (calc-user-function-list):
* lisp/calc/calc-graph.el (calc-graph-show-dumb):
* lisp/calc/calc-help.el (calc-describe-key)
(calc-describe-thing, calc-full-help):
* lisp/calc/calc-lang.el (calc-c-language)
(math-parse-fortran-vector-end, math-parse-tex-sum)
(math-parse-eqn-matrix, math-parse-eqn-prime)
(calc-yacas-language, calc-maxima-language, calc-giac-language)
(math-read-giac-subscr, math-read-math-subscr)
(math-read-big-rec, math-read-big-balance):
* lisp/calc/calc-misc.el (calc-help, report-calc-bug):
* lisp/calc/calc-mode.el (calc-auto-why, calc-save-modes)
(calc-auto-recompute):
* lisp/calc/calc-prog.el (calc-fix-token-name)
(calc-read-parse-table-part, calc-user-define-invocation)
(math-do-arg-check):
* lisp/calc/calc-store.el (calc-edit-variable):
* lisp/calc/calc-units.el (math-build-units-table-buffer):
* lisp/calc/calc-vec.el (math-read-brackets):
* lisp/calc/calc-yank.el (calc-edit-mode):
* lisp/calc/calc.el (calc, calc-do, calc-user-invocation):
* lisp/calendar/appt.el (appt-display-message):
* lisp/calendar/diary-lib.el (diary-check-diary-file)
(diary-mail-entries, diary-from-outlook):
* lisp/calendar/icalendar.el (icalendar-export-region)
(icalendar--convert-float-to-ical)
(icalendar--convert-date-to-ical)
(icalendar--convert-ical-to-diary)
(icalendar--convert-recurring-to-diary)
(icalendar--add-diary-entry):
* lisp/calendar/time-date.el (format-seconds):
* lisp/calendar/timeclock.el (timeclock-mode-line-display)
(timeclock-make-hours-explicit, timeclock-log-data):
* lisp/calendar/todo-mode.el (todo-prefix, todo-delete-category)
(todo-item-mark, todo-check-format)
(todo-insert-item--next-param, todo-edit-item--next-key)
(todo-mode):
* lisp/cedet/ede/pmake.el (ede-proj-makefile-insert-dist-rules):
* lisp/cedet/mode-local.el (describe-mode-local-overload)
(mode-local-print-binding, mode-local-describe-bindings-2):
* lisp/cedet/semantic/complete.el (semantic-displayor-show-request):
* lisp/cedet/srecode/srt-mode.el (srecode-macro-help):
* lisp/cus-start.el (standard):
* lisp/cus-theme.el (describe-theme-1):
* lisp/custom.el (custom-add-dependencies, custom-check-theme)
(custom--sort-vars-1, load-theme):
* lisp/descr-text.el (describe-text-properties-1, describe-char):
* lisp/dired-x.el (dired-do-run-mail):
* lisp/dired.el (dired-log):
* lisp/emacs-lisp/advice.el (ad-read-advised-function)
(ad-read-advice-class, ad-read-advice-name, ad-enable-advice)
(ad-disable-advice, ad-remove-advice, ad-set-argument)
(ad-set-arguments, ad--defalias-fset, ad-activate)
(ad-deactivate):
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand)
(byte-compile-unfold-lambda, byte-optimize-form-code-walker)
(byte-optimize-while, byte-optimize-apply):
* lisp/emacs-lisp/byte-run.el (defun, defsubst):
* lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode)
(byte-compile-log-file, byte-compile-format-warn)
(byte-compile-nogroup-warn, byte-compile-arglist-warn)
(byte-compile-cl-warn)
(byte-compile-warn-about-unresolved-functions)
(byte-compile-file, byte-compile--declare-var)
(byte-compile-file-form-defmumble, byte-compile-form)
(byte-compile-normal-call, byte-compile-check-variable)
(byte-compile-variable-ref, byte-compile-variable-set)
(byte-compile-subr-wrong-args, byte-compile-setq-default)
(byte-compile-negation-optimizer)
(byte-compile-condition-case--old)
(byte-compile-condition-case--new, byte-compile-save-excursion)
(byte-compile-defvar, byte-compile-autoload)
(byte-compile-lambda-form)
(byte-compile-make-variable-buffer-local, display-call-tree)
(batch-byte-compile):
* lisp/emacs-lisp/cconv.el (cconv-convert, cconv--analyze-use):
* lisp/emacs-lisp/chart.el (chart-space-usage):
* lisp/emacs-lisp/check-declare.el (check-declare-scan)
(check-declare-warn, check-declare-file)
(check-declare-directory):
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine)
(checkdoc-message-text-engine):
* lisp/emacs-lisp/cl-extra.el (cl-parse-integer)
(cl--describe-class):
* lisp/emacs-lisp/cl-generic.el (cl-defgeneric)
(cl--generic-describe, cl-generic-generalizers):
* lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause, cl-tagbody)
(cl-symbol-macrolet):
* lisp/emacs-lisp/cl.el (cl-unload-function, flet):
* lisp/emacs-lisp/copyright.el (copyright)
(copyright-update-directory):
* lisp/emacs-lisp/edebug.el (edebug-read-list):
* lisp/emacs-lisp/eieio-base.el (eieio-persistent-read):
* lisp/emacs-lisp/eieio-core.el (eieio--slot-override)
(eieio-oref):
* lisp/emacs-lisp/eieio-opt.el (eieio-help-constructor):
* lisp/emacs-lisp/eieio-speedbar.el:
(eieio-speedbar-child-make-tag-lines)
(eieio-speedbar-child-description):
* lisp/emacs-lisp/eieio.el (defclass, change-class):
* lisp/emacs-lisp/elint.el (elint-file, elint-get-top-forms)
(elint-init-form, elint-check-defalias-form)
(elint-check-let-form):
* lisp/emacs-lisp/ert.el (ert-get-test, ert-results-mode-menu)
(ert-results-pop-to-backtrace-for-test-at-point)
(ert-results-pop-to-messages-for-test-at-point)
(ert-results-pop-to-should-forms-for-test-at-point)
(ert-describe-test):
* lisp/emacs-lisp/find-func.el (find-function-search-for-symbol)
(find-function-library):
* lisp/emacs-lisp/generator.el (iter-yield):
* lisp/emacs-lisp/gv.el (gv-define-simple-setter):
* lisp/emacs-lisp/lisp-mnt.el (lm-verify):
* lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning):
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p):
* lisp/emacs-lisp/nadvice.el (advice--make-docstring)
(advice--make, define-advice):
* lisp/emacs-lisp/package-x.el (package-upload-file):
* lisp/emacs-lisp/package.el (package-version-join)
(package-disabled-p, package-activate-1, package-activate)
(package--download-one-archive)
(package--download-and-read-archives)
(package-compute-transaction, package-install-from-archive)
(package-install, package-install-selected-packages)
(package-delete, package-autoremove, describe-package-1)
(package-install-button-action, package-delete-button-action)
(package-menu-hide-package, package-menu--list-to-prompt)
(package-menu--perform-transaction)
(package-menu--find-and-notify-upgrades):
* lisp/emacs-lisp/pcase.el (pcase-exhaustive, pcase--u1):
* lisp/emacs-lisp/re-builder.el (reb-enter-subexp-mode):
* lisp/emacs-lisp/ring.el (ring-previous, ring-next):
* lisp/emacs-lisp/rx.el (rx-check, rx-anything)
(rx-check-any-string, rx-check-any, rx-check-not, rx-=)
(rx-repeat, rx-check-backref, rx-syntax, rx-check-category)
(rx-form):
* lisp/emacs-lisp/smie.el (smie-config-save):
* lisp/emacs-lisp/subr-x.el (internal--check-binding):
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-put-tag):
* lisp/emacs-lisp/testcover.el (testcover-1value):
* lisp/emacs-lisp/timer.el (timer-event-handler):
* lisp/emulation/viper-cmd.el (viper-toggle-parse-sexp-ignore-comments)
(viper-toggle-search-style, viper-kill-buffer)
(viper-brac-function):
* lisp/emulation/viper-macs.el (viper-record-kbd-macro):
* lisp/env.el (setenv):
* lisp/erc/erc-button.el (erc-nick-popup):
* lisp/erc/erc.el (erc-cmd-LOAD, erc-handle-login, english):
* lisp/eshell/em-dirs.el (eshell/cd):
* lisp/eshell/em-glob.el (eshell-glob-regexp)
(eshell-glob-entries):
* lisp/eshell/em-pred.el (eshell-parse-modifiers):
* lisp/eshell/esh-opt.el (eshell-show-usage):
* lisp/facemenu.el (facemenu-add-new-face)
(facemenu-add-new-color):
* lisp/faces.el (read-face-name, read-face-font, describe-face)
(x-resolve-font-name):
* lisp/files-x.el (modify-file-local-variable):
* lisp/files.el (locate-user-emacs-file, find-alternate-file)
(set-auto-mode, hack-one-local-variable--obsolete)
(dir-locals-set-directory-class, write-file, basic-save-buffer)
(delete-directory, copy-directory, recover-session)
(recover-session-finish, insert-directory)
(file-modes-char-to-who, file-modes-symbolic-to-number)
(move-file-to-trash):
* lisp/filesets.el (filesets-add-buffer, filesets-remove-buffer):
* lisp/find-cmd.el (find-generic, find-to-string):
* lisp/finder.el (finder-commentary):
* lisp/font-lock.el (font-lock-fontify-buffer):
* lisp/format.el (format-write-file, format-find-file)
(format-insert-file):
* lisp/frame.el (get-device-terminal, select-frame-by-name):
* lisp/fringe.el (fringe--check-style):
* lisp/gnus/nnmairix.el (nnmairix-widget-create-query):
* lisp/help-fns.el (help-fns--key-bindings)
(help-fns--compiler-macro, help-fns--parent-mode)
(help-fns--obsolete, help-fns--interactive-only)
(describe-function-1, describe-variable):
* lisp/help.el (describe-mode)
(describe-minor-mode-from-indicator):
* lisp/image.el (image-type):
* lisp/international/ccl.el (ccl-dump):
* lisp/international/fontset.el (x-must-resolve-font-name):
* lisp/international/mule-cmds.el (prefer-coding-system)
(select-safe-coding-system-interactively)
(select-safe-coding-system, activate-input-method)
(toggle-input-method, describe-current-input-method)
(describe-language-environment):
* lisp/international/mule-conf.el (code-offset):
* lisp/international/mule-diag.el (describe-character-set)
(list-input-methods-1):
* lisp/mail/feedmail.el (feedmail-run-the-queue):
* lisp/mouse.el (minor-mode-menu-from-indicator):
* lisp/mpc.el (mpc-playlist-rename):
* lisp/msb.el (msb--choose-menu):
* lisp/net/ange-ftp.el (ange-ftp-shell-command):
* lisp/net/imap.el (imap-interactive-login):
* lisp/net/mairix.el (mairix-widget-create-query):
* lisp/net/newst-backend.el (newsticker--sentinel-work):
* lisp/net/newst-treeview.el (newsticker--treeview-load):
* lisp/net/rlogin.el (rlogin):
* lisp/obsolete/iswitchb.el (iswitchb-possible-new-buffer):
* lisp/obsolete/otodo-mode.el (todo-more-important-p):
* lisp/obsolete/pgg-gpg.el (pgg-gpg-process-region):
* lisp/obsolete/pgg-pgp.el (pgg-pgp-process-region):
* lisp/obsolete/pgg-pgp5.el (pgg-pgp5-process-region):
* lisp/org/ob-core.el (org-babel-goto-named-src-block)
(org-babel-goto-named-result):
* lisp/org/ob-fortran.el (org-babel-fortran-ensure-main-wrap):
* lisp/org/ob-ref.el (org-babel-ref-resolve):
* lisp/org/org-agenda.el (org-agenda-prepare):
* lisp/org/org-clock.el (org-clock-notify-once-if-expired)
(org-clock-resolve):
* lisp/org/org-ctags.el (org-ctags-ask-rebuild-tags-file-then-find-tag):
* lisp/org/org-feed.el (org-feed-parse-atom-entry):
* lisp/org/org-habit.el (org-habit-parse-todo):
* lisp/org/org-mouse.el (org-mouse-popup-global-menu)
(org-mouse-context-menu):
* lisp/org/org-table.el (org-table-edit-formulas):
* lisp/org/ox.el (org-export-async-start):
* lisp/proced.el (proced-log):
* lisp/progmodes/ada-mode.el (ada-get-indent-case)
(ada-check-matching-start, ada-goto-matching-start):
* lisp/progmodes/ada-prj.el (ada-prj-display-page):
* lisp/progmodes/ada-xref.el (ada-find-executable):
* lisp/progmodes/ebrowse.el (ebrowse-tags-apropos):
* lisp/progmodes/etags.el (etags-tags-apropos-additional):
* lisp/progmodes/flymake.el (flymake-parse-err-lines)
(flymake-start-syntax-check-process):
* lisp/progmodes/python.el (python-shell-get-process-or-error)
(python-define-auxiliary-skeleton):
* lisp/progmodes/sql.el (sql-comint):
* lisp/progmodes/verilog-mode.el (verilog-load-file-at-point):
* lisp/progmodes/vhdl-mode.el (vhdl-widget-directory-validate):
* lisp/recentf.el (recentf-open-files):
* lisp/replace.el (query-replace-read-from)
(occur-after-change-function, occur-1):
* lisp/scroll-bar.el (scroll-bar-columns):
* lisp/server.el (server-get-auth-key):
* lisp/simple.el (execute-extended-command)
(undo-outer-limit-truncate, list-processes--refresh)
(compose-mail, set-variable, choose-completion-string)
(define-alternatives):
* lisp/startup.el (site-run-file, tty-handle-args, command-line)
(command-line-1):
* lisp/subr.el (noreturn, define-error, add-to-list)
(read-char-choice, version-to-list):
* lisp/term/common-win.el (x-handle-xrm-switch)
(x-handle-name-switch, x-handle-args):
* lisp/term/x-win.el (x-handle-parent-id, x-handle-smid):
* lisp/textmodes/reftex-ref.el (reftex-label):
* lisp/textmodes/reftex-toc.el (reftex-toc-rename-label):
* lisp/textmodes/two-column.el (2C-split):
* lisp/tutorial.el (tutorial--describe-nonstandard-key)
(tutorial--find-changed-keys):
* lisp/type-break.el (type-break-noninteractive-query):
* lisp/wdired.el (wdired-do-renames, wdired-do-symlink-changes)
(wdired-do-perm-changes):
* lisp/whitespace.el (whitespace-report-region):
Prefer grave quoting in source-code strings used to generate help
and diagnostics.
* lisp/faces.el (face-documentation):
No need to convert quotes, since the result is a docstring.
* lisp/info.el (Info-virtual-index-find-node)
(Info-virtual-index, info-apropos):
Simplify by generating only curved quotes, since info files are
typically that ways nowadays anyway.
* lisp/international/mule-diag.el (list-input-methods):
Don’t assume text quoting style is curved.
* lisp/org/org-bibtex.el (org-bibtex-fields):
Revert my recent changes, going back to the old quoting style.
2015-09-07 15:41:44 +00:00
|
|
|
|
(error "Invalid argument %s in `get-device-terminal'" device))))
|
2007-09-20 21:57:23 +00:00
|
|
|
|
|
|
|
|
|
(defun frames-on-display-list (&optional device)
|
|
|
|
|
"Return a list of all frames on DEVICE.
|
|
|
|
|
|
|
|
|
|
DEVICE should be a terminal, a frame,
|
|
|
|
|
or a name of an X display or tty (a string of the form
|
2005-11-07 14:17:18 +00:00
|
|
|
|
HOST:SERVER.SCREEN).
|
Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
* lisp/frame.el (make-frame-on-display): Update doc.
(make-frame): Handle display-id parameter. Update doc.
(frames-on-display-list): Update for display ids.
(framep-on-display): Ditto.
(suspend-frame): Use display-name, not frame-tty-name.
(selected-display): New function.
* lisp/server.el (server-delete-client): Use delete-display, not delete-tty.
(server-tty-live-p, server-handle-delete-tty): Removed.
(server-handle-delete-frame): Delete tty clients, if needed.
(server-process-filter): Set the display parameter, and use it when appropriate.
(server-handle-suspend-tty): Use the display parameter.
(server-start, server-unload-hook): Removed obsolete delete-tty hook.
* lisp/talk.el (talk): Always use talk-add-display.
(talk-add-tty-frame, talk-handle-delete-tty): Removed.
(talk-handle-delete-frame): New function.
(talk-add-display): Open a new frame only if parameter was not a frame.
* src/dispextern.h (get_display, Fdisplay_tty_type): New prototypes.
(Fframe_tty_type): Removed.
* src/dispnew.c (init_display): Use Fdisplay_tty_type, not Fframe_tty_type.
* src/frame.c (Qdisplay_id, Qdisplay_live_p): New symbols.
(make_terminal_frame): Get display as a parameter.
(Fmake_terminal_frame): Get/create display here; pass it to
make_terminal_frame.
(Fframe_display): New function.
(Fdelete_frame): Stop if the hook deleted the frame.
(syms_of_frame): Register new stuff.
* src/frame.h (Qdisplay_id, Qdisplay_live_p, make_terminal_frame):
Updated prototypes.
* src/keyboard.c (interrupt_signal): Updated comment.
* src/term.c (Vdelete_tty_after_functions): Removed variable.
(Qframe_tty_name, Qframe_tty_type): Removed.
(next_display_id): New var.
(tty_ring_bell): Don't do anything on suspended frames.
(Ftty_display_color_p, Ftty_display_color_cells): Doc update.
(get_display): New function.
(get_tty_display): Use it.
(get_named_tty_display): Ignore suspended displays.
(Fframe_tty_name): Renamed to Fdisplay_name. Handle all kinds of
displays.
(Fframe_tty_type): Renamed to Fdisplay_tty_type.
(init_initial_display): Set display name.
(term_init): Allow more displays on the same device. Set display name.
(Fdelete_tty): Removed.
(delete_tty): Don't run hooks.
(create_display): Set display id.
(delete_display): Free display name.
(Fdelete_display, Fdisplay_live_p, Fdisplay_list): New functions.
(Fsuspend_tty): Call hook with display id. Doc update.
(Fresume_tty): Refuse to resume when there is already an active display
on the same device. Call hook with display id. Doc update.
(syms_of_term): Reflect above changes.
* src/termhooks.h (struct display): Added `id' and `name' members.
(DISPLAY_ACTIVE_P): New macro.
* src/xfns.c (check_x_display_info): Handle display ids.
(Fx_create_frame): Try to get display from `display-id' parameter.
* src/xterm.c (x_term_init): Set display name.
(x_delete_display): Handle the case when `font_table' is NULL.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-207
2004-07-04 04:48:55 +00:00
|
|
|
|
|
2007-09-20 21:57:23 +00:00
|
|
|
|
If DEVICE is omitted or nil, it defaults to the selected
|
2005-11-07 14:17:18 +00:00
|
|
|
|
frame's terminal device."
|
2007-09-20 21:57:23 +00:00
|
|
|
|
(let* ((terminal (get-device-terminal device))
|
2021-10-22 05:41:55 +00:00
|
|
|
|
(func #'(lambda (frame)
|
|
|
|
|
(eq (frame-terminal frame) terminal))))
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(filtered-frame-list func)))
|
|
|
|
|
|
Reimplement and extend support for terminal-local environment variables.
* lisp/termdev.el: New file. Move terminal parameter-related functions
here from frame.el.
(terminal-getenv, with-terminal-environment): Reimplement and extend.
(terminal-setenv, terminal-setenv-internal): New functions.
* lisp/frame.el (make-frame-on-tty, framep-on-display, suspend-frame):
Extend doc string, update parameter names.
(terminal-id, terminal-parameter-alist, terminal-parameters)
(terminal-parameter-p, terminal-parameter, set-terminal-parameter)
(terminal-handle-delete-frame, terminal-getenv, terminal-getenv)
(with-terminal-environment): Move to termdev.el.
* lisp/loadup.el: Load termdev as well.
* lisp/Makefile.in (lisp, shortlisp): Add termdev.elc.
* lisp/makefile.MPW (shortlisp): Ditto.
* lisp/ebuff-menu.el (electric-buffer-menu-mode-map): Bind C-z to
`suspend-frame', not `suspend-emacs'.
* lisp/echistory.el (electric-history-map): Ditto.
* lisp/ebrowse.el (ebrowse-electric-list-mode-map): Ditto.
* lisp/ebrowse.el (ebrowse-electric-position-mode-map): Ditto.
* lisp/startup.el (normal-splash-screen): Use `save-buffers-kill-display'
instead of `save-buffers-kill-emacs'.
* lisp/x-win.el (x-initialize-window-system): Add 'global-ok option to
`terminal-getenv'.
* src/term.c (suspend-tty): Update doc string.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-456
2005-12-22 21:02:45 +00:00
|
|
|
|
(defun framep-on-display (&optional terminal)
|
|
|
|
|
"Return the type of frames on TERMINAL.
|
|
|
|
|
TERMINAL may be a terminal id, a display name or a frame. If it
|
|
|
|
|
is a frame, its type is returned. If TERMINAL is omitted or nil,
|
|
|
|
|
it defaults to the selected frame's terminal device. All frames
|
|
|
|
|
on a given display are of the same type."
|
Rename `struct device' to `struct terminal'. Rename some terminal-related functions similarly.
* src/termhooks.h (struct device): Rename to `terminal'. Rename member
`next_device' to `next_terminal'.
(device_list): Rename to `terminal_list'.
(FRAME_DEVICE): Rename to `FRAME_TERMINAL'.
(DEVICE_TERMINAL_CODING): Rename to `TERMINAL_TERMINAL_CODING'.
(TERMINAL_KEYBOARD_CODING): Rename to `TERMINAL_KEYBOARD_CODING'.
(DEVICE_ACTIVE_P): Rename to `TERMINAL_ACTIVE_P'.
Update declarations and macro definitions.
* src/termchar.h (tty_display_info): Rename member `device' to `terminal'.
(FRAME_TTY): Update for renames.
* src/xterm.h (x_display_info): Rename member `device' to `terminal'.
* src/frame.h (frame): Rename `device' member to `terminal'.
(FRAME_KBOARD, FRAME_LIVE_P, Qdevice, Qdisplay_live_p):
Update for renames.
* src/lisp.h (set_process_environment): Rename to `set_global_environment'.
(device): Rename to `terminal'.
* src/dispextern.h: Update declarations and macro definitions.
* src/terminal.c (device_list): Rename to `terminal_list'.
(next_device_id): Rename to `next_terminal_id'.
(initial_device): Rename to `initial_terminal'.
(get_device): Rename to `get_terminal'.
(create_device): Rename to `create_terminal'.
(mark_devices): Rename to `mark_terminals'.
(delete_device): Rename to `delete_terminal'.
(Fdelete_display): Rename to `Fdelete_terminal'.
(Fframe_terminal): Move here from frame.c.
(Fdisplay_live_p): Rename to `Fterminal_live_p'.
(Fdisplay_list): Rename to `Fterminal_list'.
(Fdisplay_name): Rename to `Fterminal_name'.
(init_initial_device): Rename to `init_initial_terminal'.
(delete_initial_device): Rename to `delete_initial_terminal'.
(ring_bell, update_begin, update_end, set_terminal_window)
(cursor_to, raw_cursor_to, clear_to_end, clear_frame)
(clear_end_of_line, write_glyphs, insert_glyphs, delete_glyphs)
(ins_del_lines, get_terminal_param, store_terminal_param)
(Fterminal_parameters, Fterminal_parameter)
(Fmodify_terminal_parameters, Fset_terminal_parameter)
(syms_of_terminal): Update for renames.
* src/term.c (get_tty_device): Rename to `get_tty_terminal'. Update.
(Fdisplay_tty_type): Rename to `Ftty_type'.
(Fdisplay_controlling_tty_p): Rename to `Fcontrolling_tty_p'.
(delete_tty, tty_set_terminal_modes, tty_reset_terminal_modes)
(Ftty_display_color_p, Ftty_display_color_cells, get_named_tty)
(Ftty_no_underline, Fsuspend_tty, Fresume_tty, create_tty_output)
(init_tty, maybe_fatal, delete_tty, syms_of_term): Update for rename.
* src/frame.c (Qdevice): Rename to `Qterminal'.
(Qdisplay_live_p): Rename to `Qterminal_live_p'.
(terminal_frame_count): Rename to `tty_frame_count'.
(Fframe_display): Move to terminal.c, rename to `Fframe_terminal'.
(make_frame_without_minibuffer, make_initial_frame)
(make_terminal_frame, Fmodify_frame_parameters)
(do_switch_frame, Fdelete_frame, Fmouse_position)
(Fmouse_pixel_position, Fraise_frame, Flower_frame)
(Fredirect_frame_focus, set_term_frame_name, syms_of_frame):
Update for renames.
* src/xdisp.c (message2_nolog, message3_nolog, redisplay_internal)
(set_vertical_scroll_bar, redisplay_window, check_x_display_info)
(x_set_scroll_bar_foreground, x_set_scroll_bar_background)
(Fx_create_frame, Fxw_display_color_p, Fx_display_grayscale_p)
(Fx_display_pixel_width, Fx_display_pixel_height)
(Fx_display_planes, Fx_display_color_cells)
(Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
(Fx_display_screens, Fx_display_mm_height, Fx_display_mm_width)
(Fx_display_backing_store, Fx_display_visual_class)
(Fx_display_save_under, Fx_close_connection, x_create_tip_frame):
Update for renames.
* xterm.c (handle_one_xevent): Initialize `f' to NULL.
(x_delete_device): Rename to `x_delete_terminal'.
(x_create_device): Rename to `x_create_terminal'.
(XTset_terminal_modes, XTreset_terminal_modes)
(XTread_socket, x_connection_closed, x_term_init)
(x_term_init, x_delete_display): Update for renames.
* src/dispnew.c (Fredraw_frame, Fsend_string_to_terminal)
(Fsend_string_to_terminal, init_display): Update for renames.
* src/keyboard.c (push_frame_kboard, pop_kboard, pop_kboard)
(kbd_buffer_get_event, read_avail_input, tty_read_avail_input)
(interrupt_signal, Fset_output_flow_control)
(Fset_input_meta_mode, Fset_quit_char, delete_kboard)
(syms_of_keyboard): Update for renames.
* src/alloc.c (mark_devices): Update declaration.
(Fgarbage_collect): Update for renames.
* src/coding.c (Fset_terminal_coding_system_internal)
(Fterminal_coding_system4)
(Fset_keyboard_coding_system_internal)
(Fkeyboard_coding_system): Update for renames.
* src/data.c (Fterminal_local_value, Fset_terminal_local_value):
Update for renames.
* src/minibuf.c (read_minibuf): Update for renames.
* src/sysdep.c (init_sys_modes, reset_sys_modes): Update for renames.
* xselect.c (x_handle_selection_clear): Update for renames.
* lisp/files.el (save-buffers-kill-display): Rename to `save-buffers-kill-terminal'.
(save-buffers-kill-terminal, ctl-x-map): Update for renames.
* frame.el (make-frame): Rename 'device frame parameter to 'terminal. Update.
(frames-on-display-list, framep-on-display, suspend-frame): Update for renames.
(selected-display): Rename to `selected-terminal'.
* server.el (server-save-buffers-kill-display): Rename to
`server-save-buffers-kill-terminal'.
(server-delete-client, server-handle-delete-frame)
(server-handle-suspend-tty, server-process-filter)
(server-switch-buffer): Update for renames.
* startup.el (normal-splash-screen, normal-splash-screen): Update for renames.
* talk.el (talk): Update for renames.
* termdev.el (terminal-id): Update for renames.
* xt-mouse.el (turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal)
(xterm-mouse-handle-delete-frame): Update for renames.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-471
2005-12-29 18:20:26 +00:00
|
|
|
|
(or (terminal-live-p terminal)
|
Reimplement and extend support for terminal-local environment variables.
* lisp/termdev.el: New file. Move terminal parameter-related functions
here from frame.el.
(terminal-getenv, with-terminal-environment): Reimplement and extend.
(terminal-setenv, terminal-setenv-internal): New functions.
* lisp/frame.el (make-frame-on-tty, framep-on-display, suspend-frame):
Extend doc string, update parameter names.
(terminal-id, terminal-parameter-alist, terminal-parameters)
(terminal-parameter-p, terminal-parameter, set-terminal-parameter)
(terminal-handle-delete-frame, terminal-getenv, terminal-getenv)
(with-terminal-environment): Move to termdev.el.
* lisp/loadup.el: Load termdev as well.
* lisp/Makefile.in (lisp, shortlisp): Add termdev.elc.
* lisp/makefile.MPW (shortlisp): Ditto.
* lisp/ebuff-menu.el (electric-buffer-menu-mode-map): Bind C-z to
`suspend-frame', not `suspend-emacs'.
* lisp/echistory.el (electric-history-map): Ditto.
* lisp/ebrowse.el (ebrowse-electric-list-mode-map): Ditto.
* lisp/ebrowse.el (ebrowse-electric-position-mode-map): Ditto.
* lisp/startup.el (normal-splash-screen): Use `save-buffers-kill-display'
instead of `save-buffers-kill-emacs'.
* lisp/x-win.el (x-initialize-window-system): Add 'global-ok option to
`terminal-getenv'.
* src/term.c (suspend-tty): Update doc string.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-456
2005-12-22 21:02:45 +00:00
|
|
|
|
(framep terminal)
|
|
|
|
|
(framep (car (frames-on-display-list terminal)))))
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
|
1993-07-04 02:20:59 +00:00
|
|
|
|
(defun frame-remove-geometry-params (param-list)
|
|
|
|
|
"Return the parameter list PARAM-LIST, but with geometry specs removed.
|
|
|
|
|
This deletes all bindings in PARAM-LIST for `top', `left', `width',
|
1994-05-05 22:37:47 +00:00
|
|
|
|
`height', `user-size' and `user-position' parameters.
|
1993-07-04 02:20:59 +00:00
|
|
|
|
Emacs uses this to avoid overriding explicit moves and resizings from
|
|
|
|
|
the user during startup."
|
|
|
|
|
(setq param-list (cons nil param-list))
|
|
|
|
|
(let ((tail param-list))
|
|
|
|
|
(while (consp (cdr tail))
|
|
|
|
|
(if (and (consp (car (cdr tail)))
|
1994-05-05 22:37:47 +00:00
|
|
|
|
(memq (car (car (cdr tail)))
|
|
|
|
|
'(height width top left user-position user-size)))
|
|
|
|
|
(progn
|
|
|
|
|
(setq frame-initial-geometry-arguments
|
|
|
|
|
(cons (car (cdr tail)) frame-initial-geometry-arguments))
|
|
|
|
|
(setcdr tail (cdr (cdr tail))))
|
1993-07-04 02:20:59 +00:00
|
|
|
|
(setq tail (cdr tail)))))
|
1994-05-10 07:55:00 +00:00
|
|
|
|
(setq frame-initial-geometry-arguments
|
|
|
|
|
(nreverse frame-initial-geometry-arguments))
|
1993-07-04 02:20:59 +00:00
|
|
|
|
(cdr param-list))
|
|
|
|
|
|
2017-12-15 02:31:28 +00:00
|
|
|
|
(declare-function x-focus-frame "frame.c" (frame &optional noactivate))
|
2008-06-12 03:56:20 +00:00
|
|
|
|
|
2011-07-16 13:02:51 +00:00
|
|
|
|
(defun select-frame-set-input-focus (frame &optional norecord)
|
2008-09-16 08:20:21 +00:00
|
|
|
|
"Select FRAME, raise it, and set input focus, if possible.
|
2009-07-26 19:20:51 +00:00
|
|
|
|
If `mouse-autoselect-window' is non-nil, also move mouse pointer
|
2008-09-16 08:20:21 +00:00
|
|
|
|
to FRAME's selected window. Otherwise, if `focus-follows-mouse'
|
2011-07-16 13:02:51 +00:00
|
|
|
|
is non-nil, move mouse cursor to FRAME.
|
|
|
|
|
|
|
|
|
|
Optional argument NORECORD means to neither change the order of
|
|
|
|
|
recently selected windows nor the buffer list."
|
|
|
|
|
(select-frame frame norecord)
|
2008-09-13 08:28:04 +00:00
|
|
|
|
(raise-frame frame)
|
2008-09-16 08:20:21 +00:00
|
|
|
|
;; Ensure, if possible, that FRAME gets input focus.
|
2019-04-03 19:57:16 +00:00
|
|
|
|
(when (display-multi-frame-p frame)
|
2008-09-13 08:28:04 +00:00
|
|
|
|
(x-focus-frame frame))
|
2008-09-16 08:20:21 +00:00
|
|
|
|
;; Move mouse cursor if necessary.
|
|
|
|
|
(cond
|
|
|
|
|
(mouse-autoselect-window
|
2019-06-11 08:13:36 +00:00
|
|
|
|
(let ((edges (window-edges (frame-selected-window frame)
|
|
|
|
|
t nil t)))
|
2008-09-16 08:20:21 +00:00
|
|
|
|
;; Move mouse cursor into FRAME's selected window to avoid that
|
|
|
|
|
;; Emacs mouse-autoselects another window.
|
2019-06-11 08:13:36 +00:00
|
|
|
|
(set-mouse-pixel-position frame (1- (nth 2 edges)) (nth 1 edges))))
|
2008-09-16 08:20:21 +00:00
|
|
|
|
(focus-follows-mouse
|
|
|
|
|
;; Move mouse cursor into FRAME to avoid that another frame gets
|
|
|
|
|
;; selected by the window manager.
|
|
|
|
|
(set-mouse-position frame (1- (frame-width frame)) 0))))
|
2001-08-10 13:47:18 +00:00
|
|
|
|
|
1993-08-02 22:18:34 +00:00
|
|
|
|
(defun other-frame (arg)
|
2006-12-08 02:56:08 +00:00
|
|
|
|
"Select the ARGth different visible frame on current display, and raise it.
|
1993-08-02 22:18:34 +00:00
|
|
|
|
All frames are arranged in a cyclic order.
|
|
|
|
|
This command selects the frame ARG steps away in that order.
|
2002-02-20 22:28:44 +00:00
|
|
|
|
A negative ARG moves in the opposite order.
|
|
|
|
|
|
Add new frame parameters and associated functions
Add new frame parameters `undecorated', `override-redirect',
`parent-frame', `skip-taskbar', `no-focus-on-map',
`no-accept-focus', `z-group', `delete-before', `no-other-frame',
`mouse-wheel-frame', `min-width', `min-height'. Add new
functions `frame-restack' and `frame-list-z-order'.
* lisp/cus-start.el (focus-follows-mouse): Adapt customization
type.
* lisp/frame.el (handle-delete-frame): Handle child and
`delete-before' frames.
(other-frame): Stop looking for other frame after one round.
(frame-list-z-order, frame-restack): New functions.
(delete-other-frames): Handle child frames.
* lisp/frameset.el (frameset-persistent-filter-alist)
(frameset--record-relationships): Handle `delete-before',
`parent-frame' and `mouse-wheel-frame' parameters. Rename
latter from `frameset--record-minibuffer-relationships'.
(frameset--restore-frame): Handle ‘parent-frame’ parameter
specially.
(frameset-restore): Handle `delete-before', `parent-frame' and
`mouse-wheel-frame' parameters.
* lisp/mwheel.el (mwheel-scroll): Handle `mouse-wheel-frame'
parameter.
* lisp/window.el (window--min-size-ignore-p): Fix doc-string.
(mouse-autoselect-window-select, handle-select-window): Major
rewrite. Try to not ignore errors. Handle auto-selection of
child frames and different values of `focus-follows-mouse'.
* src/frame.c (frame_windows_min_size): Handle new `min-width'
and `min-height' frame parameters.
(make_frame): Initialize new frame structure members.
(do_switch_frame): Don't reset internal_last_event_frame for
descendant frames.
(Fframe_parent, frame_ancestor_p, Fframe_ancestor_p): New
functions.
(candidate_frame): Don't return `no-other-frame' frame.
(other_frames): New function replacing other_visible_frames.
(delete_frame): Rewrite. Handle child and `delete-before' frames.
(Fmake_frame_invisible): Call other_frames.
(store_frame_param): Check `delete-before' and `parent-frame'
parameters for circular dependencies.
(frame_parms, syms_of_frame): Add entries for and define new
frame parameters.
(focus_follows_mouse): New meaningful value `auto-raise'.
* src/frame.h (z_group): New enumeration type.
(frame): New slots parent_frame, undecorated, override_redirect,
skip_taskbar, no_focus_on_map, no_accept_focus, z_group.
(fset_parent_frame): New inlined function.
(FRAME_UNDECORATED, FRAME_OVERRIDE_REDIRECT)
(FRAME_PARENT_FRAME, FRAME_SKIP_TASKBAR, FRAME_NO_FOCUS_ON_MAP)
(FRAME_NO_ACCEPT_FOCUS, FRAME_Z_GROUP, FRAME_Z_GROUP_NONE)
(FRAME_Z_GROUP_ABOVE, FRAME_Z_GROUP_ABOVE_SUSPENDED)
(FRAME_Z_GROUP_BELOW): New macros.
(frame_ancestor_p): Add declaration.
* src/gtkutil.c (xg_create_frame_widgets): Handle
`undecorated' and `override-redirect' frame parameters.
(x_wm_set_size_hint): None for child frames.
(xg_set_undecorated, xg_frame_restack, xg_set_skip_taskbar)
(xg_set_no_focus_on_map, xg_set_no_accept_focus)
(xg_set_override_redirect): New functions.
(xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos):
Don't let scrollbars obscure child frames.
* src/gtkutil.h: (xg_set_undecorated, xg_frame_restack)
(xg_set_skip_taskbar, xg_set_no_focus_on_map)
(xg_set_no_accept_focus, xg_set_override_redirect): Add extern
declarations.
* src/nsfns.m (ns_frame_parm_handlers): Add entries for new
frame parameters.
(Fx_create_frame): Install `min-width' and `min-height' frame
parameters.
* src/nsterm.m (mouseMoved:): Handle focus_follows_mouse change.
* src/w32fns.c (WS_EX_NOACTIVATE): Define if necessary.
(x_real_positions): Handle child frames.
(x_set_menu_bar_lines): Don't for child frames.
(x_set_undecorated, x_set_parent_frame, x_set_skip_taskbar)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_z_group): New functions.
(w32_createvscrollbar, w32_createhscrollbar): Don't draw
scroll bars over child frames.
(w32_createwindow): Handle new frame parameters and child frames.
(w32_wnd_proc): Let mouse clicks into a child frame activate
the frame. Try to handle the `no-accept-focus' parameter. Do
SetFocus when our window is brought to top or becomes the
foreground window.
(w32_window): Don't initialize menu bar for child frames.
(Fx_create_frame): Handle new frame parameters.
(x_create_tip_frame): Set explicit_parent slot.
(w32_dialog_in_progress): New function.
(Fx_file_dialog): Handle `z-group-above' frames.
(w32_frame_list_z_order, Fw32_frame_list_z_order)
(w32_frame_restack, Fw32_frame_restack): New functions.
(w32_frame_parm_handlers): Add entries for new frame
parameters.
* src/w32font.c (Fx_select_font): Handle `z-group-above'
frames during font selection dialogue.
* src/w32term.c (construct_mouse_wheel): Construct mouse wheel
event from F's w32 window.
(w32_mouse_position): Handle child frames.
(w32_set_vertical_scroll_bar, w32_set_horizontal_scroll_bar):
Don't draw scroll bars over child frames.
(w32_read_socket): Always erase background of child frames.
When generating SELECT_WINDOW_EVENTs handle new value of
`focus-follows-mouse' and handle `no-accept-focus' parameter.
Handle `mouse-wheel-frame' parameter.
(x_calc_absolute_position, x_set_offset, x_set_window_size):
Handle child frames.
(x_make_frame_visible): Handle child frames specially. Handle
`no-focus-on-map' parameter.
* src/w32term.h (w32_dialog_in_progress): Add external
declaration.
* src/xdisp.c (x_consider_frame_title, prepare_menu_bars): Not
for child frames.
* src/xfns.c (Xm/MwmUtil.h): Include for WM hints.
(PropMotifWmHints, PROP_MOTIF_WM_HINTS_ELEMENTS): Define for
non-Motif, non-GTK case.
(x_real_pos_and_offsets): Handle child frames.
(x_set_undecorated, x_set_parent_frame)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_override_redirect): New functions.
(x_set_menu_bar_lines): Not for child frames.
(x_window): Handle `undecorated' and `override_redirect' cases.
(Fx_create_frame): Handle new frame parameters.
(frame_geometry): Handle child frames and outer border.
(x_frame_list_z_order, Fx_frame_list_z_order)
(x_frame_restack, Fx_frame_restack): New functions.
(Fx_file_dialog, Fx_select_font): Set x_menu_set_in_use.
(x_frame_parm_handlers): Add entries for new frame parameters.
* src/xmenu.c (x_menu_set_in_use): Handle `z-group-above'
frames.
* src/xterm.c (x_set_frame_alpha): Don't set alpha of parent
for child frames.
(XTmouse_position): Handle child frames.
(x_scroll_bar_create, x_scroll_bar_expose): Don't let scroll
bars obscure child frames.
(handle_one_xevent): Handle child frame positions. If necessary
set `skip-taskbar' and reassign proper `z-group' when we are
mapped. When generating SELECT_WINDOW_EVENTs handle new value
of `focus-follows-mouse'. Handle `mouse-wheel-frame' parameter.
Let mouse clicks into a child frame activate the frame.
(x_calc_absolute_position, x_set_offset): Handle child frames
specially.
(x_set_skip_taskbar, x_set_z_group): New functions.
(x_make_frame_visible): Handle child frames.
(ATOM_REFS_INIT): Add entries for
Xatom_net_wm_state_skip_taskbar, Xatom_net_wm_state_above,
Xatom_net_wm_state_below.
* src/xterm.h (top-level): Declare Xatom_net_wm_state_above,
Xatom_net_wm_state_below and Xatom_net_wm_state_skip_taskbar.
(x_set_skip_taskbar, x_set_z_group): Add extern declarations.
2017-04-12 08:38:25 +00:00
|
|
|
|
To make this command work properly, you must tell Emacs how the
|
|
|
|
|
system (or the window manager) generally handles focus-switching
|
|
|
|
|
between windows. If moving the mouse onto a window selects
|
|
|
|
|
it (gives it focus), set `focus-follows-mouse' to t. Otherwise,
|
|
|
|
|
that variable should be nil."
|
1993-08-02 22:18:34 +00:00
|
|
|
|
(interactive "p")
|
Add new frame parameters and associated functions
Add new frame parameters `undecorated', `override-redirect',
`parent-frame', `skip-taskbar', `no-focus-on-map',
`no-accept-focus', `z-group', `delete-before', `no-other-frame',
`mouse-wheel-frame', `min-width', `min-height'. Add new
functions `frame-restack' and `frame-list-z-order'.
* lisp/cus-start.el (focus-follows-mouse): Adapt customization
type.
* lisp/frame.el (handle-delete-frame): Handle child and
`delete-before' frames.
(other-frame): Stop looking for other frame after one round.
(frame-list-z-order, frame-restack): New functions.
(delete-other-frames): Handle child frames.
* lisp/frameset.el (frameset-persistent-filter-alist)
(frameset--record-relationships): Handle `delete-before',
`parent-frame' and `mouse-wheel-frame' parameters. Rename
latter from `frameset--record-minibuffer-relationships'.
(frameset--restore-frame): Handle ‘parent-frame’ parameter
specially.
(frameset-restore): Handle `delete-before', `parent-frame' and
`mouse-wheel-frame' parameters.
* lisp/mwheel.el (mwheel-scroll): Handle `mouse-wheel-frame'
parameter.
* lisp/window.el (window--min-size-ignore-p): Fix doc-string.
(mouse-autoselect-window-select, handle-select-window): Major
rewrite. Try to not ignore errors. Handle auto-selection of
child frames and different values of `focus-follows-mouse'.
* src/frame.c (frame_windows_min_size): Handle new `min-width'
and `min-height' frame parameters.
(make_frame): Initialize new frame structure members.
(do_switch_frame): Don't reset internal_last_event_frame for
descendant frames.
(Fframe_parent, frame_ancestor_p, Fframe_ancestor_p): New
functions.
(candidate_frame): Don't return `no-other-frame' frame.
(other_frames): New function replacing other_visible_frames.
(delete_frame): Rewrite. Handle child and `delete-before' frames.
(Fmake_frame_invisible): Call other_frames.
(store_frame_param): Check `delete-before' and `parent-frame'
parameters for circular dependencies.
(frame_parms, syms_of_frame): Add entries for and define new
frame parameters.
(focus_follows_mouse): New meaningful value `auto-raise'.
* src/frame.h (z_group): New enumeration type.
(frame): New slots parent_frame, undecorated, override_redirect,
skip_taskbar, no_focus_on_map, no_accept_focus, z_group.
(fset_parent_frame): New inlined function.
(FRAME_UNDECORATED, FRAME_OVERRIDE_REDIRECT)
(FRAME_PARENT_FRAME, FRAME_SKIP_TASKBAR, FRAME_NO_FOCUS_ON_MAP)
(FRAME_NO_ACCEPT_FOCUS, FRAME_Z_GROUP, FRAME_Z_GROUP_NONE)
(FRAME_Z_GROUP_ABOVE, FRAME_Z_GROUP_ABOVE_SUSPENDED)
(FRAME_Z_GROUP_BELOW): New macros.
(frame_ancestor_p): Add declaration.
* src/gtkutil.c (xg_create_frame_widgets): Handle
`undecorated' and `override-redirect' frame parameters.
(x_wm_set_size_hint): None for child frames.
(xg_set_undecorated, xg_frame_restack, xg_set_skip_taskbar)
(xg_set_no_focus_on_map, xg_set_no_accept_focus)
(xg_set_override_redirect): New functions.
(xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos):
Don't let scrollbars obscure child frames.
* src/gtkutil.h: (xg_set_undecorated, xg_frame_restack)
(xg_set_skip_taskbar, xg_set_no_focus_on_map)
(xg_set_no_accept_focus, xg_set_override_redirect): Add extern
declarations.
* src/nsfns.m (ns_frame_parm_handlers): Add entries for new
frame parameters.
(Fx_create_frame): Install `min-width' and `min-height' frame
parameters.
* src/nsterm.m (mouseMoved:): Handle focus_follows_mouse change.
* src/w32fns.c (WS_EX_NOACTIVATE): Define if necessary.
(x_real_positions): Handle child frames.
(x_set_menu_bar_lines): Don't for child frames.
(x_set_undecorated, x_set_parent_frame, x_set_skip_taskbar)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_z_group): New functions.
(w32_createvscrollbar, w32_createhscrollbar): Don't draw
scroll bars over child frames.
(w32_createwindow): Handle new frame parameters and child frames.
(w32_wnd_proc): Let mouse clicks into a child frame activate
the frame. Try to handle the `no-accept-focus' parameter. Do
SetFocus when our window is brought to top or becomes the
foreground window.
(w32_window): Don't initialize menu bar for child frames.
(Fx_create_frame): Handle new frame parameters.
(x_create_tip_frame): Set explicit_parent slot.
(w32_dialog_in_progress): New function.
(Fx_file_dialog): Handle `z-group-above' frames.
(w32_frame_list_z_order, Fw32_frame_list_z_order)
(w32_frame_restack, Fw32_frame_restack): New functions.
(w32_frame_parm_handlers): Add entries for new frame
parameters.
* src/w32font.c (Fx_select_font): Handle `z-group-above'
frames during font selection dialogue.
* src/w32term.c (construct_mouse_wheel): Construct mouse wheel
event from F's w32 window.
(w32_mouse_position): Handle child frames.
(w32_set_vertical_scroll_bar, w32_set_horizontal_scroll_bar):
Don't draw scroll bars over child frames.
(w32_read_socket): Always erase background of child frames.
When generating SELECT_WINDOW_EVENTs handle new value of
`focus-follows-mouse' and handle `no-accept-focus' parameter.
Handle `mouse-wheel-frame' parameter.
(x_calc_absolute_position, x_set_offset, x_set_window_size):
Handle child frames.
(x_make_frame_visible): Handle child frames specially. Handle
`no-focus-on-map' parameter.
* src/w32term.h (w32_dialog_in_progress): Add external
declaration.
* src/xdisp.c (x_consider_frame_title, prepare_menu_bars): Not
for child frames.
* src/xfns.c (Xm/MwmUtil.h): Include for WM hints.
(PropMotifWmHints, PROP_MOTIF_WM_HINTS_ELEMENTS): Define for
non-Motif, non-GTK case.
(x_real_pos_and_offsets): Handle child frames.
(x_set_undecorated, x_set_parent_frame)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_override_redirect): New functions.
(x_set_menu_bar_lines): Not for child frames.
(x_window): Handle `undecorated' and `override_redirect' cases.
(Fx_create_frame): Handle new frame parameters.
(frame_geometry): Handle child frames and outer border.
(x_frame_list_z_order, Fx_frame_list_z_order)
(x_frame_restack, Fx_frame_restack): New functions.
(Fx_file_dialog, Fx_select_font): Set x_menu_set_in_use.
(x_frame_parm_handlers): Add entries for new frame parameters.
* src/xmenu.c (x_menu_set_in_use): Handle `z-group-above'
frames.
* src/xterm.c (x_set_frame_alpha): Don't set alpha of parent
for child frames.
(XTmouse_position): Handle child frames.
(x_scroll_bar_create, x_scroll_bar_expose): Don't let scroll
bars obscure child frames.
(handle_one_xevent): Handle child frame positions. If necessary
set `skip-taskbar' and reassign proper `z-group' when we are
mapped. When generating SELECT_WINDOW_EVENTs handle new value
of `focus-follows-mouse'. Handle `mouse-wheel-frame' parameter.
Let mouse clicks into a child frame activate the frame.
(x_calc_absolute_position, x_set_offset): Handle child frames
specially.
(x_set_skip_taskbar, x_set_z_group): New functions.
(x_make_frame_visible): Handle child frames.
(ATOM_REFS_INIT): Add entries for
Xatom_net_wm_state_skip_taskbar, Xatom_net_wm_state_above,
Xatom_net_wm_state_below.
* src/xterm.h (top-level): Declare Xatom_net_wm_state_above,
Xatom_net_wm_state_below and Xatom_net_wm_state_skip_taskbar.
(x_set_skip_taskbar, x_set_z_group): Add extern declarations.
2017-04-12 08:38:25 +00:00
|
|
|
|
(let ((sframe (selected-frame))
|
|
|
|
|
(frame (selected-frame)))
|
1993-08-02 22:18:34 +00:00
|
|
|
|
(while (> arg 0)
|
1993-08-03 03:33:14 +00:00
|
|
|
|
(setq frame (next-frame frame))
|
Add new frame parameters and associated functions
Add new frame parameters `undecorated', `override-redirect',
`parent-frame', `skip-taskbar', `no-focus-on-map',
`no-accept-focus', `z-group', `delete-before', `no-other-frame',
`mouse-wheel-frame', `min-width', `min-height'. Add new
functions `frame-restack' and `frame-list-z-order'.
* lisp/cus-start.el (focus-follows-mouse): Adapt customization
type.
* lisp/frame.el (handle-delete-frame): Handle child and
`delete-before' frames.
(other-frame): Stop looking for other frame after one round.
(frame-list-z-order, frame-restack): New functions.
(delete-other-frames): Handle child frames.
* lisp/frameset.el (frameset-persistent-filter-alist)
(frameset--record-relationships): Handle `delete-before',
`parent-frame' and `mouse-wheel-frame' parameters. Rename
latter from `frameset--record-minibuffer-relationships'.
(frameset--restore-frame): Handle ‘parent-frame’ parameter
specially.
(frameset-restore): Handle `delete-before', `parent-frame' and
`mouse-wheel-frame' parameters.
* lisp/mwheel.el (mwheel-scroll): Handle `mouse-wheel-frame'
parameter.
* lisp/window.el (window--min-size-ignore-p): Fix doc-string.
(mouse-autoselect-window-select, handle-select-window): Major
rewrite. Try to not ignore errors. Handle auto-selection of
child frames and different values of `focus-follows-mouse'.
* src/frame.c (frame_windows_min_size): Handle new `min-width'
and `min-height' frame parameters.
(make_frame): Initialize new frame structure members.
(do_switch_frame): Don't reset internal_last_event_frame for
descendant frames.
(Fframe_parent, frame_ancestor_p, Fframe_ancestor_p): New
functions.
(candidate_frame): Don't return `no-other-frame' frame.
(other_frames): New function replacing other_visible_frames.
(delete_frame): Rewrite. Handle child and `delete-before' frames.
(Fmake_frame_invisible): Call other_frames.
(store_frame_param): Check `delete-before' and `parent-frame'
parameters for circular dependencies.
(frame_parms, syms_of_frame): Add entries for and define new
frame parameters.
(focus_follows_mouse): New meaningful value `auto-raise'.
* src/frame.h (z_group): New enumeration type.
(frame): New slots parent_frame, undecorated, override_redirect,
skip_taskbar, no_focus_on_map, no_accept_focus, z_group.
(fset_parent_frame): New inlined function.
(FRAME_UNDECORATED, FRAME_OVERRIDE_REDIRECT)
(FRAME_PARENT_FRAME, FRAME_SKIP_TASKBAR, FRAME_NO_FOCUS_ON_MAP)
(FRAME_NO_ACCEPT_FOCUS, FRAME_Z_GROUP, FRAME_Z_GROUP_NONE)
(FRAME_Z_GROUP_ABOVE, FRAME_Z_GROUP_ABOVE_SUSPENDED)
(FRAME_Z_GROUP_BELOW): New macros.
(frame_ancestor_p): Add declaration.
* src/gtkutil.c (xg_create_frame_widgets): Handle
`undecorated' and `override-redirect' frame parameters.
(x_wm_set_size_hint): None for child frames.
(xg_set_undecorated, xg_frame_restack, xg_set_skip_taskbar)
(xg_set_no_focus_on_map, xg_set_no_accept_focus)
(xg_set_override_redirect): New functions.
(xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos):
Don't let scrollbars obscure child frames.
* src/gtkutil.h: (xg_set_undecorated, xg_frame_restack)
(xg_set_skip_taskbar, xg_set_no_focus_on_map)
(xg_set_no_accept_focus, xg_set_override_redirect): Add extern
declarations.
* src/nsfns.m (ns_frame_parm_handlers): Add entries for new
frame parameters.
(Fx_create_frame): Install `min-width' and `min-height' frame
parameters.
* src/nsterm.m (mouseMoved:): Handle focus_follows_mouse change.
* src/w32fns.c (WS_EX_NOACTIVATE): Define if necessary.
(x_real_positions): Handle child frames.
(x_set_menu_bar_lines): Don't for child frames.
(x_set_undecorated, x_set_parent_frame, x_set_skip_taskbar)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_z_group): New functions.
(w32_createvscrollbar, w32_createhscrollbar): Don't draw
scroll bars over child frames.
(w32_createwindow): Handle new frame parameters and child frames.
(w32_wnd_proc): Let mouse clicks into a child frame activate
the frame. Try to handle the `no-accept-focus' parameter. Do
SetFocus when our window is brought to top or becomes the
foreground window.
(w32_window): Don't initialize menu bar for child frames.
(Fx_create_frame): Handle new frame parameters.
(x_create_tip_frame): Set explicit_parent slot.
(w32_dialog_in_progress): New function.
(Fx_file_dialog): Handle `z-group-above' frames.
(w32_frame_list_z_order, Fw32_frame_list_z_order)
(w32_frame_restack, Fw32_frame_restack): New functions.
(w32_frame_parm_handlers): Add entries for new frame
parameters.
* src/w32font.c (Fx_select_font): Handle `z-group-above'
frames during font selection dialogue.
* src/w32term.c (construct_mouse_wheel): Construct mouse wheel
event from F's w32 window.
(w32_mouse_position): Handle child frames.
(w32_set_vertical_scroll_bar, w32_set_horizontal_scroll_bar):
Don't draw scroll bars over child frames.
(w32_read_socket): Always erase background of child frames.
When generating SELECT_WINDOW_EVENTs handle new value of
`focus-follows-mouse' and handle `no-accept-focus' parameter.
Handle `mouse-wheel-frame' parameter.
(x_calc_absolute_position, x_set_offset, x_set_window_size):
Handle child frames.
(x_make_frame_visible): Handle child frames specially. Handle
`no-focus-on-map' parameter.
* src/w32term.h (w32_dialog_in_progress): Add external
declaration.
* src/xdisp.c (x_consider_frame_title, prepare_menu_bars): Not
for child frames.
* src/xfns.c (Xm/MwmUtil.h): Include for WM hints.
(PropMotifWmHints, PROP_MOTIF_WM_HINTS_ELEMENTS): Define for
non-Motif, non-GTK case.
(x_real_pos_and_offsets): Handle child frames.
(x_set_undecorated, x_set_parent_frame)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_override_redirect): New functions.
(x_set_menu_bar_lines): Not for child frames.
(x_window): Handle `undecorated' and `override_redirect' cases.
(Fx_create_frame): Handle new frame parameters.
(frame_geometry): Handle child frames and outer border.
(x_frame_list_z_order, Fx_frame_list_z_order)
(x_frame_restack, Fx_frame_restack): New functions.
(Fx_file_dialog, Fx_select_font): Set x_menu_set_in_use.
(x_frame_parm_handlers): Add entries for new frame parameters.
* src/xmenu.c (x_menu_set_in_use): Handle `z-group-above'
frames.
* src/xterm.c (x_set_frame_alpha): Don't set alpha of parent
for child frames.
(XTmouse_position): Handle child frames.
(x_scroll_bar_create, x_scroll_bar_expose): Don't let scroll
bars obscure child frames.
(handle_one_xevent): Handle child frame positions. If necessary
set `skip-taskbar' and reassign proper `z-group' when we are
mapped. When generating SELECT_WINDOW_EVENTs handle new value
of `focus-follows-mouse'. Handle `mouse-wheel-frame' parameter.
Let mouse clicks into a child frame activate the frame.
(x_calc_absolute_position, x_set_offset): Handle child frames
specially.
(x_set_skip_taskbar, x_set_z_group): New functions.
(x_make_frame_visible): Handle child frames.
(ATOM_REFS_INIT): Add entries for
Xatom_net_wm_state_skip_taskbar, Xatom_net_wm_state_above,
Xatom_net_wm_state_below.
* src/xterm.h (top-level): Declare Xatom_net_wm_state_above,
Xatom_net_wm_state_below and Xatom_net_wm_state_skip_taskbar.
(x_set_skip_taskbar, x_set_z_group): Add extern declarations.
2017-04-12 08:38:25 +00:00
|
|
|
|
(while (and (not (eq frame sframe))
|
|
|
|
|
(not (eq (frame-visible-p frame) t)))
|
1993-08-03 03:33:14 +00:00
|
|
|
|
(setq frame (next-frame frame)))
|
|
|
|
|
(setq arg (1- arg)))
|
1993-08-02 22:18:34 +00:00
|
|
|
|
(while (< arg 0)
|
1993-08-03 03:33:14 +00:00
|
|
|
|
(setq frame (previous-frame frame))
|
Add new frame parameters and associated functions
Add new frame parameters `undecorated', `override-redirect',
`parent-frame', `skip-taskbar', `no-focus-on-map',
`no-accept-focus', `z-group', `delete-before', `no-other-frame',
`mouse-wheel-frame', `min-width', `min-height'. Add new
functions `frame-restack' and `frame-list-z-order'.
* lisp/cus-start.el (focus-follows-mouse): Adapt customization
type.
* lisp/frame.el (handle-delete-frame): Handle child and
`delete-before' frames.
(other-frame): Stop looking for other frame after one round.
(frame-list-z-order, frame-restack): New functions.
(delete-other-frames): Handle child frames.
* lisp/frameset.el (frameset-persistent-filter-alist)
(frameset--record-relationships): Handle `delete-before',
`parent-frame' and `mouse-wheel-frame' parameters. Rename
latter from `frameset--record-minibuffer-relationships'.
(frameset--restore-frame): Handle ‘parent-frame’ parameter
specially.
(frameset-restore): Handle `delete-before', `parent-frame' and
`mouse-wheel-frame' parameters.
* lisp/mwheel.el (mwheel-scroll): Handle `mouse-wheel-frame'
parameter.
* lisp/window.el (window--min-size-ignore-p): Fix doc-string.
(mouse-autoselect-window-select, handle-select-window): Major
rewrite. Try to not ignore errors. Handle auto-selection of
child frames and different values of `focus-follows-mouse'.
* src/frame.c (frame_windows_min_size): Handle new `min-width'
and `min-height' frame parameters.
(make_frame): Initialize new frame structure members.
(do_switch_frame): Don't reset internal_last_event_frame for
descendant frames.
(Fframe_parent, frame_ancestor_p, Fframe_ancestor_p): New
functions.
(candidate_frame): Don't return `no-other-frame' frame.
(other_frames): New function replacing other_visible_frames.
(delete_frame): Rewrite. Handle child and `delete-before' frames.
(Fmake_frame_invisible): Call other_frames.
(store_frame_param): Check `delete-before' and `parent-frame'
parameters for circular dependencies.
(frame_parms, syms_of_frame): Add entries for and define new
frame parameters.
(focus_follows_mouse): New meaningful value `auto-raise'.
* src/frame.h (z_group): New enumeration type.
(frame): New slots parent_frame, undecorated, override_redirect,
skip_taskbar, no_focus_on_map, no_accept_focus, z_group.
(fset_parent_frame): New inlined function.
(FRAME_UNDECORATED, FRAME_OVERRIDE_REDIRECT)
(FRAME_PARENT_FRAME, FRAME_SKIP_TASKBAR, FRAME_NO_FOCUS_ON_MAP)
(FRAME_NO_ACCEPT_FOCUS, FRAME_Z_GROUP, FRAME_Z_GROUP_NONE)
(FRAME_Z_GROUP_ABOVE, FRAME_Z_GROUP_ABOVE_SUSPENDED)
(FRAME_Z_GROUP_BELOW): New macros.
(frame_ancestor_p): Add declaration.
* src/gtkutil.c (xg_create_frame_widgets): Handle
`undecorated' and `override-redirect' frame parameters.
(x_wm_set_size_hint): None for child frames.
(xg_set_undecorated, xg_frame_restack, xg_set_skip_taskbar)
(xg_set_no_focus_on_map, xg_set_no_accept_focus)
(xg_set_override_redirect): New functions.
(xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos):
Don't let scrollbars obscure child frames.
* src/gtkutil.h: (xg_set_undecorated, xg_frame_restack)
(xg_set_skip_taskbar, xg_set_no_focus_on_map)
(xg_set_no_accept_focus, xg_set_override_redirect): Add extern
declarations.
* src/nsfns.m (ns_frame_parm_handlers): Add entries for new
frame parameters.
(Fx_create_frame): Install `min-width' and `min-height' frame
parameters.
* src/nsterm.m (mouseMoved:): Handle focus_follows_mouse change.
* src/w32fns.c (WS_EX_NOACTIVATE): Define if necessary.
(x_real_positions): Handle child frames.
(x_set_menu_bar_lines): Don't for child frames.
(x_set_undecorated, x_set_parent_frame, x_set_skip_taskbar)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_z_group): New functions.
(w32_createvscrollbar, w32_createhscrollbar): Don't draw
scroll bars over child frames.
(w32_createwindow): Handle new frame parameters and child frames.
(w32_wnd_proc): Let mouse clicks into a child frame activate
the frame. Try to handle the `no-accept-focus' parameter. Do
SetFocus when our window is brought to top or becomes the
foreground window.
(w32_window): Don't initialize menu bar for child frames.
(Fx_create_frame): Handle new frame parameters.
(x_create_tip_frame): Set explicit_parent slot.
(w32_dialog_in_progress): New function.
(Fx_file_dialog): Handle `z-group-above' frames.
(w32_frame_list_z_order, Fw32_frame_list_z_order)
(w32_frame_restack, Fw32_frame_restack): New functions.
(w32_frame_parm_handlers): Add entries for new frame
parameters.
* src/w32font.c (Fx_select_font): Handle `z-group-above'
frames during font selection dialogue.
* src/w32term.c (construct_mouse_wheel): Construct mouse wheel
event from F's w32 window.
(w32_mouse_position): Handle child frames.
(w32_set_vertical_scroll_bar, w32_set_horizontal_scroll_bar):
Don't draw scroll bars over child frames.
(w32_read_socket): Always erase background of child frames.
When generating SELECT_WINDOW_EVENTs handle new value of
`focus-follows-mouse' and handle `no-accept-focus' parameter.
Handle `mouse-wheel-frame' parameter.
(x_calc_absolute_position, x_set_offset, x_set_window_size):
Handle child frames.
(x_make_frame_visible): Handle child frames specially. Handle
`no-focus-on-map' parameter.
* src/w32term.h (w32_dialog_in_progress): Add external
declaration.
* src/xdisp.c (x_consider_frame_title, prepare_menu_bars): Not
for child frames.
* src/xfns.c (Xm/MwmUtil.h): Include for WM hints.
(PropMotifWmHints, PROP_MOTIF_WM_HINTS_ELEMENTS): Define for
non-Motif, non-GTK case.
(x_real_pos_and_offsets): Handle child frames.
(x_set_undecorated, x_set_parent_frame)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_override_redirect): New functions.
(x_set_menu_bar_lines): Not for child frames.
(x_window): Handle `undecorated' and `override_redirect' cases.
(Fx_create_frame): Handle new frame parameters.
(frame_geometry): Handle child frames and outer border.
(x_frame_list_z_order, Fx_frame_list_z_order)
(x_frame_restack, Fx_frame_restack): New functions.
(Fx_file_dialog, Fx_select_font): Set x_menu_set_in_use.
(x_frame_parm_handlers): Add entries for new frame parameters.
* src/xmenu.c (x_menu_set_in_use): Handle `z-group-above'
frames.
* src/xterm.c (x_set_frame_alpha): Don't set alpha of parent
for child frames.
(XTmouse_position): Handle child frames.
(x_scroll_bar_create, x_scroll_bar_expose): Don't let scroll
bars obscure child frames.
(handle_one_xevent): Handle child frame positions. If necessary
set `skip-taskbar' and reassign proper `z-group' when we are
mapped. When generating SELECT_WINDOW_EVENTs handle new value
of `focus-follows-mouse'. Handle `mouse-wheel-frame' parameter.
Let mouse clicks into a child frame activate the frame.
(x_calc_absolute_position, x_set_offset): Handle child frames
specially.
(x_set_skip_taskbar, x_set_z_group): New functions.
(x_make_frame_visible): Handle child frames.
(ATOM_REFS_INIT): Add entries for
Xatom_net_wm_state_skip_taskbar, Xatom_net_wm_state_above,
Xatom_net_wm_state_below.
* src/xterm.h (top-level): Declare Xatom_net_wm_state_above,
Xatom_net_wm_state_below and Xatom_net_wm_state_skip_taskbar.
(x_set_skip_taskbar, x_set_z_group): Add extern declarations.
2017-04-12 08:38:25 +00:00
|
|
|
|
(while (and (not (eq frame sframe))
|
|
|
|
|
(not (eq (frame-visible-p frame) t)))
|
1993-08-03 03:33:14 +00:00
|
|
|
|
(setq frame (previous-frame frame)))
|
1993-08-11 06:02:05 +00:00
|
|
|
|
(setq arg (1+ arg)))
|
2001-08-10 13:47:18 +00:00
|
|
|
|
(select-frame-set-input-focus frame)))
|
1997-12-01 14:22:04 +00:00
|
|
|
|
|
2020-06-21 23:17:02 +00:00
|
|
|
|
(defun other-frame-prefix ()
|
|
|
|
|
"Display the buffer of the next command in a new frame.
|
|
|
|
|
The next buffer is the buffer displayed by the next command invoked
|
|
|
|
|
immediately after this command (ignoring reading from the minibuffer).
|
|
|
|
|
Creates a new frame before displaying the buffer.
|
|
|
|
|
When `switch-to-buffer-obey-display-actions' is non-nil,
|
|
|
|
|
`switch-to-buffer' commands are also supported."
|
|
|
|
|
(interactive)
|
|
|
|
|
(display-buffer-override-next-command
|
|
|
|
|
(lambda (buffer alist)
|
|
|
|
|
(cons (display-buffer-pop-up-frame
|
|
|
|
|
buffer (append '((inhibit-same-window . t))
|
|
|
|
|
alist))
|
2020-07-18 23:43:18 +00:00
|
|
|
|
'frame))
|
|
|
|
|
nil "[other-frame]")
|
2020-06-21 23:17:02 +00:00
|
|
|
|
(message "Display next command buffer in a new frame..."))
|
|
|
|
|
|
2003-05-24 16:11:17 +00:00
|
|
|
|
(defun iconify-or-deiconify-frame ()
|
|
|
|
|
"Iconify the selected frame, or deiconify if it's currently an icon."
|
|
|
|
|
(interactive)
|
|
|
|
|
(if (eq (cdr (assq 'visibility (frame-parameters))) t)
|
|
|
|
|
(iconify-frame)
|
|
|
|
|
(make-frame-visible)))
|
|
|
|
|
|
Implemented suspending of emacsclient frames.
lib-src/emacsclient.c (quote_file_name): Renamed to quote_argument.
(unquote_argument, handle_sigcont, handle_sigtstp): New functions.
(out, in): New global variables for communicating with the Emacs process.
(init_signals): Set up handlers for SIGCONT, SIGTSTP and SIGTTOU.
(main): Changed out and in to global variables. Prepend `-eval' or
'-file' to each argument. Use fsync to force sending the strings to Emacs.
Removed obsolete -bad-version code. Support the -suspend command.
Cleaned up newline handling.
lisp/frame.el (suspend-frame): New function.
Substitute key definition of suspend-emacs with suspend-frame.
lisp/server.el (server-log): Cosmetic change in log format.
(server-handle-delete-tty, server-handle-delete-frame): Added logging.
(server-handle-suspend-tty, server-quote-arg): New functions.
(server-start): Install server-handle-suspend-tty.
(server-process-filter): Reorganized source code for clarity.
Implemented -resume, -suspend and -ignore commands.
lisp/term/x-win.el (x-initialize-window-system): Don't change the
binding of C-z.
src/cm.c: Replaced TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT calls with
their macro expansion.
src/dispnew.c: Ditto.
src/frame.c: Ditto.
src/keyboard.c: Ditto.
src/sysdep.c: Ditto.
src/keyboard.c (tty_read_avail_input): Don't read if the terminal is
suspended.
src/sysdep.c (discard_tty_input, init_sys_modes, reset_sys_modes): Ditto.
src/term.c (tty_set_terminal_modes, tty_reset_terminal_modes): Ditto.
src/term.c (Vsuspend_tty_functions, Vresume_tty_functions): New hooks.
(syms_of_term): Defvar them.
(term_init): Don't allow opening a new frame on a suspended tty device.
(Fsuspend_tty, Fresume_tty): New functions.
(syms_of_term): Defsubr them.
src/termchar.c (struct tty_display_info): Update documentation of
input and output.
(TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT): Removed.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-105
2004-02-28 01:23:39 +00:00
|
|
|
|
(defun suspend-frame ()
|
|
|
|
|
"Do whatever is right to suspend the current frame.
|
Reimplement and extend support for terminal-local environment variables.
* lisp/termdev.el: New file. Move terminal parameter-related functions
here from frame.el.
(terminal-getenv, with-terminal-environment): Reimplement and extend.
(terminal-setenv, terminal-setenv-internal): New functions.
* lisp/frame.el (make-frame-on-tty, framep-on-display, suspend-frame):
Extend doc string, update parameter names.
(terminal-id, terminal-parameter-alist, terminal-parameters)
(terminal-parameter-p, terminal-parameter, set-terminal-parameter)
(terminal-handle-delete-frame, terminal-getenv, terminal-getenv)
(with-terminal-environment): Move to termdev.el.
* lisp/loadup.el: Load termdev as well.
* lisp/Makefile.in (lisp, shortlisp): Add termdev.elc.
* lisp/makefile.MPW (shortlisp): Ditto.
* lisp/ebuff-menu.el (electric-buffer-menu-mode-map): Bind C-z to
`suspend-frame', not `suspend-emacs'.
* lisp/echistory.el (electric-history-map): Ditto.
* lisp/ebrowse.el (ebrowse-electric-list-mode-map): Ditto.
* lisp/ebrowse.el (ebrowse-electric-position-mode-map): Ditto.
* lisp/startup.el (normal-splash-screen): Use `save-buffers-kill-display'
instead of `save-buffers-kill-emacs'.
* lisp/x-win.el (x-initialize-window-system): Add 'global-ok option to
`terminal-getenv'.
* src/term.c (suspend-tty): Update doc string.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-456
2005-12-22 21:02:45 +00:00
|
|
|
|
Calls `suspend-emacs' if invoked from the controlling tty device,
|
|
|
|
|
`suspend-tty' from a secondary tty device, and
|
2019-04-03 19:57:16 +00:00
|
|
|
|
`iconify-or-deiconify-frame' from a graphical frame."
|
Implemented suspending of emacsclient frames.
lib-src/emacsclient.c (quote_file_name): Renamed to quote_argument.
(unquote_argument, handle_sigcont, handle_sigtstp): New functions.
(out, in): New global variables for communicating with the Emacs process.
(init_signals): Set up handlers for SIGCONT, SIGTSTP and SIGTTOU.
(main): Changed out and in to global variables. Prepend `-eval' or
'-file' to each argument. Use fsync to force sending the strings to Emacs.
Removed obsolete -bad-version code. Support the -suspend command.
Cleaned up newline handling.
lisp/frame.el (suspend-frame): New function.
Substitute key definition of suspend-emacs with suspend-frame.
lisp/server.el (server-log): Cosmetic change in log format.
(server-handle-delete-tty, server-handle-delete-frame): Added logging.
(server-handle-suspend-tty, server-quote-arg): New functions.
(server-start): Install server-handle-suspend-tty.
(server-process-filter): Reorganized source code for clarity.
Implemented -resume, -suspend and -ignore commands.
lisp/term/x-win.el (x-initialize-window-system): Don't change the
binding of C-z.
src/cm.c: Replaced TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT calls with
their macro expansion.
src/dispnew.c: Ditto.
src/frame.c: Ditto.
src/keyboard.c: Ditto.
src/sysdep.c: Ditto.
src/keyboard.c (tty_read_avail_input): Don't read if the terminal is
suspended.
src/sysdep.c (discard_tty_input, init_sys_modes, reset_sys_modes): Ditto.
src/term.c (tty_set_terminal_modes, tty_reset_terminal_modes): Ditto.
src/term.c (Vsuspend_tty_functions, Vresume_tty_functions): New hooks.
(syms_of_term): Defvar them.
(term_init): Don't allow opening a new frame on a suspended tty device.
(Fsuspend_tty, Fresume_tty): New functions.
(syms_of_term): Defsubr them.
src/termchar.c (struct tty_display_info): Update documentation of
input and output.
(TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT): Removed.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-105
2004-02-28 01:23:39 +00:00
|
|
|
|
(interactive)
|
2019-04-03 19:57:16 +00:00
|
|
|
|
(cond
|
|
|
|
|
((display-multi-frame-p) (iconify-or-deiconify-frame))
|
|
|
|
|
((eq (framep (selected-frame)) t)
|
|
|
|
|
(if (controlling-tty-p)
|
|
|
|
|
(suspend-emacs)
|
|
|
|
|
(suspend-tty)))
|
|
|
|
|
(t (suspend-emacs))))
|
Implemented suspending of emacsclient frames.
lib-src/emacsclient.c (quote_file_name): Renamed to quote_argument.
(unquote_argument, handle_sigcont, handle_sigtstp): New functions.
(out, in): New global variables for communicating with the Emacs process.
(init_signals): Set up handlers for SIGCONT, SIGTSTP and SIGTTOU.
(main): Changed out and in to global variables. Prepend `-eval' or
'-file' to each argument. Use fsync to force sending the strings to Emacs.
Removed obsolete -bad-version code. Support the -suspend command.
Cleaned up newline handling.
lisp/frame.el (suspend-frame): New function.
Substitute key definition of suspend-emacs with suspend-frame.
lisp/server.el (server-log): Cosmetic change in log format.
(server-handle-delete-tty, server-handle-delete-frame): Added logging.
(server-handle-suspend-tty, server-quote-arg): New functions.
(server-start): Install server-handle-suspend-tty.
(server-process-filter): Reorganized source code for clarity.
Implemented -resume, -suspend and -ignore commands.
lisp/term/x-win.el (x-initialize-window-system): Don't change the
binding of C-z.
src/cm.c: Replaced TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT calls with
their macro expansion.
src/dispnew.c: Ditto.
src/frame.c: Ditto.
src/keyboard.c: Ditto.
src/sysdep.c: Ditto.
src/keyboard.c (tty_read_avail_input): Don't read if the terminal is
suspended.
src/sysdep.c (discard_tty_input, init_sys_modes, reset_sys_modes): Ditto.
src/term.c (tty_set_terminal_modes, tty_reset_terminal_modes): Ditto.
src/term.c (Vsuspend_tty_functions, Vresume_tty_functions): New hooks.
(syms_of_term): Defvar them.
(term_init): Don't allow opening a new frame on a suspended tty device.
(Fsuspend_tty, Fresume_tty): New functions.
(syms_of_term): Defsubr them.
src/termchar.c (struct tty_display_info): Update documentation of
input and output.
(TTY_INPUT, TTY_OUTPUT, TTY_TERMSCRIPT): Removed.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-105
2004-02-28 01:23:39 +00:00
|
|
|
|
|
1997-12-01 14:22:04 +00:00
|
|
|
|
(defun make-frame-names-alist ()
|
2010-09-19 09:53:28 +00:00
|
|
|
|
;; Only consider the frames on the same display.
|
1997-12-01 14:22:04 +00:00
|
|
|
|
(let* ((current-frame (selected-frame))
|
|
|
|
|
(falist
|
|
|
|
|
(cons
|
|
|
|
|
(cons (frame-parameter current-frame 'name) current-frame) nil))
|
2010-09-19 09:53:28 +00:00
|
|
|
|
(frame (next-frame nil 0)))
|
1997-12-01 14:22:04 +00:00
|
|
|
|
(while (not (eq frame current-frame))
|
|
|
|
|
(progn
|
2010-09-19 09:53:28 +00:00
|
|
|
|
(push (cons (frame-parameter frame 'name) frame) falist)
|
|
|
|
|
(setq frame (next-frame frame 0))))
|
1997-12-01 14:22:04 +00:00
|
|
|
|
falist))
|
|
|
|
|
|
|
|
|
|
(defvar frame-name-history nil)
|
|
|
|
|
(defun select-frame-by-name (name)
|
2017-09-01 13:38:55 +00:00
|
|
|
|
"Select the frame whose name is NAME and raise it.
|
|
|
|
|
Frames on the current terminal are checked first.
|
1997-12-01 14:22:04 +00:00
|
|
|
|
If there is no frame by that name, signal an error."
|
|
|
|
|
(interactive
|
1998-04-23 22:15:47 +00:00
|
|
|
|
(let* ((frame-names-alist (make-frame-names-alist))
|
|
|
|
|
(default (car (car frame-names-alist)))
|
|
|
|
|
(input (completing-read
|
Use `format-prompt' when prompting with default values
* lisp/woman.el (woman-file-name):
* lisp/wid-edit.el (widget-file-prompt-value)
(widget-coding-system-prompt-value):
* lisp/w32-fns.el (w32-set-system-coding-system):
* lisp/vc/vc.el (vc-print-root-log):
* lisp/vc/vc-annotate.el (vc-annotate):
* lisp/vc/emerge.el (emerge-read-file-name):
* lisp/vc/ediff.el (ediff-directories)
(ediff-directory-revisions, ediff-directories3)
(ediff-merge-directories, )
(ediff-merge-directories-with-ancestor)
(ediff-merge-directory-revisions)
(ediff-merge-directory-revisions-with-ancestor)
(ediff-merge-revisions, ediff-merge-revisions-with-ancestor)
(ediff-revision):
* lisp/vc/ediff-util.el (ediff-toggle-regexp-match):
* lisp/vc/ediff-mult.el (ediff-filegroup-action):
* lisp/vc/add-log.el (prompt-for-change-log-name):
* lisp/textmodes/table.el (table-insert-row-column)
(table-span-cell, table-split-cell-horizontally)
(table-split-cell, table-justify, table-generate-source)
(table-insert-sequence, table-capture)
(table--read-from-minibuffer, table--query-justification):
* lisp/textmodes/sgml-mode.el (sgml-tag, sgml-tag-help):
* lisp/textmodes/reftex-ref.el (reftex-goto-label):
* lisp/textmodes/refer.el (refer-get-bib-files):
* lisp/textmodes/css-mode.el (css-lookup-symbol):
* lisp/term.el (serial-read-name, serial-read-speed):
* lisp/speedbar.el (speedbar-change-initial-expansion-list):
* lisp/simple.el (previous-matching-history-element)
(set-variable):
* lisp/ses.el (ses-read-cell, ses-set-column-width):
* lisp/replace.el (query-replace-read-from)
(occur-read-primary-args):
* lisp/rect.el (string-rectangle, string-insert-rectangle):
* lisp/progmodes/tcl.el (tcl-help-on-word):
* lisp/progmodes/sh-script.el (sh-set-shell):
* lisp/progmodes/python.el (python-eldoc-at-point):
* lisp/progmodes/octave.el (octave-completing-read)
(octave-update-function-file-comment, octave-insert-defun):
* lisp/progmodes/inf-lisp.el (lisp-symprompt):
* lisp/progmodes/cperl-mode.el (cperl-info-on-command)
(cperl-perldoc):
* lisp/progmodes/compile.el (compilation-find-file):
* lisp/net/rcirc.el (rcirc-prompt-for-encryption):
* lisp/net/eww.el (eww):
* lisp/net/browse-url.el (browse-url-with-browser-kind):
* lisp/man.el (man):
* lisp/mail/sendmail.el (sendmail-query-user-about-smtp):
* lisp/mail/mailalias.el (build-mail-aliases):
* lisp/mail/mailabbrev.el (merge-mail-abbrevs)
(rebuild-mail-abbrevs):
* lisp/locate.el (locate-prompt-for-search-string):
* lisp/isearch.el (isearch-occur):
* lisp/international/ogonek.el (ogonek-read-encoding)
(ogonek-read-prefix):
* lisp/international/mule.el (read-buffer-file-coding-system)
(set-terminal-coding-system, set-keyboard-coding-system)
(set-next-selection-coding-system, recode-region):
* lisp/international/mule-cmds.el ()
(universal-coding-system-argument, search-unencodable-char)
(select-safe-coding-system-interactively):
* lisp/info.el (Info-search, Info-search-backward, Info-menu):
* lisp/info-look.el (info-lookup-interactive-arguments):
* lisp/imenu.el (imenu--completion-buffer):
* lisp/ibuf-ext.el (mode, used-mode, ibuffer-mark-by-mode):
* lisp/hi-lock.el (hi-lock-unface-buffer)
(hi-lock-read-face-name):
* lisp/help.el (view-emacs-news, where-is):
* lisp/help-fns.el (describe-variable, describe-symbol)
(describe-keymap):
* lisp/gnus/mm-decode.el (mm-save-part):
* lisp/gnus/gnus-sum.el (gnus-summary-browse-url):
* lisp/gnus/gnus-group.el (gnus-group--read-bug-ids)
(gnus-group-set-current-level):
* lisp/frame.el (make-frame-on-monitor)
(close-display-connection, select-frame-by-name):
* lisp/format.el (format-encode-buffer, format-encode-region):
* lisp/files.el (recode-file-name):
* lisp/files-x.el (read-file-local-variable)
(read-file-local-variable-value, )
(read-file-local-variable-mode):
* lisp/ffap.el (ffap-menu-ask):
* lisp/faces.el (face-read-string):
* lisp/facemenu.el (facemenu-set-charset):
* lisp/erc/erc-dcc.el (erc-dcc-do-GET-command):
* lisp/emulation/edt-mapper.el (edt-mapper):
* lisp/emacs-lisp/trace.el (trace--read-args)
(trace-function-foreground, trace-function-background):
* lisp/emacs-lisp/smie.el (smie-config-set-indent):
* lisp/emacs-lisp/re-builder.el (reb-change-syntax):
* lisp/emacs-lisp/package.el (describe-package):
* lisp/emacs-lisp/find-func.el (read-library-name)
(find-function-read):
* lisp/emacs-lisp/ert.el (ert-read-test-name)
(ert-run-tests-interactively):
* lisp/emacs-lisp/disass.el (disassemble):
* lisp/emacs-lisp/debug.el (debug-on-entry)
(debug-on-variable-change):
* lisp/emacs-lisp/advice.el (ad-read-advised-function)
(ad-read-advice-class, ad-read-advice-name, ad-read-regexp):
* lisp/dired-x.el (dired--mark-suffix-interactive-spec):
* lisp/dired-aux.el (dired-diff):
* lisp/cus-edit.el (custom-variable-prompt, customize-mode)
(customize-changed-options):
* lisp/completion.el (interactive-completion-string-reader):
* lisp/calendar/timeclock.el (timeclock-ask-for-project):
* lisp/calc/calcalg3.el (calc-get-fit-variables):
* lisp/calc/calc-store.el (calc-edit-variable):
* lisp/calc/calc-bin.el (calc-word-size):
* lisp/bookmark.el (bookmark-set-internal):
* lisp/abbrev.el (read-abbrev-file): Use `format-prompt' for
prompting (bug#12443).
2020-09-06 14:56:44 +00:00
|
|
|
|
(format-prompt "Select Frame" default)
|
1998-04-23 22:15:47 +00:00
|
|
|
|
frame-names-alist nil t nil 'frame-name-history)))
|
1997-12-01 14:22:04 +00:00
|
|
|
|
(if (= (length input) 0)
|
|
|
|
|
(list default)
|
|
|
|
|
(list input))))
|
2017-09-01 13:38:55 +00:00
|
|
|
|
(select-frame-set-input-focus
|
|
|
|
|
;; Prefer frames on the current display.
|
|
|
|
|
(or (cdr (assoc name (make-frame-names-alist)))
|
|
|
|
|
(catch 'done
|
|
|
|
|
(dolist (frame (frame-list))
|
|
|
|
|
(when (equal (frame-parameter frame 'name) name)
|
|
|
|
|
(throw 'done frame))))
|
|
|
|
|
(error "There is no frame named `%s'" name))))
|
2011-07-03 22:16:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;;;; Background mode.
|
|
|
|
|
|
|
|
|
|
(defcustom frame-background-mode nil
|
|
|
|
|
"The brightness of the background.
|
|
|
|
|
Set this to the symbol `dark' if your background color is dark,
|
|
|
|
|
`light' if your background is light, or nil (automatic by default)
|
2013-09-01 01:29:50 +00:00
|
|
|
|
if you want Emacs to examine the brightness for you.
|
|
|
|
|
|
2013-09-01 01:32:41 +00:00
|
|
|
|
If you change this without using customize, you should use
|
2013-09-01 01:52:54 +00:00
|
|
|
|
`frame-set-background-mode' to update existing frames;
|
2015-11-17 23:28:50 +00:00
|
|
|
|
e.g. (mapc \\='frame-set-background-mode (frame-list))."
|
2011-07-03 22:16:07 +00:00
|
|
|
|
:group 'faces
|
2021-10-22 05:41:55 +00:00
|
|
|
|
:set #'(lambda (var value)
|
|
|
|
|
(set-default var value)
|
|
|
|
|
(mapc #'frame-set-background-mode (frame-list)))
|
2021-04-12 16:32:07 +00:00
|
|
|
|
:initialize #'custom-initialize-changed
|
2011-07-03 22:16:07 +00:00
|
|
|
|
:type '(choice (const dark)
|
|
|
|
|
(const light)
|
|
|
|
|
(const :tag "automatic" nil)))
|
|
|
|
|
|
|
|
|
|
(declare-function x-get-resource "frame.c"
|
|
|
|
|
(attribute class &optional component subclass))
|
|
|
|
|
|
2013-09-18 02:50:04 +00:00
|
|
|
|
;; Only used if window-system is not null.
|
|
|
|
|
(declare-function x-display-grayscale-p "xfns.c" (&optional terminal))
|
|
|
|
|
|
2011-07-03 22:16:07 +00:00
|
|
|
|
(defvar inhibit-frame-set-background-mode nil)
|
|
|
|
|
|
2021-04-12 16:32:07 +00:00
|
|
|
|
(defun frame--current-backround-mode (frame)
|
|
|
|
|
(let* ((frame-default-bg-mode (frame-terminal-default-bg-mode frame))
|
|
|
|
|
(bg-color (frame-parameter frame 'background-color))
|
|
|
|
|
(tty-type (tty-type frame))
|
|
|
|
|
(default-bg-mode
|
|
|
|
|
(if (or (window-system frame)
|
|
|
|
|
(and tty-type
|
|
|
|
|
(string-match "^\\(xterm\\|rxvt\\|dtterm\\|eterm\\)"
|
|
|
|
|
tty-type)))
|
|
|
|
|
'light
|
|
|
|
|
'dark)))
|
|
|
|
|
(cond (frame-default-bg-mode)
|
|
|
|
|
((equal bg-color "unspecified-fg") ; inverted colors
|
|
|
|
|
(if (eq default-bg-mode 'light) 'dark 'light))
|
|
|
|
|
((not (color-values bg-color frame))
|
|
|
|
|
default-bg-mode)
|
|
|
|
|
((color-dark-p (mapcar (lambda (c) (/ c 65535.0))
|
|
|
|
|
(color-values bg-color frame)))
|
|
|
|
|
'dark)
|
|
|
|
|
(t 'light))))
|
|
|
|
|
|
2011-07-03 22:16:07 +00:00
|
|
|
|
(defun frame-set-background-mode (frame &optional keep-face-specs)
|
|
|
|
|
"Set up display-dependent faces on FRAME.
|
|
|
|
|
Display-dependent faces are those which have different definitions
|
|
|
|
|
according to the `background-mode' and `display-type' frame parameters.
|
|
|
|
|
|
|
|
|
|
If optional arg KEEP-FACE-SPECS is non-nil, don't recalculate
|
|
|
|
|
face specs for the new background mode."
|
|
|
|
|
(unless inhibit-frame-set-background-mode
|
2021-04-12 16:32:07 +00:00
|
|
|
|
(let* ((bg-mode
|
|
|
|
|
(frame--current-backround-mode frame))
|
2011-07-03 22:16:07 +00:00
|
|
|
|
(display-type
|
|
|
|
|
(cond ((null (window-system frame))
|
|
|
|
|
(if (tty-display-color-p frame) 'color 'mono))
|
|
|
|
|
((display-color-p frame)
|
|
|
|
|
'color)
|
|
|
|
|
((x-display-grayscale-p frame)
|
|
|
|
|
'grayscale)
|
|
|
|
|
(t 'mono)))
|
|
|
|
|
(old-bg-mode
|
|
|
|
|
(frame-parameter frame 'background-mode))
|
|
|
|
|
(old-display-type
|
|
|
|
|
(frame-parameter frame 'display-type)))
|
|
|
|
|
|
|
|
|
|
(unless (and (eq bg-mode old-bg-mode) (eq display-type old-display-type))
|
|
|
|
|
(let ((locally-modified-faces nil)
|
|
|
|
|
;; Prevent face-spec-recalc from calling this function
|
|
|
|
|
;; again, resulting in a loop (bug#911).
|
|
|
|
|
(inhibit-frame-set-background-mode t)
|
|
|
|
|
(params (list (cons 'background-mode bg-mode)
|
|
|
|
|
(cons 'display-type display-type))))
|
|
|
|
|
(if keep-face-specs
|
|
|
|
|
(modify-frame-parameters frame params)
|
|
|
|
|
;; If we are recomputing face specs, first collect a list
|
|
|
|
|
;; of faces that don't match their face-specs. These are
|
|
|
|
|
;; the faces modified on FRAME, and we avoid changing them
|
|
|
|
|
;; below. Use a negative list to avoid consing (we assume
|
|
|
|
|
;; most faces are unmodified).
|
|
|
|
|
(dolist (face (face-list))
|
|
|
|
|
(and (not (get face 'face-override-spec))
|
2019-03-04 16:28:18 +00:00
|
|
|
|
(not (and
|
|
|
|
|
;; If the face was not yet realized for the
|
|
|
|
|
;; frame, face-spec-match-p will signal an
|
|
|
|
|
;; error, so treat such a missing face as
|
|
|
|
|
;; having a mismatched spec; the call to
|
|
|
|
|
;; face-spec-recalc below will then realize
|
|
|
|
|
;; the face for the frame. This happens
|
|
|
|
|
;; during startup with -rv on the command
|
|
|
|
|
;; line for the initial frame, because frames
|
|
|
|
|
;; are not recorded in the pdump file.
|
2021-07-21 14:01:03 +00:00
|
|
|
|
(gethash face (frame--face-hash-table))
|
2019-03-04 16:28:18 +00:00
|
|
|
|
(face-spec-match-p face
|
|
|
|
|
(face-user-default-spec face)
|
2020-10-07 07:02:20 +00:00
|
|
|
|
frame)))
|
2011-07-03 22:16:07 +00:00
|
|
|
|
(push face locally-modified-faces)))
|
|
|
|
|
;; Now change to the new frame parameters
|
|
|
|
|
(modify-frame-parameters frame params)
|
|
|
|
|
;; For all unmodified named faces, choose face specs
|
|
|
|
|
;; matching the new frame parameters.
|
|
|
|
|
(dolist (face (face-list))
|
|
|
|
|
(unless (memq face locally-modified-faces)
|
|
|
|
|
(face-spec-recalc face frame)))))))))
|
|
|
|
|
|
|
|
|
|
(defun frame-terminal-default-bg-mode (frame)
|
|
|
|
|
"Return the default background mode of FRAME.
|
|
|
|
|
This checks the `frame-background-mode' variable, the X resource
|
|
|
|
|
named \"backgroundMode\" (if FRAME is an X frame), and finally
|
|
|
|
|
the `background-mode' terminal parameter."
|
|
|
|
|
(or frame-background-mode
|
|
|
|
|
(let ((bg-resource
|
|
|
|
|
(and (window-system frame)
|
|
|
|
|
(x-get-resource "backgroundMode" "BackgroundMode"))))
|
|
|
|
|
(if bg-resource
|
|
|
|
|
(intern (downcase bg-resource))))
|
|
|
|
|
(terminal-parameter frame 'background-mode)))
|
|
|
|
|
|
2021-04-12 16:32:07 +00:00
|
|
|
|
;; FIXME: This needs to be significantly improved before we can use it:
|
|
|
|
|
;; - Fix the "scope" to be consistent: the code below is partly per-frame
|
|
|
|
|
;; and partly all-frames :-(
|
|
|
|
|
;; - Make it interact correctly with color themes (e.g. modus-themes).
|
|
|
|
|
;; Maybe automatically disabling color themes that disagree with the
|
|
|
|
|
;; selected value of `dark-mode'.
|
|
|
|
|
;; - Check interaction with "(in|re)verse-video".
|
|
|
|
|
;;
|
|
|
|
|
;; (define-minor-mode dark-mode
|
|
|
|
|
;; "Use light text on dark background."
|
|
|
|
|
;; :global t
|
|
|
|
|
;; :group 'faces
|
|
|
|
|
;; (when (eq dark-mode
|
|
|
|
|
;; (eq 'light (frame--current-backround-mode (selected-frame))))
|
|
|
|
|
;; ;; FIXME: Change the face's SPEC instead?
|
|
|
|
|
;; (set-face-attribute 'default nil
|
|
|
|
|
;; :foreground (face-attribute 'default :background)
|
|
|
|
|
;; :background (face-attribute 'default :foreground))
|
|
|
|
|
;; (frame-set-background-mode (selected-frame))))
|
|
|
|
|
|
1992-07-10 02:33:41 +00:00
|
|
|
|
|
1992-07-15 00:32:19 +00:00
|
|
|
|
;;;; Frame configurations
|
|
|
|
|
|
|
|
|
|
(defun current-frame-configuration ()
|
|
|
|
|
"Return a list describing the positions and states of all frames.
|
1993-03-15 08:51:02 +00:00
|
|
|
|
Its car is `frame-configuration'.
|
|
|
|
|
Each element of the cdr is a list of the form (FRAME ALIST WINDOW-CONFIG),
|
|
|
|
|
where
|
|
|
|
|
FRAME is a frame object,
|
|
|
|
|
ALIST is an association list specifying some of FRAME's parameters, and
|
|
|
|
|
WINDOW-CONFIG is a window configuration object for FRAME."
|
|
|
|
|
(cons 'frame-configuration
|
2007-07-25 19:37:21 +00:00
|
|
|
|
(mapcar (lambda (frame)
|
|
|
|
|
(list frame
|
|
|
|
|
(frame-parameters frame)
|
|
|
|
|
(current-window-configuration frame)))
|
1993-03-15 08:51:02 +00:00
|
|
|
|
(frame-list))))
|
1992-07-15 00:32:19 +00:00
|
|
|
|
|
1993-09-07 00:53:48 +00:00
|
|
|
|
(defun set-frame-configuration (configuration &optional nodelete)
|
1992-07-15 00:32:19 +00:00
|
|
|
|
"Restore the frames to the state described by CONFIGURATION.
|
|
|
|
|
Each frame listed in CONFIGURATION has its position, size, window
|
1993-09-07 00:53:48 +00:00
|
|
|
|
configuration, and other parameters set as specified in CONFIGURATION.
|
2004-07-23 12:20:22 +00:00
|
|
|
|
However, this function does not restore deleted frames.
|
|
|
|
|
|
1993-11-07 08:10:46 +00:00
|
|
|
|
Ordinarily, this function deletes all existing frames not
|
|
|
|
|
listed in CONFIGURATION. But if optional second argument NODELETE
|
1993-11-08 13:14:05 +00:00
|
|
|
|
is given and non-nil, the unwanted frames are iconified instead."
|
1993-03-15 08:51:02 +00:00
|
|
|
|
(or (frame-configuration-p configuration)
|
|
|
|
|
(signal 'wrong-type-argument
|
|
|
|
|
(list 'frame-configuration-p configuration)))
|
|
|
|
|
(let ((config-alist (cdr configuration))
|
|
|
|
|
frames-to-delete)
|
2007-07-25 19:37:21 +00:00
|
|
|
|
(dolist (frame (frame-list))
|
|
|
|
|
(let ((parameters (assq frame config-alist)))
|
|
|
|
|
(if parameters
|
|
|
|
|
(progn
|
|
|
|
|
(modify-frame-parameters
|
|
|
|
|
frame
|
|
|
|
|
;; Since we can't set a frame's minibuffer status,
|
|
|
|
|
;; we might as well omit the parameter altogether.
|
|
|
|
|
(let* ((parms (nth 1 parameters))
|
2007-10-15 02:07:53 +00:00
|
|
|
|
(mini (assq 'minibuffer parms))
|
|
|
|
|
(name (assq 'name parms))
|
|
|
|
|
(explicit-name (cdr (assq 'explicit-name parms))))
|
|
|
|
|
(when mini (setq parms (delq mini parms)))
|
|
|
|
|
;; Leave name in iff it was set explicitly.
|
|
|
|
|
;; This should fix the behavior reported in
|
2017-11-26 06:45:41 +00:00
|
|
|
|
;; https://lists.gnu.org/r/emacs-devel/2007-08/msg01632.html
|
2007-10-15 02:07:53 +00:00
|
|
|
|
(when (and name (not explicit-name))
|
|
|
|
|
(setq parms (delq name parms)))
|
2007-07-25 19:37:21 +00:00
|
|
|
|
parms))
|
|
|
|
|
(set-window-configuration (nth 2 parameters)))
|
|
|
|
|
(setq frames-to-delete (cons frame frames-to-delete)))))
|
|
|
|
|
(mapc (if nodelete
|
|
|
|
|
;; Note: making frames invisible here was tried
|
|
|
|
|
;; but led to some strange behavior--each time the frame
|
|
|
|
|
;; was made visible again, the window manager asked afresh
|
|
|
|
|
;; for where to put it.
|
|
|
|
|
'iconify-frame
|
|
|
|
|
'delete-frame)
|
|
|
|
|
frames-to-delete)))
|
1991-08-15 21:29:06 +00:00
|
|
|
|
|
1992-07-15 00:32:19 +00:00
|
|
|
|
;;;; Convenience functions for accessing and interactively changing
|
|
|
|
|
;;;; frame parameters.
|
1991-08-15 21:29:06 +00:00
|
|
|
|
|
1992-07-21 04:09:28 +00:00
|
|
|
|
(defun frame-height (&optional frame)
|
1992-07-15 00:32:19 +00:00
|
|
|
|
"Return number of lines available for display on FRAME.
|
2009-10-10 23:50:10 +00:00
|
|
|
|
If FRAME is omitted, describe the currently selected frame.
|
|
|
|
|
Exactly what is included in the return value depends on the
|
|
|
|
|
window-system and toolkit in use - see `frame-pixel-height' for
|
|
|
|
|
more details. The lines are in units of the default font height.
|
|
|
|
|
|
|
|
|
|
The result is roughly related to the frame pixel height via
|
|
|
|
|
height in pixels = height in lines * `frame-char-height'.
|
|
|
|
|
However, this is only approximate, and is complicated e.g. by the
|
|
|
|
|
fact that individual window lines and menu bar lines can have
|
|
|
|
|
differing font heights."
|
1992-07-21 04:09:28 +00:00
|
|
|
|
(cdr (assq 'height (frame-parameters frame))))
|
1992-07-15 00:32:19 +00:00
|
|
|
|
|
|
|
|
|
(defun frame-width (&optional frame)
|
|
|
|
|
"Return number of columns available for display on FRAME.
|
|
|
|
|
If FRAME is omitted, describe the currently selected frame."
|
1992-07-21 04:09:28 +00:00
|
|
|
|
(cdr (assq 'width (frame-parameters frame))))
|
1992-07-15 00:32:19 +00:00
|
|
|
|
|
2021-04-12 16:32:07 +00:00
|
|
|
|
(defalias 'frame-border-width #'frame-internal-border-width)
|
|
|
|
|
(defalias 'frame-pixel-width #'frame-native-width)
|
|
|
|
|
(defalias 'frame-pixel-height #'frame-native-height)
|
Provide additional support for child frames
Provide mouse dragging and resizing of frames. Allow resizing
frames proportionally. Provide additional functionality for
child frames. Minor bug fixes.
* lisp/frame.el (frame-border-width, frame-pixel-width)
(frame-pixel-height): Alias to `frame-internal-border-width',
`frame-native-width' and `frame-native-height'.
(frame-inner-width, frame-inner-height, frame-outer-width)
(frame-outer-height): New functions.
* lisp/minibuffer.el (completion-auto-help): Fix typo.
* lisp/mouse.el (mouse-drag-line, mouse-drag-mode-line)
(mouse-drag-header-line): Allow moving a frame by dragging the
mode line of its bottommost window (on a minibuffer-less frame)
or the header line of its topmost window.
(mouse-drag-vertical-line): Mention argument in doc-string.
(mouse-resize-frame, mouse-drag-frame, mouse-drag-left-edge)
(mouse-drag-top-left-corner, mouse-drag-top-edge)
(mouse-drag-top-right-corner, mouse-drag-right-edge)
(mouse-drag-bottom-right-corner, mouse-drag-bottom-edge)
(mouse-drag-bottom-left-corner): New functions for resizing a
frame by dragging its internal border together with
corresponding key bindings.
* lisp/tooltip.el (tooltip-frame-parameters): Add
'no-special-glyphs' to default parameters and update version
tag.
* lisp/window.el (frame-auto-hide-function): Add choice to make
frame invisible and update version tag.
(window--delete): Handle 'auto-hide-function' frame parameter.
(window--maybe-raise-frame): Respect 'no-focus-on-map' and
'no-accept-focus' frame parameters.
(display-buffer--action-function-custom-type): Add
`display-buffer-in-child-frame'.
(display-buffer): Mention `display-buffer-in-child-frame' in
doc-string.
(display-buffer-in-child-frame): New action function for
`display-buffer'.
(window--sanitize-margin): Return zero when MARGIN cannot be
sanitized.
(fit-frame-to-buffer): Major rewrite to handle child frames and
'fit-frame-to-buffer-sizes' and 'fit-frame-to-buffer-margins'
frame parameters.
(window-largest-empty-rectangle--maximums-1)
(window-largest-empty-rectangle--maximums)
(window-largest-empty-rectangle--disjoint-maximums)
(window-largest-empty-rectangle): New functions.
* src/dispextern.h (WINDOW_WANTS_MODELINE_P)
(WINDOW_WANTS_HEADER_LINE_P): Remove. Functionality is now
provided by corresponding functions window_wants_modeline and
window_wants_header_line in window.c. Adjust users.
* src/dispnew.c (adjust_glyph_matrix)
(buffer_posn_from_coords): Use window_wants_modeline and
window_wants_header_line instead of WINDOW_WANTS_MODELINE_P and
WINDOW_WANTS_HEADER_LINE_P.
* src/frame.c (keep_ratio): New function.
(adjust_frame_size): Call keep_ratio for each of F's child
frames.
(make_frame): Initialize no_special_glyphs slot.
(frame_internal_border_part): New function.
(Fframe_pixel_width, Fframe_pixel_height, Fborder_width): Rename
to Fframe_native_width, Fframe_native_height mand
Fframe_internal_border_width.
(frame_parm_table): Add Qno_special_glyphs entry.
(frame_float_type): New enumeration type.
(frame_float): New function to handle frame size and position
ratios.
(x_set_frame_parameters): Handle size and position ratios.
(x_set_no_special_glyphs): New function
(x_figure_window_size): Handle size and position ratios.
(syms_of_frame): Add Qdisplay_monitor_attributes_list,
Qno_special_glyphs, Qframe_edges, Qkeep_ratio, Qwidth_only,
Qheight_only, Qleft_only and Qtop_only.
* src/frame.h (internal_border_part): New enumeration type.
(struct frame): New slot no_special_glyphs.
(FRAME_NO_SPECIAL_GLYPHS): New macro.
* src/gtkutil.c (xg_frame_restack): Return immediately for
GTK versions before 2.18.0.
* src/keyboard.c (internal_border_parts): New array constant.
(make_lispy_position): For frames with border dragging enabled
return internal border part.
(syms_of_keyboard): New symbols Qdrag_internal_border,
Qleft_edge, Qtop_left_corner, Qtop_edge, Qtop_right_corner,
Qright_edge, Qbottom_right_corner, Qbottom_edge and
Qbottom_left_corner.
* src/minibuf.c (read_minibuf_unwind): When exiting the
minibuffer deal with frames that have the 'minibuffer-exit'
parameter set.
(syms_of_minibuf): New symbol Qminibuffer_exit.
* src/nsfns.m (frame_parm_handler): Add entry for
x_set_no_special_glyphs.
(Fx_create_frame): Handle 'no-special-glyphs' parameter.
Intitialize new cursor types for dragging frame borders.
* src/nsterm.h (struct ns_output): Add new cursor types for
dragging frame borders.
* src/w32fns.c (w32_frame_parm_handlers): Add entry for
x_set_no_special_glyphs.
(Fx_create_frame): Handle 'no-special-glyphs' parameter.
Intitialize new cursor types for dragging frame borders.
* src/w32term.h (struct w32_output): Add new cursor types for
dragging frame borders.
* src/window.c (coordinates_in_window)
(Fwindow_line_height, window_internal_height): Use
window_wants_modeline and window_wants_header_line instead of
WINDOW_WANTS_MODELINE_P and WINDOW_WANTS_HEADER_LINE_P.
(Fwindow_lines_pixel_dimensions): New function.
(window_parameter): New function.
(Fwindow_parameter): Call window_parameter.
(window_wants_mode_line, window_wants_header_line): New
functions replacing the macros WINDOW_WANTS_MODELINE_P and
WINDOW_WANTS_HEADER_LINE_P from dispextern.h.
(syms_of_window): New symbols Qmode_line_format and
Qheader_line_format.
* src/window.h: Reorganize and re-comment macros. Use
window_wants_modeline and window_wants_header_line instead of
WINDOW_WANTS_MODELINE_P and WINDOW_WANTS_HEADER_LINE_P.
(MINI_NON_ONLY_WINDOW_P, MINI_ONLY_WINDOW_P): Minor rewrite.
(WINDOW_BUFFER): New macro.
(WINDOW_BOX_LEFT_EDGE_COL, WINDOW_BOX_RIGHT_EDGE_COL): Remove.
* src/xdisp.c (window_text_bottom_y, window_box_height)
(window_box, start_display)
(compute_window_start_on_continuation_line)
(try_cursor_movement, redisplay_window)
(try_window_reusing_current_matrix, try_window_id)
(display_line, expose_window): Use window_wants_modeline and
window_wants_header_line instead of WINDOW_WANTS_MODELINE_P and
WINDOW_WANTS_HEADER_LINE_P.
(pos_visible_p, display_mode_lines): Respect W's
'mode-line-format' and 'header-line-format' window parameters.
(init_iterator): Use window_wants_modeline and
window_wants_header_line instead of WINDOW_WANTS_MODELINE_P and
WINDOW_WANTS_HEADER_LINE_P. For tip frames respect
no_special_glyphs value.
(note_mouse_highlight): Set frame border cursors when on
internal border.
(x_draw_right_divider, x_draw_bottom_divider): Try to improve
drawing of window dividers.
* src/xfns.c (mouse_cursor): Add entries for border parts.
(mouse_cursor_types): Add entries for cursor types to drag
frame borders.
(INSTALL_CURSOR): Add entries for new cursor types to drag
frame borders.
(Fx_create_frame): Handle 'no-special-glyphs' parameter.
(x_frame_parm_handlers): Add entry for
x_set_no_special_glyphs.
(Vx_window_left_edge_shape, Vx_window_top_left_corner_shape)
(Vx_window_top_edge_shape, Vx_window_top_right_corner_shape)
(Vx_window_right_edge_shape)
(Vx_window_bottom_right_corner_shape)
(Vx_window_bottom_edge_shape)
(Vx_window_bottom_left_corner_shape): New variables.
(x_frame_restack): Call xg_frame_restack only for GTK versions
starting with 2.18.0.
* src/xterm.c (x_free_frame_resources): Remove new cursors for
dragging frame borders.
* src/xterm.h (struct x_output): Add new cursor types for
dragging frame borders.
* doc/lispref/display.texi (Size of Displayed Text): Document
`window-lines-pixel-dimensions'.
* doc/lispref/elisp.texi (Top): Add entry for "Mouse Dragging
Parameters".
* doc/lispref/frames.texi (Frame Size): Replace
frame-pixel-width/-height by frame-native-width/-height. Add
frame-inner-width/-height and frame-outer-width/-height docs.
(Position Parameters): Describe specifying position as ratios.
Clarify remark about positions relative to bottom/ridge display
edge.
(Size Parameters): Describe specifying sizes as ratios.
Describe 'fit-frame-to-buffer-margins' and
'fit-frame-to-buffer-sizes' parameters.
(Layout Parameters): Describe 'no-special-glyphs' parameter.
(Frame Interaction Parameters): Describe 'auto-hide-function',
'minibuffer-exit' and 'keep-ratio' parameters.
(Mouse Dragging Parameters): New section describing
'drag-internal-border', 'drag-with-header-line',
'drag-with-mode-line', 'snap-width', 'top-visible' and
'bottom-visible' parameters.
(Management Parameters): Mention that `override-redirect' has
no effect on MS Windows.
(Font and Color Parameters): Mention child frames for `alpha'
parameter.
(Child Frames): Rewrite section with description and cross
references to new frame parameters added.
* doc/lispref/modes.texi (Mode Line Basics): Mention
'mode-line-format' and 'header-line-format' window parameters.
* doc/lispref/windows.texi (Resizing Windows): Mention effect
of `fit-frame-to-buffer-margins' for child frames.
(Display Action Functions): New action function
`display-buffer-in-child-frame'.
(Quitting Windows): Mention `make-frame-invisible' as optional
value of `frame-auto-hide-function' and `auto-hide-function'
frame paameter.
(Coordinates and Windows): Describe new function
`window-largest-empty-rectangle'.
(Window Parameters): Describe new parameters 'mode-line-format'
and 'header-line-format'. Index all window parameters described
in this section.
2017-06-25 09:33:25 +00:00
|
|
|
|
|
|
|
|
|
(defun frame-inner-width (&optional frame)
|
|
|
|
|
"Return inner width of FRAME in pixels.
|
|
|
|
|
FRAME defaults to the selected frame."
|
|
|
|
|
(setq frame (window-normalize-frame frame))
|
|
|
|
|
(- (frame-native-width frame)
|
|
|
|
|
(* 2 (frame-internal-border-width frame))))
|
|
|
|
|
|
|
|
|
|
(defun frame-inner-height (&optional frame)
|
|
|
|
|
"Return inner height of FRAME in pixels.
|
|
|
|
|
FRAME defaults to the selected frame."
|
|
|
|
|
(setq frame (window-normalize-frame frame))
|
|
|
|
|
(- (frame-native-height frame)
|
2021-03-18 21:39:05 +00:00
|
|
|
|
(if (fboundp 'tab-bar-height) (tab-bar-height frame t) 0)
|
Provide additional support for child frames
Provide mouse dragging and resizing of frames. Allow resizing
frames proportionally. Provide additional functionality for
child frames. Minor bug fixes.
* lisp/frame.el (frame-border-width, frame-pixel-width)
(frame-pixel-height): Alias to `frame-internal-border-width',
`frame-native-width' and `frame-native-height'.
(frame-inner-width, frame-inner-height, frame-outer-width)
(frame-outer-height): New functions.
* lisp/minibuffer.el (completion-auto-help): Fix typo.
* lisp/mouse.el (mouse-drag-line, mouse-drag-mode-line)
(mouse-drag-header-line): Allow moving a frame by dragging the
mode line of its bottommost window (on a minibuffer-less frame)
or the header line of its topmost window.
(mouse-drag-vertical-line): Mention argument in doc-string.
(mouse-resize-frame, mouse-drag-frame, mouse-drag-left-edge)
(mouse-drag-top-left-corner, mouse-drag-top-edge)
(mouse-drag-top-right-corner, mouse-drag-right-edge)
(mouse-drag-bottom-right-corner, mouse-drag-bottom-edge)
(mouse-drag-bottom-left-corner): New functions for resizing a
frame by dragging its internal border together with
corresponding key bindings.
* lisp/tooltip.el (tooltip-frame-parameters): Add
'no-special-glyphs' to default parameters and update version
tag.
* lisp/window.el (frame-auto-hide-function): Add choice to make
frame invisible and update version tag.
(window--delete): Handle 'auto-hide-function' frame parameter.
(window--maybe-raise-frame): Respect 'no-focus-on-map' and
'no-accept-focus' frame parameters.
(display-buffer--action-function-custom-type): Add
`display-buffer-in-child-frame'.
(display-buffer): Mention `display-buffer-in-child-frame' in
doc-string.
(display-buffer-in-child-frame): New action function for
`display-buffer'.
(window--sanitize-margin): Return zero when MARGIN cannot be
sanitized.
(fit-frame-to-buffer): Major rewrite to handle child frames and
'fit-frame-to-buffer-sizes' and 'fit-frame-to-buffer-margins'
frame parameters.
(window-largest-empty-rectangle--maximums-1)
(window-largest-empty-rectangle--maximums)
(window-largest-empty-rectangle--disjoint-maximums)
(window-largest-empty-rectangle): New functions.
* src/dispextern.h (WINDOW_WANTS_MODELINE_P)
(WINDOW_WANTS_HEADER_LINE_P): Remove. Functionality is now
provided by corresponding functions window_wants_modeline and
window_wants_header_line in window.c. Adjust users.
* src/dispnew.c (adjust_glyph_matrix)
(buffer_posn_from_coords): Use window_wants_modeline and
window_wants_header_line instead of WINDOW_WANTS_MODELINE_P and
WINDOW_WANTS_HEADER_LINE_P.
* src/frame.c (keep_ratio): New function.
(adjust_frame_size): Call keep_ratio for each of F's child
frames.
(make_frame): Initialize no_special_glyphs slot.
(frame_internal_border_part): New function.
(Fframe_pixel_width, Fframe_pixel_height, Fborder_width): Rename
to Fframe_native_width, Fframe_native_height mand
Fframe_internal_border_width.
(frame_parm_table): Add Qno_special_glyphs entry.
(frame_float_type): New enumeration type.
(frame_float): New function to handle frame size and position
ratios.
(x_set_frame_parameters): Handle size and position ratios.
(x_set_no_special_glyphs): New function
(x_figure_window_size): Handle size and position ratios.
(syms_of_frame): Add Qdisplay_monitor_attributes_list,
Qno_special_glyphs, Qframe_edges, Qkeep_ratio, Qwidth_only,
Qheight_only, Qleft_only and Qtop_only.
* src/frame.h (internal_border_part): New enumeration type.
(struct frame): New slot no_special_glyphs.
(FRAME_NO_SPECIAL_GLYPHS): New macro.
* src/gtkutil.c (xg_frame_restack): Return immediately for
GTK versions before 2.18.0.
* src/keyboard.c (internal_border_parts): New array constant.
(make_lispy_position): For frames with border dragging enabled
return internal border part.
(syms_of_keyboard): New symbols Qdrag_internal_border,
Qleft_edge, Qtop_left_corner, Qtop_edge, Qtop_right_corner,
Qright_edge, Qbottom_right_corner, Qbottom_edge and
Qbottom_left_corner.
* src/minibuf.c (read_minibuf_unwind): When exiting the
minibuffer deal with frames that have the 'minibuffer-exit'
parameter set.
(syms_of_minibuf): New symbol Qminibuffer_exit.
* src/nsfns.m (frame_parm_handler): Add entry for
x_set_no_special_glyphs.
(Fx_create_frame): Handle 'no-special-glyphs' parameter.
Intitialize new cursor types for dragging frame borders.
* src/nsterm.h (struct ns_output): Add new cursor types for
dragging frame borders.
* src/w32fns.c (w32_frame_parm_handlers): Add entry for
x_set_no_special_glyphs.
(Fx_create_frame): Handle 'no-special-glyphs' parameter.
Intitialize new cursor types for dragging frame borders.
* src/w32term.h (struct w32_output): Add new cursor types for
dragging frame borders.
* src/window.c (coordinates_in_window)
(Fwindow_line_height, window_internal_height): Use
window_wants_modeline and window_wants_header_line instead of
WINDOW_WANTS_MODELINE_P and WINDOW_WANTS_HEADER_LINE_P.
(Fwindow_lines_pixel_dimensions): New function.
(window_parameter): New function.
(Fwindow_parameter): Call window_parameter.
(window_wants_mode_line, window_wants_header_line): New
functions replacing the macros WINDOW_WANTS_MODELINE_P and
WINDOW_WANTS_HEADER_LINE_P from dispextern.h.
(syms_of_window): New symbols Qmode_line_format and
Qheader_line_format.
* src/window.h: Reorganize and re-comment macros. Use
window_wants_modeline and window_wants_header_line instead of
WINDOW_WANTS_MODELINE_P and WINDOW_WANTS_HEADER_LINE_P.
(MINI_NON_ONLY_WINDOW_P, MINI_ONLY_WINDOW_P): Minor rewrite.
(WINDOW_BUFFER): New macro.
(WINDOW_BOX_LEFT_EDGE_COL, WINDOW_BOX_RIGHT_EDGE_COL): Remove.
* src/xdisp.c (window_text_bottom_y, window_box_height)
(window_box, start_display)
(compute_window_start_on_continuation_line)
(try_cursor_movement, redisplay_window)
(try_window_reusing_current_matrix, try_window_id)
(display_line, expose_window): Use window_wants_modeline and
window_wants_header_line instead of WINDOW_WANTS_MODELINE_P and
WINDOW_WANTS_HEADER_LINE_P.
(pos_visible_p, display_mode_lines): Respect W's
'mode-line-format' and 'header-line-format' window parameters.
(init_iterator): Use window_wants_modeline and
window_wants_header_line instead of WINDOW_WANTS_MODELINE_P and
WINDOW_WANTS_HEADER_LINE_P. For tip frames respect
no_special_glyphs value.
(note_mouse_highlight): Set frame border cursors when on
internal border.
(x_draw_right_divider, x_draw_bottom_divider): Try to improve
drawing of window dividers.
* src/xfns.c (mouse_cursor): Add entries for border parts.
(mouse_cursor_types): Add entries for cursor types to drag
frame borders.
(INSTALL_CURSOR): Add entries for new cursor types to drag
frame borders.
(Fx_create_frame): Handle 'no-special-glyphs' parameter.
(x_frame_parm_handlers): Add entry for
x_set_no_special_glyphs.
(Vx_window_left_edge_shape, Vx_window_top_left_corner_shape)
(Vx_window_top_edge_shape, Vx_window_top_right_corner_shape)
(Vx_window_right_edge_shape)
(Vx_window_bottom_right_corner_shape)
(Vx_window_bottom_edge_shape)
(Vx_window_bottom_left_corner_shape): New variables.
(x_frame_restack): Call xg_frame_restack only for GTK versions
starting with 2.18.0.
* src/xterm.c (x_free_frame_resources): Remove new cursors for
dragging frame borders.
* src/xterm.h (struct x_output): Add new cursor types for
dragging frame borders.
* doc/lispref/display.texi (Size of Displayed Text): Document
`window-lines-pixel-dimensions'.
* doc/lispref/elisp.texi (Top): Add entry for "Mouse Dragging
Parameters".
* doc/lispref/frames.texi (Frame Size): Replace
frame-pixel-width/-height by frame-native-width/-height. Add
frame-inner-width/-height and frame-outer-width/-height docs.
(Position Parameters): Describe specifying position as ratios.
Clarify remark about positions relative to bottom/ridge display
edge.
(Size Parameters): Describe specifying sizes as ratios.
Describe 'fit-frame-to-buffer-margins' and
'fit-frame-to-buffer-sizes' parameters.
(Layout Parameters): Describe 'no-special-glyphs' parameter.
(Frame Interaction Parameters): Describe 'auto-hide-function',
'minibuffer-exit' and 'keep-ratio' parameters.
(Mouse Dragging Parameters): New section describing
'drag-internal-border', 'drag-with-header-line',
'drag-with-mode-line', 'snap-width', 'top-visible' and
'bottom-visible' parameters.
(Management Parameters): Mention that `override-redirect' has
no effect on MS Windows.
(Font and Color Parameters): Mention child frames for `alpha'
parameter.
(Child Frames): Rewrite section with description and cross
references to new frame parameters added.
* doc/lispref/modes.texi (Mode Line Basics): Mention
'mode-line-format' and 'header-line-format' window parameters.
* doc/lispref/windows.texi (Resizing Windows): Mention effect
of `fit-frame-to-buffer-margins' for child frames.
(Display Action Functions): New action function
`display-buffer-in-child-frame'.
(Quitting Windows): Mention `make-frame-invisible' as optional
value of `frame-auto-hide-function' and `auto-hide-function'
frame paameter.
(Coordinates and Windows): Describe new function
`window-largest-empty-rectangle'.
(Window Parameters): Describe new parameters 'mode-line-format'
and 'header-line-format'. Index all window parameters described
in this section.
2017-06-25 09:33:25 +00:00
|
|
|
|
(* 2 (frame-internal-border-width frame))))
|
|
|
|
|
|
|
|
|
|
(defun frame-outer-width (&optional frame)
|
|
|
|
|
"Return outer width of FRAME in pixels.
|
|
|
|
|
FRAME defaults to the selected frame."
|
|
|
|
|
(setq frame (window-normalize-frame frame))
|
|
|
|
|
(let ((edges (frame-edges frame 'outer-edges)))
|
|
|
|
|
(- (nth 2 edges) (nth 0 edges))))
|
|
|
|
|
|
|
|
|
|
(defun frame-outer-height (&optional frame)
|
|
|
|
|
"Return outer height of FRAME in pixels.
|
|
|
|
|
FRAME defaults to the selected frame."
|
|
|
|
|
(setq frame (window-normalize-frame frame))
|
|
|
|
|
(let ((edges (frame-edges frame 'outer-edges)))
|
|
|
|
|
(- (nth 3 edges) (nth 1 edges))))
|
|
|
|
|
|
2008-06-12 03:56:20 +00:00
|
|
|
|
(declare-function x-list-fonts "xfaces.c"
|
|
|
|
|
(pattern &optional face frame maximum width))
|
|
|
|
|
|
2021-07-13 19:48:49 +00:00
|
|
|
|
(defun set-frame-font (font &optional keep-size frames inhibit-customize)
|
2012-08-15 07:58:34 +00:00
|
|
|
|
"Set the default font to FONT.
|
2012-01-31 08:38:58 +00:00
|
|
|
|
When called interactively, prompt for the name of a font, and use
|
2012-08-15 07:58:34 +00:00
|
|
|
|
that font on the selected frame. When called from Lisp, FONT
|
|
|
|
|
should be a font name (a string), a font object, font entity, or
|
|
|
|
|
font spec.
|
2012-01-31 08:38:58 +00:00
|
|
|
|
|
|
|
|
|
If KEEP-SIZE is nil, keep the number of frame lines and columns
|
|
|
|
|
fixed. If KEEP-SIZE is non-nil (or with a prefix argument), try
|
|
|
|
|
to keep the current frame size fixed (in pixels) by adjusting the
|
|
|
|
|
number of lines and columns.
|
|
|
|
|
|
2012-02-01 08:13:02 +00:00
|
|
|
|
If FRAMES is nil, apply the font to the selected frame only.
|
|
|
|
|
If FRAMES is non-nil, it should be a list of frames to act upon,
|
2014-05-21 16:35:31 +00:00
|
|
|
|
or t meaning all existing graphical frames.
|
|
|
|
|
Also, if FRAMES is non-nil, alter the user's Customization settings
|
|
|
|
|
as though the font-related attributes of the `default' face had been
|
2021-07-13 19:48:49 +00:00
|
|
|
|
\"set in this session\", so that the font is applied to future frames.
|
|
|
|
|
|
|
|
|
|
If INHIBIT-CUSTOMIZE is non-nil, don't update the user's
|
|
|
|
|
Customization settings."
|
2001-11-26 18:20:20 +00:00
|
|
|
|
(interactive
|
2003-04-09 17:28:30 +00:00
|
|
|
|
(let* ((completion-ignore-case t)
|
2020-09-06 18:35:11 +00:00
|
|
|
|
(default (frame-parameter nil 'font))
|
|
|
|
|
(font (completing-read (format-prompt "Font name" default)
|
2003-04-09 17:28:30 +00:00
|
|
|
|
;; x-list-fonts will fail with an error
|
|
|
|
|
;; if this frame doesn't support fonts.
|
2007-07-25 19:37:21 +00:00
|
|
|
|
(x-list-fonts "*" nil (selected-frame))
|
2020-09-06 18:35:11 +00:00
|
|
|
|
nil nil nil nil default)))
|
2012-01-31 08:38:58 +00:00
|
|
|
|
(list font current-prefix-arg nil)))
|
2012-08-15 07:58:34 +00:00
|
|
|
|
(when (or (stringp font) (fontp font))
|
2012-01-31 08:38:58 +00:00
|
|
|
|
(let* ((this-frame (selected-frame))
|
2012-02-01 08:13:02 +00:00
|
|
|
|
;; FRAMES nil means affect the selected frame.
|
|
|
|
|
(frame-list (cond ((null frames)
|
|
|
|
|
(list this-frame))
|
|
|
|
|
((eq frames t)
|
|
|
|
|
(frame-list))
|
|
|
|
|
(t frames)))
|
2012-01-31 08:38:58 +00:00
|
|
|
|
height width)
|
2012-02-01 08:13:02 +00:00
|
|
|
|
(dolist (f frame-list)
|
2012-01-31 08:38:58 +00:00
|
|
|
|
(when (display-multi-font-p f)
|
|
|
|
|
(if keep-size
|
|
|
|
|
(setq height (* (frame-parameter f 'height)
|
|
|
|
|
(frame-char-height f))
|
|
|
|
|
width (* (frame-parameter f 'width)
|
|
|
|
|
(frame-char-width f))))
|
|
|
|
|
;; When set-face-attribute is called for :font, Emacs
|
|
|
|
|
;; guesses the best font according to other face attributes
|
|
|
|
|
;; (:width, :weight, etc.) so reset them too (Bug#2476).
|
|
|
|
|
(set-face-attribute 'default f
|
|
|
|
|
:width 'normal :weight 'normal
|
2012-08-15 07:58:34 +00:00
|
|
|
|
:slant 'normal :font font)
|
2012-01-31 08:38:58 +00:00
|
|
|
|
(if keep-size
|
|
|
|
|
(modify-frame-parameters
|
|
|
|
|
f
|
|
|
|
|
(list (cons 'height (round height (frame-char-height f)))
|
|
|
|
|
(cons 'width (round width (frame-char-width f))))))))
|
2021-07-13 19:48:49 +00:00
|
|
|
|
(when (and frames
|
|
|
|
|
(not inhibit-customize))
|
2012-01-31 08:38:58 +00:00
|
|
|
|
;; Alter the user's Custom setting of the `default' face, but
|
|
|
|
|
;; only for font-related attributes.
|
|
|
|
|
(let ((specs (cadr (assq 'user (get 'default 'theme-face))))
|
|
|
|
|
(attrs '(:family :foundry :slant :weight :height :width))
|
|
|
|
|
(new-specs nil))
|
|
|
|
|
(if (null specs) (setq specs '((t nil))))
|
|
|
|
|
(dolist (spec specs)
|
|
|
|
|
;; Each SPEC has the form (DISPLAY ATTRIBUTE-PLIST)
|
|
|
|
|
(let ((display (nth 0 spec))
|
|
|
|
|
(plist (copy-tree (nth 1 spec))))
|
|
|
|
|
;; Alter only DISPLAY conditions matching this frame.
|
|
|
|
|
(when (or (memq display '(t default))
|
|
|
|
|
(face-spec-set-match-display display this-frame))
|
|
|
|
|
(dolist (attr attrs)
|
|
|
|
|
(setq plist (plist-put plist attr
|
|
|
|
|
(face-attribute 'default attr)))))
|
|
|
|
|
(push (list display plist) new-specs)))
|
|
|
|
|
(setq new-specs (nreverse new-specs))
|
|
|
|
|
(put 'default 'customized-face new-specs)
|
|
|
|
|
(custom-push-theme 'theme-face 'default 'user 'set new-specs)
|
|
|
|
|
(put 'default 'face-modified nil))))
|
|
|
|
|
(run-hooks 'after-setting-font-hook 'after-setting-font-hooks)))
|
1991-08-15 21:29:06 +00:00
|
|
|
|
|
2001-10-12 20:39:54 +00:00
|
|
|
|
(defun set-frame-parameter (frame parameter value)
|
2005-12-06 12:43:47 +00:00
|
|
|
|
"Set frame parameter PARAMETER to VALUE on FRAME.
|
|
|
|
|
If FRAME is nil, it defaults to the selected frame.
|
2006-12-08 02:56:08 +00:00
|
|
|
|
See `modify-frame-parameters'."
|
2001-10-12 20:39:54 +00:00
|
|
|
|
(modify-frame-parameters frame (list (cons parameter value))))
|
|
|
|
|
|
1993-02-16 06:36:30 +00:00
|
|
|
|
(defun set-background-color (color-name)
|
1999-07-30 18:39:32 +00:00
|
|
|
|
"Set the background color of the selected frame to COLOR-NAME.
|
1996-09-01 20:48:03 +00:00
|
|
|
|
When called interactively, prompt for the name of the color to use.
|
|
|
|
|
To get the frame's current background color, use `frame-parameters'."
|
2010-10-24 18:43:31 +00:00
|
|
|
|
(interactive (list (read-color "Background color: ")))
|
1992-07-15 00:32:19 +00:00
|
|
|
|
(modify-frame-parameters (selected-frame)
|
2001-11-03 15:55:17 +00:00
|
|
|
|
(list (cons 'background-color color-name)))
|
|
|
|
|
(or window-system
|
2015-02-08 16:17:40 +00:00
|
|
|
|
(face-set-after-frame-default (selected-frame)
|
|
|
|
|
(list
|
2015-02-08 18:09:19 +00:00
|
|
|
|
(cons 'background-color color-name)
|
|
|
|
|
;; Pass the foreground-color as
|
|
|
|
|
;; well, if defined, to avoid
|
|
|
|
|
;; losing it when faces are reset
|
|
|
|
|
;; to their defaults.
|
|
|
|
|
(assq 'foreground-color
|
|
|
|
|
(frame-parameters))))))
|
1991-08-15 21:29:06 +00:00
|
|
|
|
|
1993-02-16 06:36:30 +00:00
|
|
|
|
(defun set-foreground-color (color-name)
|
1999-07-30 18:39:32 +00:00
|
|
|
|
"Set the foreground color of the selected frame to COLOR-NAME.
|
1996-09-01 20:48:03 +00:00
|
|
|
|
When called interactively, prompt for the name of the color to use.
|
|
|
|
|
To get the frame's current foreground color, use `frame-parameters'."
|
2021-09-01 09:26:51 +00:00
|
|
|
|
(interactive (list (read-color "Foreground color: " nil nil nil t)))
|
1992-07-15 00:32:19 +00:00
|
|
|
|
(modify-frame-parameters (selected-frame)
|
2001-11-03 15:55:17 +00:00
|
|
|
|
(list (cons 'foreground-color color-name)))
|
|
|
|
|
(or window-system
|
2015-02-08 16:17:40 +00:00
|
|
|
|
(face-set-after-frame-default (selected-frame)
|
|
|
|
|
(list
|
2015-02-08 18:09:19 +00:00
|
|
|
|
(cons 'foreground-color color-name)
|
|
|
|
|
;; Pass the background-color as
|
|
|
|
|
;; well, if defined, to avoid
|
|
|
|
|
;; losing it when faces are reset
|
|
|
|
|
;; to their defaults.
|
|
|
|
|
(assq 'background-color
|
|
|
|
|
(frame-parameters))))))
|
1991-08-15 21:29:06 +00:00
|
|
|
|
|
|
|
|
|
(defun set-cursor-color (color-name)
|
1999-07-30 18:39:32 +00:00
|
|
|
|
"Set the text cursor color of the selected frame to COLOR-NAME.
|
1996-09-01 20:48:03 +00:00
|
|
|
|
When called interactively, prompt for the name of the color to use.
|
2012-01-28 03:21:04 +00:00
|
|
|
|
This works by setting the `cursor-color' frame parameter on the
|
|
|
|
|
selected frame.
|
|
|
|
|
|
|
|
|
|
You can also set the text cursor color, for all frames, by
|
|
|
|
|
customizing the `cursor' face."
|
2010-10-24 18:43:31 +00:00
|
|
|
|
(interactive (list (read-color "Cursor color: ")))
|
1992-07-15 00:32:19 +00:00
|
|
|
|
(modify-frame-parameters (selected-frame)
|
* frame.el: Clean up initialization code.
(initial-frame-alist): Doc fix.
(minibuffer-frame-alist): New default value, with a reasonable height.
(filtered-frame-list, minibuffer-frame-list): New functions.
(frame-initialize): Use minibuffer-frame-list, instead of writing
it out.
(frame-notice-user-settings): Thoroughly rearranged.
Notice changes to default-frame-alist as well as initial-frame-alist.
Properly handle requests to make the initial frame into a
minibufferless or minibuffer-only frame.
Create a minibuffer-only frame if the initial frame should lack a
minibuffer and there are no other minibuffer frames created by the
user's initialization file.
Fix any frames using the initial frame as a surrogate minibuffer
frame.
Restore the current buffer after creating and deleting all these
frames.
* frame.el (set-default-font, set-frame-background,
set-frame-foreground, set-cursor-color, set-pointer-color,
set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Give these docstrings.
(set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Make these toggle or look at the prefix
argument, like minor modes.
* frame.el (set-vertical-bar): Use the proper parameter symbol.
(set-horizontal-bar): Signal an error indicating that horizontal
scrollbars are not implemented.
1993-02-14 14:29:30 +00:00
|
|
|
|
(list (cons 'cursor-color color-name))))
|
1991-08-15 21:29:06 +00:00
|
|
|
|
|
1993-03-02 07:06:47 +00:00
|
|
|
|
(defun set-mouse-color (color-name)
|
1999-07-30 18:39:32 +00:00
|
|
|
|
"Set the color of the mouse pointer of the selected frame to COLOR-NAME.
|
1996-09-01 20:48:03 +00:00
|
|
|
|
When called interactively, prompt for the name of the color to use.
|
|
|
|
|
To get the frame's current mouse color, use `frame-parameters'."
|
2010-10-24 18:43:31 +00:00
|
|
|
|
(interactive (list (read-color "Mouse color: ")))
|
1992-07-15 00:32:19 +00:00
|
|
|
|
(modify-frame-parameters (selected-frame)
|
1999-07-26 19:06:37 +00:00
|
|
|
|
(list (cons 'mouse-color
|
|
|
|
|
(or color-name
|
|
|
|
|
(cdr (assq 'mouse-color
|
|
|
|
|
(frame-parameters))))))))
|
* frame.el: Clean up initialization code.
(initial-frame-alist): Doc fix.
(minibuffer-frame-alist): New default value, with a reasonable height.
(filtered-frame-list, minibuffer-frame-list): New functions.
(frame-initialize): Use minibuffer-frame-list, instead of writing
it out.
(frame-notice-user-settings): Thoroughly rearranged.
Notice changes to default-frame-alist as well as initial-frame-alist.
Properly handle requests to make the initial frame into a
minibufferless or minibuffer-only frame.
Create a minibuffer-only frame if the initial frame should lack a
minibuffer and there are no other minibuffer frames created by the
user's initialization file.
Fix any frames using the initial frame as a surrogate minibuffer
frame.
Restore the current buffer after creating and deleting all these
frames.
* frame.el (set-default-font, set-frame-background,
set-frame-foreground, set-cursor-color, set-pointer-color,
set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Give these docstrings.
(set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Make these toggle or look at the prefix
argument, like minor modes.
* frame.el (set-vertical-bar): Use the proper parameter symbol.
(set-horizontal-bar): Signal an error indicating that horizontal
scrollbars are not implemented.
1993-02-14 14:29:30 +00:00
|
|
|
|
|
1993-03-02 07:06:47 +00:00
|
|
|
|
(defun set-border-color (color-name)
|
1999-07-30 18:39:32 +00:00
|
|
|
|
"Set the color of the border of the selected frame to COLOR-NAME.
|
1996-09-01 20:48:03 +00:00
|
|
|
|
When called interactively, prompt for the name of the color to use.
|
|
|
|
|
To get the frame's current border color, use `frame-parameters'."
|
2010-10-24 18:43:31 +00:00
|
|
|
|
(interactive (list (read-color "Border color: ")))
|
1993-03-02 07:06:47 +00:00
|
|
|
|
(modify-frame-parameters (selected-frame)
|
|
|
|
|
(list (cons 'border-color color-name))))
|
|
|
|
|
|
2010-05-05 02:08:25 +00:00
|
|
|
|
(define-minor-mode auto-raise-mode
|
2011-11-29 06:07:51 +00:00
|
|
|
|
"Toggle whether or not selected frames should auto-raise.
|
Fix minor mode docstrings for the new meaning of a nil ARG.
* abbrev.el (abbrev-mode):
* allout.el (allout-mode):
* autoinsert.el (auto-insert-mode):
* autoarg.el (autoarg-mode, autoarg-kp-mode):
* autorevert.el (auto-revert-mode, auto-revert-tail-mode)
(global-auto-revert-mode):
* battery.el (display-battery-mode):
* composite.el (global-auto-composition-mode)
(auto-composition-mode):
* delsel.el (delete-selection-mode):
* desktop.el (desktop-save-mode):
* dired-x.el (dired-omit-mode):
* dirtrack.el (dirtrack-mode):
* doc-view.el (doc-view-minor-mode):
* double.el (double-mode):
* electric.el (electric-indent-mode, electric-pair-mode):
* emacs-lock.el (emacs-lock-mode):
* epa-hook.el (auto-encryption-mode):
* follow.el (follow-mode):
* font-core.el (font-lock-mode):
* frame.el (auto-raise-mode, auto-lower-mode, blink-cursor-mode):
* help.el (temp-buffer-resize-mode):
* hilit-chg.el (highlight-changes-mode)
(highlight-changes-visible-mode):
* hi-lock.el (hi-lock-mode):
* hl-line.el (hl-line-mode, global-hl-line-mode):
* icomplete.el (icomplete-mode):
* ido.el (ido-everywhere):
* image-file.el (auto-image-file-mode):
* image-mode.el (image-minor-mode):
* iswitchb.el (iswitchb-mode):
* jka-cmpr-hook.el (auto-compression-mode):
* linum.el (linum-mode):
* longlines.el (longlines-mode):
* master.el (master-mode):
* mb-depth.el (minibuffer-depth-indicate-mode):
* menu-bar.el (menu-bar-mode):
* minibuf-eldef.el (minibuffer-electric-default-mode):
* mouse-sel.el (mouse-sel-mode):
* msb.el (msb-mode):
* mwheel.el (mouse-wheel-mode):
* outline.el (outline-minor-mode):
* paren.el (show-paren-mode):
* recentf.el (recentf-mode):
* reveal.el (reveal-mode, global-reveal-mode):
* rfn-eshadow.el (file-name-shadow-mode):
* ruler-mode.el (ruler-mode):
* savehist.el (savehist-mode):
* scroll-all.el (scroll-all-mode):
* scroll-bar.el (scroll-bar-mode):
* server.el (server-mode):
* shell.el (shell-dirtrack-mode):
* simple.el (auto-fill-mode, transient-mark-mode)
(visual-line-mode, overwrite-mode, binary-overwrite-mode)
(line-number-mode, column-number-mode, size-indication-mode)
(auto-save-mode, normal-erase-is-backspace-mode, visible-mode):
* strokes.el (strokes-mode):
* time.el (display-time-mode):
* t-mouse.el (gpm-mouse-mode):
* tool-bar.el (tool-bar-mode):
* tooltip.el (tooltip-mode):
* type-break.el (type-break-mode-line-message-mode)
(type-break-query-mode):
* view.el (view-mode):
* whitespace.el (whitespace-mode, whitespace-newline-mode)
(global-whitespace-mode, global-whitespace-newline-mode):
* xt-mouse.el (xterm-mouse-mode): Doc fix.
* emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Fix
autogenerated docstring.
2011-10-19 12:54:24 +00:00
|
|
|
|
|
2011-11-29 06:07:51 +00:00
|
|
|
|
Auto Raise mode does nothing under most window managers, which
|
|
|
|
|
switch focus on mouse clicks. It only has an effect if your
|
|
|
|
|
window manager switches focus on mouse movement (in which case
|
|
|
|
|
you should also change `focus-follows-mouse' to t). Then,
|
|
|
|
|
enabling Auto Raise mode causes any graphical Emacs frame which
|
|
|
|
|
acquires focus to be automatically raised.
|
|
|
|
|
|
|
|
|
|
Note that this minor mode controls Emacs's own auto-raise
|
|
|
|
|
feature. Window managers that switch focus on mouse movement
|
|
|
|
|
often have their own auto-raise feature."
|
2010-05-05 02:08:25 +00:00
|
|
|
|
:variable (frame-parameter nil 'auto-raise)
|
|
|
|
|
(if (frame-parameter nil 'auto-raise)
|
|
|
|
|
(raise-frame)))
|
* frame.el: Clean up initialization code.
(initial-frame-alist): Doc fix.
(minibuffer-frame-alist): New default value, with a reasonable height.
(filtered-frame-list, minibuffer-frame-list): New functions.
(frame-initialize): Use minibuffer-frame-list, instead of writing
it out.
(frame-notice-user-settings): Thoroughly rearranged.
Notice changes to default-frame-alist as well as initial-frame-alist.
Properly handle requests to make the initial frame into a
minibufferless or minibuffer-only frame.
Create a minibuffer-only frame if the initial frame should lack a
minibuffer and there are no other minibuffer frames created by the
user's initialization file.
Fix any frames using the initial frame as a surrogate minibuffer
frame.
Restore the current buffer after creating and deleting all these
frames.
* frame.el (set-default-font, set-frame-background,
set-frame-foreground, set-cursor-color, set-pointer-color,
set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Give these docstrings.
(set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Make these toggle or look at the prefix
argument, like minor modes.
* frame.el (set-vertical-bar): Use the proper parameter symbol.
(set-horizontal-bar): Signal an error indicating that horizontal
scrollbars are not implemented.
1993-02-14 14:29:30 +00:00
|
|
|
|
|
2010-05-05 02:08:25 +00:00
|
|
|
|
(define-minor-mode auto-lower-mode
|
* frame.el: Clean up initialization code.
(initial-frame-alist): Doc fix.
(minibuffer-frame-alist): New default value, with a reasonable height.
(filtered-frame-list, minibuffer-frame-list): New functions.
(frame-initialize): Use minibuffer-frame-list, instead of writing
it out.
(frame-notice-user-settings): Thoroughly rearranged.
Notice changes to default-frame-alist as well as initial-frame-alist.
Properly handle requests to make the initial frame into a
minibufferless or minibuffer-only frame.
Create a minibuffer-only frame if the initial frame should lack a
minibuffer and there are no other minibuffer frames created by the
user's initialization file.
Fix any frames using the initial frame as a surrogate minibuffer
frame.
Restore the current buffer after creating and deleting all these
frames.
* frame.el (set-default-font, set-frame-background,
set-frame-foreground, set-cursor-color, set-pointer-color,
set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Give these docstrings.
(set-auto-raise, set-auto-lower, set-vertical-bar,
set-horizontal-bar): Make these toggle or look at the prefix
argument, like minor modes.
* frame.el (set-vertical-bar): Use the proper parameter symbol.
(set-horizontal-bar): Signal an error indicating that horizontal
scrollbars are not implemented.
1993-02-14 14:29:30 +00:00
|
|
|
|
"Toggle whether or not the selected frame should auto-lower.
|
Fix minor mode docstrings for the new meaning of a nil ARG.
* abbrev.el (abbrev-mode):
* allout.el (allout-mode):
* autoinsert.el (auto-insert-mode):
* autoarg.el (autoarg-mode, autoarg-kp-mode):
* autorevert.el (auto-revert-mode, auto-revert-tail-mode)
(global-auto-revert-mode):
* battery.el (display-battery-mode):
* composite.el (global-auto-composition-mode)
(auto-composition-mode):
* delsel.el (delete-selection-mode):
* desktop.el (desktop-save-mode):
* dired-x.el (dired-omit-mode):
* dirtrack.el (dirtrack-mode):
* doc-view.el (doc-view-minor-mode):
* double.el (double-mode):
* electric.el (electric-indent-mode, electric-pair-mode):
* emacs-lock.el (emacs-lock-mode):
* epa-hook.el (auto-encryption-mode):
* follow.el (follow-mode):
* font-core.el (font-lock-mode):
* frame.el (auto-raise-mode, auto-lower-mode, blink-cursor-mode):
* help.el (temp-buffer-resize-mode):
* hilit-chg.el (highlight-changes-mode)
(highlight-changes-visible-mode):
* hi-lock.el (hi-lock-mode):
* hl-line.el (hl-line-mode, global-hl-line-mode):
* icomplete.el (icomplete-mode):
* ido.el (ido-everywhere):
* image-file.el (auto-image-file-mode):
* image-mode.el (image-minor-mode):
* iswitchb.el (iswitchb-mode):
* jka-cmpr-hook.el (auto-compression-mode):
* linum.el (linum-mode):
* longlines.el (longlines-mode):
* master.el (master-mode):
* mb-depth.el (minibuffer-depth-indicate-mode):
* menu-bar.el (menu-bar-mode):
* minibuf-eldef.el (minibuffer-electric-default-mode):
* mouse-sel.el (mouse-sel-mode):
* msb.el (msb-mode):
* mwheel.el (mouse-wheel-mode):
* outline.el (outline-minor-mode):
* paren.el (show-paren-mode):
* recentf.el (recentf-mode):
* reveal.el (reveal-mode, global-reveal-mode):
* rfn-eshadow.el (file-name-shadow-mode):
* ruler-mode.el (ruler-mode):
* savehist.el (savehist-mode):
* scroll-all.el (scroll-all-mode):
* scroll-bar.el (scroll-bar-mode):
* server.el (server-mode):
* shell.el (shell-dirtrack-mode):
* simple.el (auto-fill-mode, transient-mark-mode)
(visual-line-mode, overwrite-mode, binary-overwrite-mode)
(line-number-mode, column-number-mode, size-indication-mode)
(auto-save-mode, normal-erase-is-backspace-mode, visible-mode):
* strokes.el (strokes-mode):
* time.el (display-time-mode):
* t-mouse.el (gpm-mouse-mode):
* tool-bar.el (tool-bar-mode):
* tooltip.el (tooltip-mode):
* type-break.el (type-break-mode-line-message-mode)
(type-break-query-mode):
* view.el (view-mode):
* whitespace.el (whitespace-mode, whitespace-newline-mode)
(global-whitespace-mode, global-whitespace-newline-mode):
* xt-mouse.el (xterm-mouse-mode): Doc fix.
* emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Fix
autogenerated docstring.
2011-10-19 12:54:24 +00:00
|
|
|
|
|
2011-11-29 06:07:51 +00:00
|
|
|
|
Auto Lower mode does nothing under most window managers, which
|
|
|
|
|
switch focus on mouse clicks. It only has an effect if your
|
|
|
|
|
window manager switches focus on mouse movement (in which case
|
|
|
|
|
you should also change `focus-follows-mouse' to t). Then,
|
|
|
|
|
enabling Auto Lower Mode causes any graphical Emacs frame which
|
|
|
|
|
loses focus to be automatically lowered.
|
|
|
|
|
|
|
|
|
|
Note that this minor mode controls Emacs's own auto-lower
|
|
|
|
|
feature. Window managers that switch focus on mouse movement
|
|
|
|
|
often have their own features for raising or lowering frames."
|
2010-05-05 02:08:25 +00:00
|
|
|
|
:variable (frame-parameter nil 'auto-lower))
|
|
|
|
|
|
1997-11-20 15:55:31 +00:00
|
|
|
|
(defun set-frame-name (name)
|
|
|
|
|
"Set the name of the selected frame to NAME.
|
|
|
|
|
When called interactively, prompt for the name of the frame.
|
2012-06-02 10:56:09 +00:00
|
|
|
|
On text terminals, the frame name is displayed on the mode line.
|
|
|
|
|
On graphical displays, it is displayed on the frame's title bar."
|
2019-10-20 16:30:30 +00:00
|
|
|
|
(interactive
|
2020-09-06 20:59:48 +00:00
|
|
|
|
(let ((default (cdr (assq 'name (frame-parameters)))))
|
|
|
|
|
(list (read-string (format-prompt "Frame name" default) nil nil
|
|
|
|
|
default))))
|
1997-11-20 15:55:31 +00:00
|
|
|
|
(modify-frame-parameters (selected-frame)
|
|
|
|
|
(list (cons 'name name))))
|
2003-09-24 22:54:55 +00:00
|
|
|
|
|
|
|
|
|
(defun frame-current-scroll-bars (&optional frame)
|
2014-10-04 08:20:24 +00:00
|
|
|
|
"Return the current scroll-bar types for frame FRAME.
|
|
|
|
|
Value is a cons (VERTICAL . HORIZ0NTAL) where VERTICAL specifies
|
|
|
|
|
the current location of the vertical scroll-bars (`left', `right'
|
|
|
|
|
or nil), and HORIZONTAL specifies the current location of the
|
|
|
|
|
horizontal scroll bars (`bottom' or nil). FRAME must specify a
|
|
|
|
|
live frame and defaults to the selected one."
|
|
|
|
|
(let* ((frame (window-normalize-frame frame))
|
|
|
|
|
(vertical (frame-parameter frame 'vertical-scroll-bars))
|
|
|
|
|
(horizontal (frame-parameter frame 'horizontal-scroll-bars)))
|
|
|
|
|
(unless (memq vertical '(left right nil))
|
|
|
|
|
(setq vertical default-frame-scroll-bars))
|
|
|
|
|
(cons vertical (and horizontal 'bottom))))
|
2013-05-07 01:12:22 +00:00
|
|
|
|
|
2015-08-21 09:00:59 +00:00
|
|
|
|
(declare-function x-frame-geometry "xfns.c" (&optional frame))
|
|
|
|
|
(declare-function w32-frame-geometry "w32fns.c" (&optional frame))
|
|
|
|
|
(declare-function ns-frame-geometry "nsfns.m" (&optional frame))
|
Add support for the Haiku operating system and its window system
* .gitignore: Add binaries specific to Haiku.
* Makefie.in (HAVE_BE_APP): New variable.
(install-arch-dep): Install Emacs and Emacs.pdmp when
using Haiku.
* configure.ac: Detect and configure for Haiku and
various related configurations.
(be-app, be-freetype, be-cairo): New options.
(HAVE_BE_APP, HAIKU_OBJ, HAIKU_CXX_OBJ)
(HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(HAIKU, HAVE_TINY_SPEED_T): New define.
(emacs_config_features): Add BE_APP.
* doc/emacs/Makefile.in (EMACSSOURCES): Add Haiku
appendix.
* doc/emacs/emacs.texi: Add Haiku appendix to menus and
include it.
* doc/emacs/haiku.texi: New Haiku appendix.
* doc/lispref/display.texi (Defining Faces, Window Systems):
Explain meaning of `haiku' as a window system identifier.
(haiku-use-system-tooltips): Explain meaning of system
tooltips on
Haiku.
* doc/lispref/frames.texi (Multiple Terminals): Explain
meaning of haiku as a display type.
(Frame Layout): Clarify section for Haiku frames.
(Size Parameters): Explain limitations of fullwidth and
fullheight on Haiku.
(Management Parameters): Explain limitations of
inhibiting double buffering on builds with Cairo,
and the inability of frames with no-accept-focus to
receive keyboard input on Haiku.
(Font and Color Parameters): Explain the different font
backends available on Haiku.
(Raising and Lowering): Explain that lowering and
restacking frames doesn't work on Haiku.
(Child Frames): Explain oddities of child frame
visibility on Haiku.
* doc/lispref/os.texi (System Environment): Explain
meaning of haiku.
* etc/MACHINES: Add appropriate notices for Haiku.
* etc/NEWS: Document changes.
* etc/PROBLEMS: Document font spacing bug on Haiku.
* lib-src/Makefile.in: Build be-resources binary on
Haiku.
(CXX, CXXFLAGS, NON_CXX_FLAGS, ALL_CXXFLAGS)
(HAVE_BE_APP, HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(DONT_INSTALL): Add be-resources binary if on Haiku.
(be-resources): New target.
* lib-src/be_resources: Add helper binary for setting
resources on the Emacs application.
* lib-src/emacsclient.c (decode_options): Set
alt_display to "be" on Haiku.
* lisp/cus-edit.el (custom-button, custom-button-mouse)
(custom-button-unraised, custom-button-pressed): Update
face definitions for Haiku.
* lisp/cus-start.el: Add haiku-debug-on-fatal-error and
haiku-use-system-tooltips.
* lisp/faces.el (face-valid-attribute-values): Clarify
attribute comment for Haiku.
(tool-bar): Add appropriate toolbar color for Haiku.
* lisp/frame.el (haiku-frame-geometry)
(haiku-mouse-absolute-pixel-position)
(haiku-set-mouse-absolute-pixel-position)
(haiku-frame-edges)
(haiku-frame-list-z-order): New function declarations.
(frame-geometry, frame-edges)
(mouse-absolute-pixel-position)
(set-mouse-absolute-pixel-position)
(frame-list-z-order): Call appropriate window system
functions on Haiku.
(display-mouse-p, display-graphic-p)
(display-images-p, display-pixel-height)
(display-pixel-width, display-mm-height)
(display-mm-width, display-backing-store)
(display-save-under, display-planes)
(display-color-cells, display-visual-class): Update type
tests for Haiku.
* lisp/international/mule-cmds.el
(set-coding-system-map): Also
prevent set-terminal-coding-system from appearing in the menu
bar on Haiku.
* lisp/loadup.el: Load Haiku-specific files when built
with Haiku, and don't rename newly built Emacs on Haiku as BFS
doesn't support hard links.
* lisp/menu-bar.el (menu-bar-open): Add for Haiku.
* lisp/mwheel.el (mouse-wheel-down-event): Expect
wheel-up on Haiku.
(mouse-wheel-up-event): Expect wheel-down on Haiku.
(mouse-wheel-left-event): Expect wheel-left on Haiku.
(mouse-wheel-right-event): Expect wheel-right on Haiku.
* lisp/net/browse-url.el
(browse-url--browser-defcustom-type):
Add option for WebPositive.
(browse-url-webpositive-program): New variable.
(browse-url-default-program): Search for WebPositive.
(browse-url-webpositive): New function.
* lisp/net/eww.el (eww-form-submit, eww-form-file)
(eww-form-checkbox, eww-form-select): Define faces
appropriately for Haiku.
* lisp/term/haiku-win.el: New file.
* lisp/tooltip.el (menu-or-popup-active-p): New function
declaration.
(tooltip-show-help): Don't use tooltips on Haiku when a
menu is active.
* lisp/version.el (haiku-get-version-string): New
function declaration.
(emacs-version): Add Haiku version string if
appropriate.
* src/Makefile.in: Also produce binary named "Emacs"
with Haiku resources set.
(CXX, HAIKU_OBJ, HAIKU_CXX_OBJ, HAIKU_LIBS)
(HAIKU_CFLAGS, HAVE_BE_APP, NON_CXX_FLAGS)
(ALL_CXX_FLAGS): New variables.
(.SUFFIXES): Add .cc.
(.cc.o): New target.
(base_obj): Add Haiku C objects.
(doc_obj, obj): Split objects that should scanned for
documentation into doc_obj.
(SOME_MACHINE_OBJECTS): Add appropriate Haiku C objects.
(all): Depend on Emacs and Emacs.pdmp on Haiku.
(LIBES): Add Haiku libraries.
(gl-stamp)
($(etc)/DOC): Scan doc_obj instead of obj
(temacs$(EXEEXT): Use C++ linker on Haiku.
(ctagsfiles3): New variable.
(TAGS): Scan C++ files.
* src/alloc.c (garbage_collect): Mark Haiku display.
* src/dispextern.h (HAVE_NATIVE_TRANSFORMS): Also enable
on Haiku.
(struct image): Add fields for Haiku transforms.
(RGB_PIXEL_COLOR): Define to unsigned long on Haiku as
well.
(sit_for): Also check USABLE_SIGPOLL.
(init_display_interactive): Set initial window system to
Haiku on Haiku builds.
* src/emacs.c (main): Define Haiku syms and init haiku
clipboard.
(shut_down_emacs): Quit BApplication on Haiku and
trigger debug
on aborts if haiku_debug_on_fatal_error.
(Vsystem_type): Update docstring.
* src/fileio.c (next-read-file-uses-dialog-p): Enable on
Haiku.
* src/filelock.c (WTMP_FILE): Only define if BOOT_TIME
is also defined.
* src/floatfns.c (double_integer_scale): Work around
Haiku libroot brain damage.
* src/font.c (syms_of_font): Define appropriate font
driver symbols for Haiku builds with various options.
* src/font.h: Also enable ftcrfont on Haiku builds with
Cairo.
(font_data_structures_may_be_ill_formed): Also enable on
Haiku builds that have Cairo.
* src/frame.c (Fframep): Update doc-string for Haiku
builds and return haiku if appropriate.
(syms_of_frame): New symbol `haiku'.
* src/frame.h (struct frame): Add output data for Haiku.
(FRAME_HAIKU_P): New macro.
(FRAME_WINDOW_P): Test for Haiku frames as well.
* src/ftcrfont.c (RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG): New macros.
(ftcrfont_draw): Add haiku specific code for Haiku
builds with Cairo.
* src/ftfont.c (ftfont_open): Set face.
(ftfont_has_char, ftfont_text_extents): Work around
crash.
(syms_of_ftfont): New symbol `mono'.
* src/ftfont.h (struct font_info): Enable Cairo-specific
fields for Cairo builds on Haiku.
* src/haiku_draw_support.cc:
* src/haiku_font_support.cc:
* src/haiku_io.c:
* src/haiku_select.cc:
* src/haiku_support.cc:
* src/haiku_support.h:
* src/haikufns.c:
* src/haikufont.c:
* src/haikugui.h:
* src/haikuimage.c:
* src/haikumenu.c:
* src/haikuselect.c:
* src/haikuselect.h:
* src/haikuterm.c:
* src/haikuterm.h: Add new files for Haiku windowing
support.
* src/haiku.c: Add new files for Haiku operating system
support.
* src/image.c: Implement image transforms and native XPM
support
on Haiku.
(GET_PIXEL, PUT_PIXEL, NO_PIXMAP)
(PIX_MASK_RETAIN, PIX_MASK_DRAW)
(RGB_TO_ULONG, RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG, RED16_FROM_ULONG, GREEN16_FROM_ULONG)
(BLUE16_FROM_ULONG): Define to appropriate values on
Haiku.
(image_create_bitmap_from_data): Add Haiku support.
(image_create_bitmap_from_file): Add TODO on Haiku.
(free_bitmap_record): Free bitmap on Haiku.
(image_size_in_bytes): Implement for Haiku bitmaps.
(image_set_transform): Implement on Haiku.
(image_create_x_image_and_pixmap_1): Implement on Haiku,
24-bit or 1-bit only.
(image_destroy_x_image, image_get_x_image): Use correct
img and pixmap values on Haiku.
(lookup_rgb_color): Use correct macro on Haiku.
(image_to_emacs_colors): Implement on Haiku.
(image_disable_image): Disable on Haiku.
(image_can_use_native_api): Test for translator presence
on Haiku.
(native_image_load): Use translator on Haiku.
(imagemagick_load_image): Add Haiku-specific quirks.
(Fimage_transforms_p): Allow rotate90 on Haiku.
(image_types): Enable native XPM support on Haiku.
(syms_of_image): Enable XPM images on Haiku.
* src/keyboard.c (kbd_buffer_get_event)
(handle_async_input, handle_input_available_signal)
(handle_user_signal, Fset_input_interrupt_mode)
(init_keyboard): Check for USABLE_SIGPOLL along with
USABLE_SIGIO.
* src/lisp.h (pD): Work around broken Haiku headers.
(HAVE_EXT_MENU_BAR): Define on Haiku.
(handle_input_available_signal): Enable if we just have
SIGPOLL as well.
* src/menu.c (have_boxes): Return true on Haiku.
(single_menu_item): Enable toolkit menus on Haiku.
(find_and_call_menu_selection): Also enable on Haiku.
* src/process.c (keyboard_bit_set): Enable with only
usable SIGPOLL.
(wait_reading_process_output): Test for SIGPOLL as well
as SIGIO availability.
* src/sound.c (sound_perror, vox_open)
(vox_configure, vox_close): Enable for usable SIGPOLL as
well.
* src/sysdep.c (sys_subshell): Enable for usable SIGPOLL.
(reset_sigio): Make conditional on F_SETOWN.
(request_sigio, unrequest_sigio)
(emacs_sigaction_init): Also handle SIGPOLLs.
(init_sys_modes): Disable TCXONC usage on Haiku, as it
doesn't have any ttys other than pseudo ttys, which don't
support C-s/C-q flow control, and causes compiler warnings.
(speeds): Disable high speeds if HAVE_TINY_SPEED_T.
* src/termhooks.h (enum output_method): Add output_haiku.
(struct terminal): Add Haiku display info.
(TERMINAL_FONT_CACHE): Enable for Haiku.
* src/terminal.c (Fterminal_live_p): Return `haiku' if
appropriate.
* src/verbose.mk.in (AM_V_CXX, AM_V_CXXLD): New logging
variables.
* src/xdisp.c (redisplay_internal)
(note_mouse_highlight): Return on Haiku if a popup is activated.
(display_menu_bar): Return on Haiku if frame is a Haiku
frame.
* src/xfaces.c (GCGraphicsExposures): Enable correctly on Haiku.
(x_create_gc): Enable dummy GC code on Haiku.
* src/xfns.c (x-server-version, x-file-dialog): Add
Haiku specifics to doc strings.
* src/xterm.c (syms_of_xterm): Add Haiku information to
doc string.
2021-11-20 13:30:08 +00:00
|
|
|
|
(declare-function haiku-frame-geometry "haikufns.c" (&optional frame))
|
2015-08-21 09:00:59 +00:00
|
|
|
|
|
|
|
|
|
(defun frame-geometry (&optional frame)
|
|
|
|
|
"Return geometric attributes of FRAME.
|
|
|
|
|
FRAME must be a live frame and defaults to the selected one. The return
|
|
|
|
|
value is an association list of the attributes listed below. All height
|
|
|
|
|
and width values are in pixels.
|
|
|
|
|
|
|
|
|
|
`outer-position' is a cons of the outer left and top edges of FRAME
|
|
|
|
|
relative to the origin - the position (0, 0) - of FRAME's display.
|
|
|
|
|
|
|
|
|
|
`outer-size' is a cons of the outer width and height of FRAME. The
|
|
|
|
|
outer size includes the title bar and the external borders as well as
|
|
|
|
|
any menu and/or tool bar of frame.
|
|
|
|
|
|
|
|
|
|
`external-border-size' is a cons of the horizontal and vertical width of
|
|
|
|
|
FRAME's external borders as supplied by the window manager.
|
|
|
|
|
|
|
|
|
|
`title-bar-size' is a cons of the width and height of the title bar of
|
|
|
|
|
FRAME as supplied by the window manager. If both of them are zero,
|
|
|
|
|
FRAME has no title bar. If only the width is zero, Emacs was not
|
|
|
|
|
able to retrieve the width information.
|
|
|
|
|
|
|
|
|
|
`menu-bar-external', if non-nil, means the menu bar is external (never
|
|
|
|
|
included in the inner edges of FRAME).
|
|
|
|
|
|
|
|
|
|
`menu-bar-size' is a cons of the width and height of the menu bar of
|
|
|
|
|
FRAME.
|
|
|
|
|
|
|
|
|
|
`tool-bar-external', if non-nil, means the tool bar is external (never
|
|
|
|
|
included in the inner edges of FRAME).
|
|
|
|
|
|
|
|
|
|
`tool-bar-position' tells on which side the tool bar on FRAME is and can
|
|
|
|
|
be one of `left', `top', `right' or `bottom'. If this is nil, FRAME
|
|
|
|
|
has no tool bar.
|
|
|
|
|
|
|
|
|
|
`tool-bar-size' is a cons of the width and height of the tool bar of
|
|
|
|
|
FRAME.
|
|
|
|
|
|
|
|
|
|
`internal-border-width' is the width of the internal border of
|
|
|
|
|
FRAME."
|
|
|
|
|
(let* ((frame (window-normalize-frame frame))
|
|
|
|
|
(frame-type (framep-on-display frame)))
|
|
|
|
|
(cond
|
|
|
|
|
((eq frame-type 'x)
|
|
|
|
|
(x-frame-geometry frame))
|
|
|
|
|
((eq frame-type 'w32)
|
|
|
|
|
(w32-frame-geometry frame))
|
|
|
|
|
((eq frame-type 'ns)
|
|
|
|
|
(ns-frame-geometry frame))
|
Add support for the Haiku operating system and its window system
* .gitignore: Add binaries specific to Haiku.
* Makefie.in (HAVE_BE_APP): New variable.
(install-arch-dep): Install Emacs and Emacs.pdmp when
using Haiku.
* configure.ac: Detect and configure for Haiku and
various related configurations.
(be-app, be-freetype, be-cairo): New options.
(HAVE_BE_APP, HAIKU_OBJ, HAIKU_CXX_OBJ)
(HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(HAIKU, HAVE_TINY_SPEED_T): New define.
(emacs_config_features): Add BE_APP.
* doc/emacs/Makefile.in (EMACSSOURCES): Add Haiku
appendix.
* doc/emacs/emacs.texi: Add Haiku appendix to menus and
include it.
* doc/emacs/haiku.texi: New Haiku appendix.
* doc/lispref/display.texi (Defining Faces, Window Systems):
Explain meaning of `haiku' as a window system identifier.
(haiku-use-system-tooltips): Explain meaning of system
tooltips on
Haiku.
* doc/lispref/frames.texi (Multiple Terminals): Explain
meaning of haiku as a display type.
(Frame Layout): Clarify section for Haiku frames.
(Size Parameters): Explain limitations of fullwidth and
fullheight on Haiku.
(Management Parameters): Explain limitations of
inhibiting double buffering on builds with Cairo,
and the inability of frames with no-accept-focus to
receive keyboard input on Haiku.
(Font and Color Parameters): Explain the different font
backends available on Haiku.
(Raising and Lowering): Explain that lowering and
restacking frames doesn't work on Haiku.
(Child Frames): Explain oddities of child frame
visibility on Haiku.
* doc/lispref/os.texi (System Environment): Explain
meaning of haiku.
* etc/MACHINES: Add appropriate notices for Haiku.
* etc/NEWS: Document changes.
* etc/PROBLEMS: Document font spacing bug on Haiku.
* lib-src/Makefile.in: Build be-resources binary on
Haiku.
(CXX, CXXFLAGS, NON_CXX_FLAGS, ALL_CXXFLAGS)
(HAVE_BE_APP, HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(DONT_INSTALL): Add be-resources binary if on Haiku.
(be-resources): New target.
* lib-src/be_resources: Add helper binary for setting
resources on the Emacs application.
* lib-src/emacsclient.c (decode_options): Set
alt_display to "be" on Haiku.
* lisp/cus-edit.el (custom-button, custom-button-mouse)
(custom-button-unraised, custom-button-pressed): Update
face definitions for Haiku.
* lisp/cus-start.el: Add haiku-debug-on-fatal-error and
haiku-use-system-tooltips.
* lisp/faces.el (face-valid-attribute-values): Clarify
attribute comment for Haiku.
(tool-bar): Add appropriate toolbar color for Haiku.
* lisp/frame.el (haiku-frame-geometry)
(haiku-mouse-absolute-pixel-position)
(haiku-set-mouse-absolute-pixel-position)
(haiku-frame-edges)
(haiku-frame-list-z-order): New function declarations.
(frame-geometry, frame-edges)
(mouse-absolute-pixel-position)
(set-mouse-absolute-pixel-position)
(frame-list-z-order): Call appropriate window system
functions on Haiku.
(display-mouse-p, display-graphic-p)
(display-images-p, display-pixel-height)
(display-pixel-width, display-mm-height)
(display-mm-width, display-backing-store)
(display-save-under, display-planes)
(display-color-cells, display-visual-class): Update type
tests for Haiku.
* lisp/international/mule-cmds.el
(set-coding-system-map): Also
prevent set-terminal-coding-system from appearing in the menu
bar on Haiku.
* lisp/loadup.el: Load Haiku-specific files when built
with Haiku, and don't rename newly built Emacs on Haiku as BFS
doesn't support hard links.
* lisp/menu-bar.el (menu-bar-open): Add for Haiku.
* lisp/mwheel.el (mouse-wheel-down-event): Expect
wheel-up on Haiku.
(mouse-wheel-up-event): Expect wheel-down on Haiku.
(mouse-wheel-left-event): Expect wheel-left on Haiku.
(mouse-wheel-right-event): Expect wheel-right on Haiku.
* lisp/net/browse-url.el
(browse-url--browser-defcustom-type):
Add option for WebPositive.
(browse-url-webpositive-program): New variable.
(browse-url-default-program): Search for WebPositive.
(browse-url-webpositive): New function.
* lisp/net/eww.el (eww-form-submit, eww-form-file)
(eww-form-checkbox, eww-form-select): Define faces
appropriately for Haiku.
* lisp/term/haiku-win.el: New file.
* lisp/tooltip.el (menu-or-popup-active-p): New function
declaration.
(tooltip-show-help): Don't use tooltips on Haiku when a
menu is active.
* lisp/version.el (haiku-get-version-string): New
function declaration.
(emacs-version): Add Haiku version string if
appropriate.
* src/Makefile.in: Also produce binary named "Emacs"
with Haiku resources set.
(CXX, HAIKU_OBJ, HAIKU_CXX_OBJ, HAIKU_LIBS)
(HAIKU_CFLAGS, HAVE_BE_APP, NON_CXX_FLAGS)
(ALL_CXX_FLAGS): New variables.
(.SUFFIXES): Add .cc.
(.cc.o): New target.
(base_obj): Add Haiku C objects.
(doc_obj, obj): Split objects that should scanned for
documentation into doc_obj.
(SOME_MACHINE_OBJECTS): Add appropriate Haiku C objects.
(all): Depend on Emacs and Emacs.pdmp on Haiku.
(LIBES): Add Haiku libraries.
(gl-stamp)
($(etc)/DOC): Scan doc_obj instead of obj
(temacs$(EXEEXT): Use C++ linker on Haiku.
(ctagsfiles3): New variable.
(TAGS): Scan C++ files.
* src/alloc.c (garbage_collect): Mark Haiku display.
* src/dispextern.h (HAVE_NATIVE_TRANSFORMS): Also enable
on Haiku.
(struct image): Add fields for Haiku transforms.
(RGB_PIXEL_COLOR): Define to unsigned long on Haiku as
well.
(sit_for): Also check USABLE_SIGPOLL.
(init_display_interactive): Set initial window system to
Haiku on Haiku builds.
* src/emacs.c (main): Define Haiku syms and init haiku
clipboard.
(shut_down_emacs): Quit BApplication on Haiku and
trigger debug
on aborts if haiku_debug_on_fatal_error.
(Vsystem_type): Update docstring.
* src/fileio.c (next-read-file-uses-dialog-p): Enable on
Haiku.
* src/filelock.c (WTMP_FILE): Only define if BOOT_TIME
is also defined.
* src/floatfns.c (double_integer_scale): Work around
Haiku libroot brain damage.
* src/font.c (syms_of_font): Define appropriate font
driver symbols for Haiku builds with various options.
* src/font.h: Also enable ftcrfont on Haiku builds with
Cairo.
(font_data_structures_may_be_ill_formed): Also enable on
Haiku builds that have Cairo.
* src/frame.c (Fframep): Update doc-string for Haiku
builds and return haiku if appropriate.
(syms_of_frame): New symbol `haiku'.
* src/frame.h (struct frame): Add output data for Haiku.
(FRAME_HAIKU_P): New macro.
(FRAME_WINDOW_P): Test for Haiku frames as well.
* src/ftcrfont.c (RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG): New macros.
(ftcrfont_draw): Add haiku specific code for Haiku
builds with Cairo.
* src/ftfont.c (ftfont_open): Set face.
(ftfont_has_char, ftfont_text_extents): Work around
crash.
(syms_of_ftfont): New symbol `mono'.
* src/ftfont.h (struct font_info): Enable Cairo-specific
fields for Cairo builds on Haiku.
* src/haiku_draw_support.cc:
* src/haiku_font_support.cc:
* src/haiku_io.c:
* src/haiku_select.cc:
* src/haiku_support.cc:
* src/haiku_support.h:
* src/haikufns.c:
* src/haikufont.c:
* src/haikugui.h:
* src/haikuimage.c:
* src/haikumenu.c:
* src/haikuselect.c:
* src/haikuselect.h:
* src/haikuterm.c:
* src/haikuterm.h: Add new files for Haiku windowing
support.
* src/haiku.c: Add new files for Haiku operating system
support.
* src/image.c: Implement image transforms and native XPM
support
on Haiku.
(GET_PIXEL, PUT_PIXEL, NO_PIXMAP)
(PIX_MASK_RETAIN, PIX_MASK_DRAW)
(RGB_TO_ULONG, RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG, RED16_FROM_ULONG, GREEN16_FROM_ULONG)
(BLUE16_FROM_ULONG): Define to appropriate values on
Haiku.
(image_create_bitmap_from_data): Add Haiku support.
(image_create_bitmap_from_file): Add TODO on Haiku.
(free_bitmap_record): Free bitmap on Haiku.
(image_size_in_bytes): Implement for Haiku bitmaps.
(image_set_transform): Implement on Haiku.
(image_create_x_image_and_pixmap_1): Implement on Haiku,
24-bit or 1-bit only.
(image_destroy_x_image, image_get_x_image): Use correct
img and pixmap values on Haiku.
(lookup_rgb_color): Use correct macro on Haiku.
(image_to_emacs_colors): Implement on Haiku.
(image_disable_image): Disable on Haiku.
(image_can_use_native_api): Test for translator presence
on Haiku.
(native_image_load): Use translator on Haiku.
(imagemagick_load_image): Add Haiku-specific quirks.
(Fimage_transforms_p): Allow rotate90 on Haiku.
(image_types): Enable native XPM support on Haiku.
(syms_of_image): Enable XPM images on Haiku.
* src/keyboard.c (kbd_buffer_get_event)
(handle_async_input, handle_input_available_signal)
(handle_user_signal, Fset_input_interrupt_mode)
(init_keyboard): Check for USABLE_SIGPOLL along with
USABLE_SIGIO.
* src/lisp.h (pD): Work around broken Haiku headers.
(HAVE_EXT_MENU_BAR): Define on Haiku.
(handle_input_available_signal): Enable if we just have
SIGPOLL as well.
* src/menu.c (have_boxes): Return true on Haiku.
(single_menu_item): Enable toolkit menus on Haiku.
(find_and_call_menu_selection): Also enable on Haiku.
* src/process.c (keyboard_bit_set): Enable with only
usable SIGPOLL.
(wait_reading_process_output): Test for SIGPOLL as well
as SIGIO availability.
* src/sound.c (sound_perror, vox_open)
(vox_configure, vox_close): Enable for usable SIGPOLL as
well.
* src/sysdep.c (sys_subshell): Enable for usable SIGPOLL.
(reset_sigio): Make conditional on F_SETOWN.
(request_sigio, unrequest_sigio)
(emacs_sigaction_init): Also handle SIGPOLLs.
(init_sys_modes): Disable TCXONC usage on Haiku, as it
doesn't have any ttys other than pseudo ttys, which don't
support C-s/C-q flow control, and causes compiler warnings.
(speeds): Disable high speeds if HAVE_TINY_SPEED_T.
* src/termhooks.h (enum output_method): Add output_haiku.
(struct terminal): Add Haiku display info.
(TERMINAL_FONT_CACHE): Enable for Haiku.
* src/terminal.c (Fterminal_live_p): Return `haiku' if
appropriate.
* src/verbose.mk.in (AM_V_CXX, AM_V_CXXLD): New logging
variables.
* src/xdisp.c (redisplay_internal)
(note_mouse_highlight): Return on Haiku if a popup is activated.
(display_menu_bar): Return on Haiku if frame is a Haiku
frame.
* src/xfaces.c (GCGraphicsExposures): Enable correctly on Haiku.
(x_create_gc): Enable dummy GC code on Haiku.
* src/xfns.c (x-server-version, x-file-dialog): Add
Haiku specifics to doc strings.
* src/xterm.c (syms_of_xterm): Add Haiku information to
doc string.
2021-11-20 13:30:08 +00:00
|
|
|
|
((eq frame-type 'haiku)
|
|
|
|
|
(haiku-frame-geometry frame))
|
2015-08-21 09:00:59 +00:00
|
|
|
|
(t
|
|
|
|
|
(list
|
|
|
|
|
'(outer-position 0 . 0)
|
|
|
|
|
(cons 'outer-size (cons (frame-width frame) (frame-height frame)))
|
|
|
|
|
'(external-border-size 0 . 0)
|
Add new frame parameters and associated functions
Add new frame parameters `undecorated', `override-redirect',
`parent-frame', `skip-taskbar', `no-focus-on-map',
`no-accept-focus', `z-group', `delete-before', `no-other-frame',
`mouse-wheel-frame', `min-width', `min-height'. Add new
functions `frame-restack' and `frame-list-z-order'.
* lisp/cus-start.el (focus-follows-mouse): Adapt customization
type.
* lisp/frame.el (handle-delete-frame): Handle child and
`delete-before' frames.
(other-frame): Stop looking for other frame after one round.
(frame-list-z-order, frame-restack): New functions.
(delete-other-frames): Handle child frames.
* lisp/frameset.el (frameset-persistent-filter-alist)
(frameset--record-relationships): Handle `delete-before',
`parent-frame' and `mouse-wheel-frame' parameters. Rename
latter from `frameset--record-minibuffer-relationships'.
(frameset--restore-frame): Handle ‘parent-frame’ parameter
specially.
(frameset-restore): Handle `delete-before', `parent-frame' and
`mouse-wheel-frame' parameters.
* lisp/mwheel.el (mwheel-scroll): Handle `mouse-wheel-frame'
parameter.
* lisp/window.el (window--min-size-ignore-p): Fix doc-string.
(mouse-autoselect-window-select, handle-select-window): Major
rewrite. Try to not ignore errors. Handle auto-selection of
child frames and different values of `focus-follows-mouse'.
* src/frame.c (frame_windows_min_size): Handle new `min-width'
and `min-height' frame parameters.
(make_frame): Initialize new frame structure members.
(do_switch_frame): Don't reset internal_last_event_frame for
descendant frames.
(Fframe_parent, frame_ancestor_p, Fframe_ancestor_p): New
functions.
(candidate_frame): Don't return `no-other-frame' frame.
(other_frames): New function replacing other_visible_frames.
(delete_frame): Rewrite. Handle child and `delete-before' frames.
(Fmake_frame_invisible): Call other_frames.
(store_frame_param): Check `delete-before' and `parent-frame'
parameters for circular dependencies.
(frame_parms, syms_of_frame): Add entries for and define new
frame parameters.
(focus_follows_mouse): New meaningful value `auto-raise'.
* src/frame.h (z_group): New enumeration type.
(frame): New slots parent_frame, undecorated, override_redirect,
skip_taskbar, no_focus_on_map, no_accept_focus, z_group.
(fset_parent_frame): New inlined function.
(FRAME_UNDECORATED, FRAME_OVERRIDE_REDIRECT)
(FRAME_PARENT_FRAME, FRAME_SKIP_TASKBAR, FRAME_NO_FOCUS_ON_MAP)
(FRAME_NO_ACCEPT_FOCUS, FRAME_Z_GROUP, FRAME_Z_GROUP_NONE)
(FRAME_Z_GROUP_ABOVE, FRAME_Z_GROUP_ABOVE_SUSPENDED)
(FRAME_Z_GROUP_BELOW): New macros.
(frame_ancestor_p): Add declaration.
* src/gtkutil.c (xg_create_frame_widgets): Handle
`undecorated' and `override-redirect' frame parameters.
(x_wm_set_size_hint): None for child frames.
(xg_set_undecorated, xg_frame_restack, xg_set_skip_taskbar)
(xg_set_no_focus_on_map, xg_set_no_accept_focus)
(xg_set_override_redirect): New functions.
(xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos):
Don't let scrollbars obscure child frames.
* src/gtkutil.h: (xg_set_undecorated, xg_frame_restack)
(xg_set_skip_taskbar, xg_set_no_focus_on_map)
(xg_set_no_accept_focus, xg_set_override_redirect): Add extern
declarations.
* src/nsfns.m (ns_frame_parm_handlers): Add entries for new
frame parameters.
(Fx_create_frame): Install `min-width' and `min-height' frame
parameters.
* src/nsterm.m (mouseMoved:): Handle focus_follows_mouse change.
* src/w32fns.c (WS_EX_NOACTIVATE): Define if necessary.
(x_real_positions): Handle child frames.
(x_set_menu_bar_lines): Don't for child frames.
(x_set_undecorated, x_set_parent_frame, x_set_skip_taskbar)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_z_group): New functions.
(w32_createvscrollbar, w32_createhscrollbar): Don't draw
scroll bars over child frames.
(w32_createwindow): Handle new frame parameters and child frames.
(w32_wnd_proc): Let mouse clicks into a child frame activate
the frame. Try to handle the `no-accept-focus' parameter. Do
SetFocus when our window is brought to top or becomes the
foreground window.
(w32_window): Don't initialize menu bar for child frames.
(Fx_create_frame): Handle new frame parameters.
(x_create_tip_frame): Set explicit_parent slot.
(w32_dialog_in_progress): New function.
(Fx_file_dialog): Handle `z-group-above' frames.
(w32_frame_list_z_order, Fw32_frame_list_z_order)
(w32_frame_restack, Fw32_frame_restack): New functions.
(w32_frame_parm_handlers): Add entries for new frame
parameters.
* src/w32font.c (Fx_select_font): Handle `z-group-above'
frames during font selection dialogue.
* src/w32term.c (construct_mouse_wheel): Construct mouse wheel
event from F's w32 window.
(w32_mouse_position): Handle child frames.
(w32_set_vertical_scroll_bar, w32_set_horizontal_scroll_bar):
Don't draw scroll bars over child frames.
(w32_read_socket): Always erase background of child frames.
When generating SELECT_WINDOW_EVENTs handle new value of
`focus-follows-mouse' and handle `no-accept-focus' parameter.
Handle `mouse-wheel-frame' parameter.
(x_calc_absolute_position, x_set_offset, x_set_window_size):
Handle child frames.
(x_make_frame_visible): Handle child frames specially. Handle
`no-focus-on-map' parameter.
* src/w32term.h (w32_dialog_in_progress): Add external
declaration.
* src/xdisp.c (x_consider_frame_title, prepare_menu_bars): Not
for child frames.
* src/xfns.c (Xm/MwmUtil.h): Include for WM hints.
(PropMotifWmHints, PROP_MOTIF_WM_HINTS_ELEMENTS): Define for
non-Motif, non-GTK case.
(x_real_pos_and_offsets): Handle child frames.
(x_set_undecorated, x_set_parent_frame)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_override_redirect): New functions.
(x_set_menu_bar_lines): Not for child frames.
(x_window): Handle `undecorated' and `override_redirect' cases.
(Fx_create_frame): Handle new frame parameters.
(frame_geometry): Handle child frames and outer border.
(x_frame_list_z_order, Fx_frame_list_z_order)
(x_frame_restack, Fx_frame_restack): New functions.
(Fx_file_dialog, Fx_select_font): Set x_menu_set_in_use.
(x_frame_parm_handlers): Add entries for new frame parameters.
* src/xmenu.c (x_menu_set_in_use): Handle `z-group-above'
frames.
* src/xterm.c (x_set_frame_alpha): Don't set alpha of parent
for child frames.
(XTmouse_position): Handle child frames.
(x_scroll_bar_create, x_scroll_bar_expose): Don't let scroll
bars obscure child frames.
(handle_one_xevent): Handle child frame positions. If necessary
set `skip-taskbar' and reassign proper `z-group' when we are
mapped. When generating SELECT_WINDOW_EVENTs handle new value
of `focus-follows-mouse'. Handle `mouse-wheel-frame' parameter.
Let mouse clicks into a child frame activate the frame.
(x_calc_absolute_position, x_set_offset): Handle child frames
specially.
(x_set_skip_taskbar, x_set_z_group): New functions.
(x_make_frame_visible): Handle child frames.
(ATOM_REFS_INIT): Add entries for
Xatom_net_wm_state_skip_taskbar, Xatom_net_wm_state_above,
Xatom_net_wm_state_below.
* src/xterm.h (top-level): Declare Xatom_net_wm_state_above,
Xatom_net_wm_state_below and Xatom_net_wm_state_skip_taskbar.
(x_set_skip_taskbar, x_set_z_group): Add extern declarations.
2017-04-12 08:38:25 +00:00
|
|
|
|
'(outer-border-width . 0)
|
2015-08-21 09:00:59 +00:00
|
|
|
|
'(title-bar-size 0 . 0)
|
|
|
|
|
'(menu-bar-external . nil)
|
|
|
|
|
(let ((menu-bar-lines (frame-parameter frame 'menu-bar-lines)))
|
|
|
|
|
(cons 'menu-bar-size
|
|
|
|
|
(if menu-bar-lines
|
|
|
|
|
(cons (frame-width frame) 1)
|
|
|
|
|
1 0)))
|
|
|
|
|
'(tool-bar-external . nil)
|
|
|
|
|
'(tool-bar-position . nil)
|
|
|
|
|
'(tool-bar-size 0 . 0)
|
Frame-local tab-bar and window-local tab-line.
* etc/NEWS: Add 'tab-bar-mode' and 'global-tab-line-mode'.
* etc/TODO: Remove tab-related items.
* lisp/cus-start.el: Add tab-bar-mode, tab-bar-max-label-size.
* lisp/frame.el (frame-notice-user-settings): handle tab-bar-lines.
* lisp/loadup.el: Load "tab-bar".
* lisp/menu-bar.el (menu-bar-options-save): Add tab-bar-mode.
(menu-bar-showhide-menu): Define showhide-tab-bar.
* lisp/startup.el (tab-bar-images-pixel-height): New defconst.
(command-line): Reset tab-bar-mode.
(x-apply-session-resources): Add "tabBar", "TabBar".
* lisp/subr.el (read-key): Add tab-bar.
* lisp/tab-bar.el: New file.
* lisp/tab-line.el: New file.
* lisp/window.el (window--dump-frame): Add tab-bar-height.
* src/dispextern.h (enum window_part): Add ON_TAB_LINE.
(struct glyph_matrix): Add tab_line_p.
(struct glyph_row): Add tab_line_p.
(MATRIX_TAB_LINE_ROW): New macro.
(MATRIX_FIRST_TEXT_ROW): Handle more mode lines.
(MR_PARTIALLY_VISIBLE_AT_TOP): Add WINDOW_TAB_LINE_HEIGHT.
(MATRIX_TAB_LINE_HEIGHT, CURRENT_TAB_LINE_HEIGHT)
(DESIRED_TAB_LINE_HEIGHT): New macros.
(enum face_id): Add TAB_BAR_FACE_ID and TAB_LINE_FACE_ID.
(struct it): Add tab_line_p.
(tab_bar_item_idx, tab_bar_item_image): New enums.
(DEFAULT_TAB_BAR_LABEL_SIZE, DEFAULT_TAB_BAR_BUTTON_MARGIN)
(DEFAULT_TAB_BAR_BUTTON_RELIEF, DEFAULT_TAB_BAR_IMAGE_HEIGHT):
New constants.
* src/dispnew.c (adjust_glyph_matrix): Use window_wants_tab_line.
(shift_glyph_matrix): Add WINDOW_TAB_LINE_HEIGHT.
(clear_current_matrices, clear_desired_matrices):
Call clear_glyph_matrix on tab_bar_window.
(blank_row): Add WINDOW_TAB_LINE_HEIGHT.
(required_matrix_height): Change 2 to 3.
(fake_current_matrices): Reset tab_line_p.
(adjust_frame_glyphs_for_window_redisplay): Handle tab_bar_window.
Add FRAME_TAB_BAR_HEIGHT and FRAME_TAB_BAR_LINES.
(free_glyphs): Handle tab_bar_window.
(update_frame): Handle tab_bar_window.
(update_window): Handle row->tab_line_p.
(scrolling_window): Change arg type from bool to int.
Change header_line_p to tab_line_p.
(buffer_posn_from_coords): Add window_wants_tab_line.
(mode_line_string): Use MATRIX_TAB_LINE_ROW for part ON_TAB_LINE.
* src/frame.c (frame_default_tab_bar_height): New internal variable.
(adjust_frame_size): Handle tab_bar_window.
(make_frame): Reset tab_bar_redisplayed, tab_bar_resized and
last_tab_bar_item.
(Ftab_bar_pixel_width): New function.
(frame_parms): Add tab-bar-lines.
(gui_figure_window_size): Add new arg tabbar_p.
(syms_of_frame): Add Qtab_bar_size, Qupdate_frame_tab_bar,
Qfree_frame_tab_bar, Qtab_bar_lines, Stab_bar_pixel_width.
Add Qtab_bar_lines to frame_inhibit_implied_resize.
(tab-bar-mode): New variable.
* src/frame.h (GCALIGNED_STRUCT): Add tab_bar_window,
desired_tab_bar_string, current_tab_bar_string.
(GCALIGNED_STRUCT): Add tab_bar_items, last_tab_bar_item,
minimize_tab_bar_window_p, tab_bar_redisplayed, tab_bar_resized,
tab_bar_lines, tab_bar_height, n_tab_bar_rows, n_tab_bar_items.
(fset_tab_bar_items, fset_tab_bar_window)
(fset_current_tab_bar_string, fset_desired_tab_bar_string):
New inlines.
(FRAME_TAB_BAR_LINES, FRAME_TAB_BAR_HEIGHT): New macros.
(FRAME_TOP_MARGIN, FRAME_TOP_MARGIN_HEIGHT):
Use FRAME_TAB_BAR_LINES.
* src/fringe.c (draw_fringe_bitmap_1, update_window_fringes):
Add WINDOW_TAB_LINE_HEIGHT.
* src/gtkutil.c (xg_frame_set_char_size): Add FRAME_TABBAR_WIDTH.
(x_wm_set_size_hint): Add FRAME_TABBAR_WIDTH.
* src/keyboard.c (read_char): Handle Qtab_bar.
(kbd_buffer_get_event): Handle TAB_BAR_EVENT.
(make_lispy_position): Add WINDOW_TAB_LINE_HEIGHT.
Handle TAB_BAR_EVENT.
(tab_bar_items_vector, tab_bar_item_properties, ntab_bar_items):
New internal variables.
(tab_bar_items, process_tab_bar_item, set_prop_tab_bar)
(parse_tab_bar_item, init_tab_bar_items, append_tab_bar_item):
New functions.
(read_char_x_menu_prompt, read_key_sequence): Handle Qtab_bar.
(tab-bar-separator-image-expression): New variable.
* src/keymap.c (syms_of_keymap): Add Qtab_bar and Qtab_line.
* src/menu.c (x_popup_menu_1, Fx_popup_dialog): Handle Qtab_bar.
* src/termhooks.h (enum event_kind): Add TAB_BAR_EVENT.
(GCALIGNED_STRUCT): Add change_tab_bar_height_hook.
* src/w32fns.c (w32_frame_parm_handlers): Add w32_set_tab_bar_lines.
* src/w32term.c (w32_draw_window_cursor): Add WINDOW_TAB_LINE_HEIGHT.
* src/window.c (window_body_height): Add WINDOW_TAB_LINE_HEIGHT.
(Fwindow_tab_line_height): New function.
(coordinates_in_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(window_relative_x_coord): Add ON_TAB_LINE.
(Fcoordinates_in_window_p): Add ON_TAB_LINE.
(window_from_coordinates): Add new arg tab_bar_p.
(Fwindow_line_height): Use window_wants_tab_line with
WINDOW_TAB_LINE_HEIGHT.
(Fwindow_lines_pixel_dimensions): Add WINDOW_TAB_LINE_HEIGHT.
(make_window): Set tab_line_height to -1.
(window_wants_tab_line): New function.
(window_internal_height): Use window_wants_tab_line.
(window_scroll_pixel_based): Add WINDOW_TAB_LINE_HEIGHT.
(Frecenter): Set minimize_tab_bar_window_p to 1.
(GCALIGNED_STRUCT): Add frame_tab_bar_lines and frame_tab_bar_height.
(Fcurrent_window_configuration): Set frame_tab_bar_lines and
frame_tab_bar_height.
(set_window_scroll_bars): Add WINDOW_TAB_LINE_HEIGHT.
(syms_of_window): Add Qtab_line_format and Swindow_tab_line_height.
* src/window.h (GCALIGNED_STRUCT): Add tab_line_height.
(WINDOW_TAB_BAR_P, WINDOW_TAB_LINE_HEIGHT, WINDOW_TAB_LINE_LINES):
New macros.
(WINDOW_TOP_EDGE_Y, WINDOW_BOTTOM_EDGE_Y, WINDOW_TAB_LINE_HEIGHT):
Add WINDOW_TAB_BAR_P.
* src/xdisp.c (window_box_height): Add window_wants_tab_line with
MATRIX_TAB_LINE_ROW and CURRENT_TAB_LINE_HEIGHT.
(pos_visible_p): Use window_wants_tab_line.
Add WINDOW_TAB_LINE_HEIGHT.
(get_glyph_string_clip_rects): Add WINDOW_TAB_LINE_HEIGHT.
(get_phys_cursor_geometry): Add WINDOW_TAB_LINE_HEIGHT.
(remember_mouse_glyph): Use MATRIX_TAB_LINE_ROW for part
ON_TAB_LINE.
(init_iterator): Use MATRIX_TAB_LINE_ROW for TAB_LINE_FACE_ID.
Add WINDOW_TAB_LINE_HEIGHT. Add window_wants_tab_line.
(Fwindow_text_pixel_size): Add WINDOW_TAB_LINE_HEIGHT.
(prepare_menu_bars): Call update_tab_bar.
(update_tab_bar, build_desired_tab_bar_string)
(display_tab_bar_line, tab_bar_height, Ftab_bar_height)
(redisplay_tab_bar, tab_bar_item_info, get_tab_bar_item)
(handle_tab_bar_click, note_tab_bar_highlight): New functions.
(compute_window_start_on_continuation_line): Use window_wants_tab_line.
(try_cursor_movement): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(redisplay_window): Use window_wants_tab_line with
CURRENT_TAB_LINE_HEIGHT.
(try_window_reusing_current_matrix): Use window_wants_tab_line
with WINDOW_TAB_LINE_HEIGHT.
(Fdump_tab_bar_row): New function.
(compute_line_metrics): Add WINDOW_TAB_LINE_HEIGHT.
(display_line): Use window_wants_tab_line.
(display_mode_line): Set tab_line_p to true if face_id is
TAB_LINE_FACE_ID.
(Fformat_mode_line): Handle Qtab_line and Qtab_bar.
(gui_clear_end_of_line): Add WINDOW_TAB_LINE_HEIGHT.
(erase_phys_cursor): Use WINDOW_TAB_LINE_HEIGHT.
(show_mouse_face): Use tab_bar_window.
(note_mode_line_or_margin_highlight): Use MATRIX_TAB_LINE_ROW for
area ON_TAB_LINE.
(note_mouse_highlight): Call note_tab_bar_highlight,
(expose_frame): Handle tab_bar_window.
(syms_of_xdisp): Add Sdump_tab_bar_row and Stab_bar_height.
(auto-resize-tab-bars, auto-raise-tab-bar-buttons)
(tab-bar-border, tab-bar-button-margin, tab-bar-button-relief)
(tab-bar-max-label-size): New variables.
* src/xfaces.c (lookup_basic_face): Add TAB_LINE_FACE_ID and
TAB_BAR_FACE_ID.
(syms_of_xfaces): Define Qtab_bar and Qtab_line.
* src/xfns.c (x_set_tab_bar_lines, x_change_tab_bar_height):
New functions.
(xic_set_statusarea): Add FRAME_TABBAR_TOP_HEIGHT.
(frame_geometry): Add FRAME_TAB_BAR_HEIGHT and Qtab_bar_size.
* src/xterm.c (x_draw_image_relief): Use tab_bar_button_relief.
(x_draw_image_relief): Use TAB_BAR_FACE_ID.
(handle_one_xevent): Handle tab_bar_window.
(x_set_window_size_1): Add FRAME_TABBAR_WIDTH.
(x_create_terminal): Set change_tab_bar_height_hook.
* src/xterm.h (struct x_output): Add tabbar_top_height,
tabbar_bottom_height, tabbar_left_width, tabbar_right_width
tabbar_widget, tabbar_in_hbox, tabbar_is_packed.
(FRAME_TABBAR_TOP_HEIGHT): Add FRAME_TABBAR_TOP_HEIGHT,
FRAME_TABBAR_BOTTOM_HEIGHT, FRAME_TABBAR_HEIGHT,
FRAME_TABBAR_LEFT_WIDTH, FRAME_TABBAR_RIGHT_WIDTH,
FRAME_TABBAR_WIDTH.
2019-08-31 20:40:07 +00:00
|
|
|
|
'(tab-bar-size 0 . 0)
|
2015-08-21 09:00:59 +00:00
|
|
|
|
(cons 'internal-border-width
|
|
|
|
|
(frame-parameter frame 'internal-border-width)))))))
|
|
|
|
|
|
Allow setting frame pixel sizes from frame parameters (Bug#21415)
Also fix some misfeatures in frame (re-)sizing code, add more
debugging information and remove some dead code.
* lisp/frame.el (frame-notice-user-settings, make-frame): Change
parameter names when setting `frame-size-history'.
(frame--size-history): New function.
* src/frame.c (frame_inhibit_resize): If frame has not been made
yet, return t if inhibit_horizontal_resize or
inhibit_vertical_resize bit have been set.
(adjust_frame_size): Simplify.
(make_frame): Initialize inhibit_horizontal_resize,
inhibit_vertical_resize, tool_bar_redisplayed, tool_bar_resized.
(Fframe_after_make_frame): Reset inhibit_horizontal_resize and
inhibit_vertical_resize slots.
(x_set_frame_parameters): Handle `text-pixels' specification for
width and height parameters. Don't consider new_height or
new_width changes. Call adjust_frame_size instead of
Fset_frame_size.
(x_figure_window_size): Two new arguments x_width and y_width
returning frame's figures width and height. Calculate tool bar
height before frame sizes so SET_FRAME_HEIGHT can pick it up.
Handle `text-pixels' specification for width and height
parameters.
(Qtext_pixels, Qx_set_frame_parameters, Qset_frame_size)
(Qx_set_window_size_1, Qx_set_window_size_2)
(Qx_set_window_size_3, Qx_set_menu_bar_lines)
(Qupdate_frame_menubar, Qfree_frame_menubar_1)
(Qfree_frame_menubar_2): New symbols.
* src/frame.h (structure frame): New booleans
tool_bar_redisplayed, tool_bar_resized,
inhibit_horizontal_resize, inhibit_vertical_resize.
(x_figure_window_size): Update external declaration.
* src/gtkutil.c (xg_frame_set_char_size): Set size hints before
calling gtk_window_resize.
(update_frame_tool_bar): Make inhibiting of frame resizing more
discriminative. Set tool_bar_resized bit.
* src/nsfns.m (x_set_tool_bar_lines): Make inhibiting of frame
resizing more discriminative. Call adjust_frame_size instead of
x_set_window_size.
(Fx_create_frame): Handle x_width and x_height if
set by x_figure_window_size.
* src/nsterm.m (x_set_window_size): For GNUSTEP build don't
subtract 3 from tool bar height.
(x_set_window_size): Add frame_size_history_add call.
(x_new_font): Call adjust_frame_size instead of
x_set_window_size.
* src/w32fns.c (x_change_tool_bar_height): Reset
tool_bar_redisplayed and tool_bar_resized bits when adding tool
bar. Make inhibiting of frame resizing more discriminative.
(w32_wnd_proc): Remove dead code in WM_WINDOWPOSCHANGING case.
(Fx_create_frame): Handle x_width and x_height if set by
x_figure_window_size. Set size hints before adjusting frame size.
(x_create_tip_frame): Adjust x_figure_window_size call.
* src/w32term.c (x_set_window_size): Add frame_size_history_add
call.
* src/widget.c (set_frame_size): Remove dead code. Add
frame_size_history_add call. When frame_resize_pixelwise is t
use FRAME_PIXEL_WIDTH and FRAME_PIXEL_HEIGHT instead of
pixel_width and pixel_height.
(update_various_frame_slots): Remove dead code.
(EmacsFrameResize): Add more information in
frame_size_history_add call.
(EmacsFrameQueryGeometry): Round only when frame_resize_pixelwise
is not set.
* src/xdisp.c (redisplay_tool_bar): Set tool_bar_redisplayed bits.
* src/xfns.c (x_set_menu_bar_lines): Change argument name.
(x_change_tool_bar_height): Reset tool_bar_redisplayed and
tool_bar_resized bits when adding tool bar. Make inhibiting of
frame resizing more discriminative.
(Fx_create_frame): Handle x_width and x_height if set by
x_figure_window_size. Set size hints before adjusting frame size.
(x_create_tip_frame): Adjust x_figure_window_size call.
* src/xmenu.c (update_frame_menubar): Don't handle Lucid specially.
(set_frame_menubar): On Lucid never add core-border-width to
avoid that adding XtNinternalBorderWidth adds it again.
(free_frame_menubar): Handle frame_inhibit_resize true for Motif.
* src/xterm.c (x_new_font): In non-toolkit case handle size
change of menu bar.
(x_set_window_size_1): Fix calls to frame_size_history_add.
(x_wm_set_size_hint): Remove dead code. Set
size_hints.min_width and size_hints.min_height to base_width and
base_height.
2015-10-13 10:11:43 +00:00
|
|
|
|
(defun frame--size-history (&optional frame)
|
|
|
|
|
"Print history of resize operations for FRAME.
|
Major rewrite of adjust_frame_size
Have adjust_frame_size pass native frame sizes to backends
instead of text sizes. Expand frame size history management.
Drop PIXELWISE argument from change_frame_size and convert
native to text sizes only when calling adjust_frame_size. Use
convention in arguments that -1 instead of 0 means that no size
change is required. When adjusting frame sizes pick up delayed
size changes (Bug#46827).
* lisp/frame.el (frame-notice-user-settings, make-frame): Don't
set frame size history.
(frame--size-history): Rewrite doc-string. Handle new formats
of `frame-size-history' entries.
* src/dispextern.h (delayed_size_change): Extern it.
(change_frame_size): Drop last argument from extern.
* src/dispnew.c (delayed_size_change): Make it global.
(handle_window_change_signal): Reformat. Drop last argument
from change_frame_size call.
(do_pending_window_change, init_display_interactive): Drop last
argument from change_frame_size call.
(change_frame_size_1): NEW_WIDTH and NEW_HEIGHT now specify
native sizes. Drop last argument PIXELWISE. Queue a change
when it either differs from F's current pixel sizes or F's
previously queued sizes. Inject frame_size_history_extra call
when queuing. Adopt convention that for queued sizes -1 means
that no size change is required. Convert from native to text
sizes when calling adjust_frame_size.
(change_frame_size): Drop last argument PIXELWISE and drop it
also in change_frame_size_1 calls.
* src/frame.c (frame_size_history_add): Remove.
(frame_inhibit_resize): Remove call to frame_size_history_add.
(set_menu_bar_lines, set_tab_bar_lines): Simplify. Drop last
argument from change_frame_size call.
(frame_windows_min_size): No more static.
(keep_ratio): Minor rewrite using macros.
(frame_size_history_adjust, frame_size_history_plain)
(frame_size_history_extra): New functions.
(adjust_frame_size): Major rewrite. Adopt new convention that
negative values for new sizes mean no change. Pick up delayed
size changes from F's new_width and new_height slots
(Bug#46827). Call set_window_size_hook with native instead of
text sizes. Do not sanitize window sizes any more. Call
frame_size_history_adjust instead of frame_size_history_add.
Always set F's resized_p slot to true.
(make_frame): Initialize new_width and new_height slots to -1.
Simplify setup of initial sizes and an adjust_frame_size call.
(Fframe_parameters): Drop processing F's new_pixelwise slot.
(check_frame_pixels): Reorder to make declarations appear first.
(Fset_frame_height, Fset_frame_width, Fset_frame_size): Pass
explicit width and height values to adjust_frame_size instead of
-1.
(gui_set_frame_parameters): Minor rewrite making sure that
explicit sizes and the corresponding parameter are passed to
adjust_frame_size. Remove frame_size_history_add call.
(gui_figure_window_size): Drop last two arguments. Simplify
assignment of initial size. Set new_height and new_width slots
to -1. Use adjust_frame_size to set sizes instead of returning
them to caller.
(syms_of_frame): Drop symbols used by frame size history; these
are now built on-the-fly. Also drop some menu bar related
symbols in favor of Qmenu_bar_lines.
* src/frame.h (struct frame): Remove new_pixelwise.
(SET_FRAME_COLS, SET_FRAME_LINES, SET_FRAME_WIDTH)
(SET_FRAME_HEIGHT): Remove macros.
(frame_size_history_add): Remove externs.
(frame_windows_min_size, frame_size_history_plain)
(frame_size_history_extra): Add externs.
(FRAME_WINDOWS_WIDTH, FRAME_WINDOWS_HEIGHT): Rename to
FRAME_INNER_WIDTH and FRAME_INNER_HEIGHT.
(gui_figure_window_size): Drop last two arguments from
extern.
* src/gtkutil.c (xg_frame_resized): Rename arguments to WIDTH
and HEIGHT. Consult delayed_size_change to handle case where
WIDTH and HEIGHT do not match F's new_width and new_height
values. Call change_frame_size with native sizes and without
PIXELWISE argument. Instead of frame_size_history_add call
frame_size_history_extra.
(xg_frame_set_char_size): WIDTH and HEIGHT are native sizes now;
fix adjust_frame_size call accordingly. Instead of
frame_size_history_add call frame_size_history_extra.
(style_changed_cb): Call xg_frame_set_char_size with native
instead of text sizes.
(tb_size_cb): Remove frame_size_history_add call. Call
adjust_frame_size with INHIBIT 5.
(free_frame_tool_bar, xg_change_toolbar_position): Remove
frame_size_history_add call.
(update_frame_tool_bar): Call adjust_frame_size with INHIBIT 2
and let it handle frame_inhibit_implied_resize and
fullheight/-width. Remove frame_size_history_add call.
* src/keyboard.c (Fsuspend_emacs): Call change_frame_size with
native sizes.
* src/nsfns.m (ns_set_tool_bar_lines): Call adjust_frame_size
with INHIBIT 2 and let it handle frame_inhibit_implied_resize
and fullheight/-width. Remove frame_size_history_add call.
(Fx_create_frame): Drop two last arguments in
gui_figure_window_size call. Do not SET_FRAME_WIDTH and
SET_FRAME_HEIGHT, the adjust_frame_size in
gui_figure_window_size did that already.
* src/nsterm.m (ns_set_window_size): Drop PIXELWISE argument and
its processing; WIDTH and HEIGHT represent native pixel sizes
now. Call change_frame_size with native sizes. Remove call to
frame_size_history_add.
([EmacsView viewDidResize:]): Call change_frame_size with native
sizes.
* src/term.c (Fresume_tty): Call change_frame_size with native
sizes.
* src/termhooks.h (*set_window_size_hook): Drop last argument
PIXELWISE.
* src/w32fns.c (w32_change_tab_bar_height)
(w32_change_tool_bar_height): Fix handling of these in the initial
phase before they have been resized at least once.
(Fx_create_frame, w32_create_tip_frame): Drop two last arguments
in gui_figure_window_size call. Do not SET_FRAME_WIDTH and
SET_FRAME_HEIGHT (or SET_FRAME_COLS and SET_FRAME_LINES), the
adjust_frame_size in gui_figure_window_size did that already.
* src/w32inevt.c (resize_event, maybe_generate_resize_event):
Pass native sizes to change_frame_size.
* src/w32term.c (w32_read_socket): When WM_WINDOWPOSCHANGED pass
native sizes to change_frame_size.
(w32_new_font): Recalculate FRAME_TAB_BAR_HEIGHT. Simplify
code.
(w32fullscreen_hook): Call change_frame_size with native sizes.
(w32_set_window_size): Drop argument PIXELWISE and its
processing; WIDTH and HEIGHT are native sizes now. Remove
frame_size_history_add calls. Pass native sizes to
change_frame_size.
* src/widget.c (set_frame_size): Set width and height of widget
directly. Call frame_size_history_plain instead of
frame_size_history_add.
(update_from_various_frame_slots): Call
frame_size_history_extra.
(EmacsFrameRealize): Call frame_size_history_plain.
(EmacsFrameResize): Call change_frame_size with native sizes.
Call frame_size_history_extra instead of frame_size_history_add.
(EmacsFrameSetCharSize): Call frame_size_history_extra. Drop
PIXELWISE argument in x_set_window_size call and specify pixels.
(pixel_to_text_size): Remove function.
* src/xdisp.c (resize_mini_window): Replace FRAME_WINDOWS_HEIGHT
with FRAME_INNER_HEIGHT.
(redisplay_tab_bar): Don't set tab_bar_redisplayed when we did
not redisplay it.
(redisplay_tool_bar): Don't call it for external tool bar.
Don't set tool_bar_redisplayed when we did not redisplay it.
(redisplay_window): When the tool bar is external call
update_frame_tool_bar directly.
* src/xfns.c (x_set_menu_bar_lines): Call adjust_frame_size only
if number of menu bar lines changed and fix 6th argument.
(x_change_tab_bar_height, x_change_tool_bar_height): Fix
handling of these in the initial phase before they have been
resized at least once.
(Fx_create_frame, x_create_tip_frame): Drop two last arguments
in gui_figure_window_size call. Do not SET_FRAME_WIDTH and
SET_FRAME_HEIGHT (or SET_FRAME_COLS and SET_FRAME_LINES), the
adjust_frame_size in gui_figure_window_size did that already.
* src/xmenu.c (update_frame_menubar): Fix 6th arg of
adjust_frame_size call.
(free_frame_menubar): For Motif frames fix fullscreen and
`frame-inhibit-implied-resize' handling. Fix 6th arg of
adjust_frame_size calls.
* src/xterm.c (x_net_wm_state): Remove call to
frame_size_history_add.
(handle_one_xevent): For PropertyNotify and UnmapNotify events
add frame_size_history_plain calls. For MapNotify and
ConfigureNotify events add a frame_size_history_extra call. For
ConfigureNotify events also handle delayed size changes and call
change_frame_size with native sizes.
(x_new_font): Recalculate FRAME_TAB_BAR_HEIGHT. Simplify code.
(x_handle_net_wm_state): Remove frame_size_history_add call.
(x_check_fullscreen): Remove frame_size_history_add call. Call
change_frame_size with native height.
(x_set_window_size_1): WIDTH and HEIGHT are now native. Remove
some frame_size_history_add calls and add frame_size_history_extra
calls instead. If the frame is not visible call adjust_frame_size
directly instead of calling change_frame_size.
(x_set_window_size): Drop PIXELWISE argument. WIDTH and HEIGHT
represent native sizes now.
(x_make_frame_visible, x_make_frame_invisible): Call
frame_size_history_plain.
* src/xterm.h (x_set_window_size): Drop last argument from
extern declaration.
2021-04-27 07:53:42 +00:00
|
|
|
|
This function dumps a prettified version of `frame-size-history'
|
|
|
|
|
into a buffer called *frame-size-history*. The optional argument
|
|
|
|
|
FRAME denotes the frame whose history will be dumped; it defaults
|
|
|
|
|
to the selected frame.
|
|
|
|
|
|
|
|
|
|
Storing information about resize operations is off by default.
|
|
|
|
|
If you set the variable `frame-size-history' like this
|
|
|
|
|
|
|
|
|
|
(setq frame-size-history '(100))
|
|
|
|
|
|
|
|
|
|
then Emacs will save information about the next 100 significant
|
|
|
|
|
operations affecting any frame's size in that variable. This
|
|
|
|
|
function prints the entries for FRAME stored in that variable in
|
|
|
|
|
a more legible way.
|
|
|
|
|
|
|
|
|
|
All lines start with an indication of the requested action. An
|
|
|
|
|
entry like `menu-bar-lines' or `scroll-bar-width' indicates that
|
|
|
|
|
a change of the corresponding frame parameter or Lisp variable
|
|
|
|
|
was requested. An entry like gui_figure_window_size indicates
|
|
|
|
|
that that C function was executed, an entry like ConfigureNotify
|
|
|
|
|
indicates that that event was received.
|
|
|
|
|
|
|
|
|
|
In long entries, a number in parentheses displays the INHIBIT
|
|
|
|
|
parameter passed to the C function adjust_frame_size. Such
|
|
|
|
|
entries may also display changes of frame rectangles in a form
|
|
|
|
|
like R=n1xn2~>n3xn4 where R denotes the rectangle type (TS for
|
|
|
|
|
text, NS for native and IS for inner frame rectangle sizes, all
|
|
|
|
|
in pixels, TC for text rectangle sizes in frame columns and
|
|
|
|
|
lines), n1 and n2 denote the old width and height and n3 and n4
|
|
|
|
|
the new width and height in the according units. MS stands for
|
|
|
|
|
the minimum inner frame size in pixels, IH and IV, if present,
|
|
|
|
|
indicate that resizing horizontally and/or vertically was
|
|
|
|
|
inhibited (either by `frame-inhibit-implied-resize' or because of
|
|
|
|
|
the frame's fullscreen state).
|
|
|
|
|
|
|
|
|
|
Shorter entries represent C functions that process width and
|
|
|
|
|
height changes of the native rectangle where PS stands for the
|
|
|
|
|
frame's present pixel width and height, XS for a requested pixel
|
|
|
|
|
width and height and DS for some earlier requested but so far
|
|
|
|
|
delayed pixel width and height.
|
|
|
|
|
|
|
|
|
|
Very short entries represent calls of C functions that do not
|
|
|
|
|
directly ask for size changes but may indirectly affect the size
|
|
|
|
|
of frames like calls to map a frame or change its visibility."
|
Allow setting frame pixel sizes from frame parameters (Bug#21415)
Also fix some misfeatures in frame (re-)sizing code, add more
debugging information and remove some dead code.
* lisp/frame.el (frame-notice-user-settings, make-frame): Change
parameter names when setting `frame-size-history'.
(frame--size-history): New function.
* src/frame.c (frame_inhibit_resize): If frame has not been made
yet, return t if inhibit_horizontal_resize or
inhibit_vertical_resize bit have been set.
(adjust_frame_size): Simplify.
(make_frame): Initialize inhibit_horizontal_resize,
inhibit_vertical_resize, tool_bar_redisplayed, tool_bar_resized.
(Fframe_after_make_frame): Reset inhibit_horizontal_resize and
inhibit_vertical_resize slots.
(x_set_frame_parameters): Handle `text-pixels' specification for
width and height parameters. Don't consider new_height or
new_width changes. Call adjust_frame_size instead of
Fset_frame_size.
(x_figure_window_size): Two new arguments x_width and y_width
returning frame's figures width and height. Calculate tool bar
height before frame sizes so SET_FRAME_HEIGHT can pick it up.
Handle `text-pixels' specification for width and height
parameters.
(Qtext_pixels, Qx_set_frame_parameters, Qset_frame_size)
(Qx_set_window_size_1, Qx_set_window_size_2)
(Qx_set_window_size_3, Qx_set_menu_bar_lines)
(Qupdate_frame_menubar, Qfree_frame_menubar_1)
(Qfree_frame_menubar_2): New symbols.
* src/frame.h (structure frame): New booleans
tool_bar_redisplayed, tool_bar_resized,
inhibit_horizontal_resize, inhibit_vertical_resize.
(x_figure_window_size): Update external declaration.
* src/gtkutil.c (xg_frame_set_char_size): Set size hints before
calling gtk_window_resize.
(update_frame_tool_bar): Make inhibiting of frame resizing more
discriminative. Set tool_bar_resized bit.
* src/nsfns.m (x_set_tool_bar_lines): Make inhibiting of frame
resizing more discriminative. Call adjust_frame_size instead of
x_set_window_size.
(Fx_create_frame): Handle x_width and x_height if
set by x_figure_window_size.
* src/nsterm.m (x_set_window_size): For GNUSTEP build don't
subtract 3 from tool bar height.
(x_set_window_size): Add frame_size_history_add call.
(x_new_font): Call adjust_frame_size instead of
x_set_window_size.
* src/w32fns.c (x_change_tool_bar_height): Reset
tool_bar_redisplayed and tool_bar_resized bits when adding tool
bar. Make inhibiting of frame resizing more discriminative.
(w32_wnd_proc): Remove dead code in WM_WINDOWPOSCHANGING case.
(Fx_create_frame): Handle x_width and x_height if set by
x_figure_window_size. Set size hints before adjusting frame size.
(x_create_tip_frame): Adjust x_figure_window_size call.
* src/w32term.c (x_set_window_size): Add frame_size_history_add
call.
* src/widget.c (set_frame_size): Remove dead code. Add
frame_size_history_add call. When frame_resize_pixelwise is t
use FRAME_PIXEL_WIDTH and FRAME_PIXEL_HEIGHT instead of
pixel_width and pixel_height.
(update_various_frame_slots): Remove dead code.
(EmacsFrameResize): Add more information in
frame_size_history_add call.
(EmacsFrameQueryGeometry): Round only when frame_resize_pixelwise
is not set.
* src/xdisp.c (redisplay_tool_bar): Set tool_bar_redisplayed bits.
* src/xfns.c (x_set_menu_bar_lines): Change argument name.
(x_change_tool_bar_height): Reset tool_bar_redisplayed and
tool_bar_resized bits when adding tool bar. Make inhibiting of
frame resizing more discriminative.
(Fx_create_frame): Handle x_width and x_height if set by
x_figure_window_size. Set size hints before adjusting frame size.
(x_create_tip_frame): Adjust x_figure_window_size call.
* src/xmenu.c (update_frame_menubar): Don't handle Lucid specially.
(set_frame_menubar): On Lucid never add core-border-width to
avoid that adding XtNinternalBorderWidth adds it again.
(free_frame_menubar): Handle frame_inhibit_resize true for Motif.
* src/xterm.c (x_new_font): In non-toolkit case handle size
change of menu bar.
(x_set_window_size_1): Fix calls to frame_size_history_add.
(x_wm_set_size_hint): Remove dead code. Set
size_hints.min_width and size_hints.min_height to base_width and
base_height.
2015-10-13 10:11:43 +00:00
|
|
|
|
(let ((history (reverse frame-size-history))
|
Major rewrite of adjust_frame_size
Have adjust_frame_size pass native frame sizes to backends
instead of text sizes. Expand frame size history management.
Drop PIXELWISE argument from change_frame_size and convert
native to text sizes only when calling adjust_frame_size. Use
convention in arguments that -1 instead of 0 means that no size
change is required. When adjusting frame sizes pick up delayed
size changes (Bug#46827).
* lisp/frame.el (frame-notice-user-settings, make-frame): Don't
set frame size history.
(frame--size-history): Rewrite doc-string. Handle new formats
of `frame-size-history' entries.
* src/dispextern.h (delayed_size_change): Extern it.
(change_frame_size): Drop last argument from extern.
* src/dispnew.c (delayed_size_change): Make it global.
(handle_window_change_signal): Reformat. Drop last argument
from change_frame_size call.
(do_pending_window_change, init_display_interactive): Drop last
argument from change_frame_size call.
(change_frame_size_1): NEW_WIDTH and NEW_HEIGHT now specify
native sizes. Drop last argument PIXELWISE. Queue a change
when it either differs from F's current pixel sizes or F's
previously queued sizes. Inject frame_size_history_extra call
when queuing. Adopt convention that for queued sizes -1 means
that no size change is required. Convert from native to text
sizes when calling adjust_frame_size.
(change_frame_size): Drop last argument PIXELWISE and drop it
also in change_frame_size_1 calls.
* src/frame.c (frame_size_history_add): Remove.
(frame_inhibit_resize): Remove call to frame_size_history_add.
(set_menu_bar_lines, set_tab_bar_lines): Simplify. Drop last
argument from change_frame_size call.
(frame_windows_min_size): No more static.
(keep_ratio): Minor rewrite using macros.
(frame_size_history_adjust, frame_size_history_plain)
(frame_size_history_extra): New functions.
(adjust_frame_size): Major rewrite. Adopt new convention that
negative values for new sizes mean no change. Pick up delayed
size changes from F's new_width and new_height slots
(Bug#46827). Call set_window_size_hook with native instead of
text sizes. Do not sanitize window sizes any more. Call
frame_size_history_adjust instead of frame_size_history_add.
Always set F's resized_p slot to true.
(make_frame): Initialize new_width and new_height slots to -1.
Simplify setup of initial sizes and an adjust_frame_size call.
(Fframe_parameters): Drop processing F's new_pixelwise slot.
(check_frame_pixels): Reorder to make declarations appear first.
(Fset_frame_height, Fset_frame_width, Fset_frame_size): Pass
explicit width and height values to adjust_frame_size instead of
-1.
(gui_set_frame_parameters): Minor rewrite making sure that
explicit sizes and the corresponding parameter are passed to
adjust_frame_size. Remove frame_size_history_add call.
(gui_figure_window_size): Drop last two arguments. Simplify
assignment of initial size. Set new_height and new_width slots
to -1. Use adjust_frame_size to set sizes instead of returning
them to caller.
(syms_of_frame): Drop symbols used by frame size history; these
are now built on-the-fly. Also drop some menu bar related
symbols in favor of Qmenu_bar_lines.
* src/frame.h (struct frame): Remove new_pixelwise.
(SET_FRAME_COLS, SET_FRAME_LINES, SET_FRAME_WIDTH)
(SET_FRAME_HEIGHT): Remove macros.
(frame_size_history_add): Remove externs.
(frame_windows_min_size, frame_size_history_plain)
(frame_size_history_extra): Add externs.
(FRAME_WINDOWS_WIDTH, FRAME_WINDOWS_HEIGHT): Rename to
FRAME_INNER_WIDTH and FRAME_INNER_HEIGHT.
(gui_figure_window_size): Drop last two arguments from
extern.
* src/gtkutil.c (xg_frame_resized): Rename arguments to WIDTH
and HEIGHT. Consult delayed_size_change to handle case where
WIDTH and HEIGHT do not match F's new_width and new_height
values. Call change_frame_size with native sizes and without
PIXELWISE argument. Instead of frame_size_history_add call
frame_size_history_extra.
(xg_frame_set_char_size): WIDTH and HEIGHT are native sizes now;
fix adjust_frame_size call accordingly. Instead of
frame_size_history_add call frame_size_history_extra.
(style_changed_cb): Call xg_frame_set_char_size with native
instead of text sizes.
(tb_size_cb): Remove frame_size_history_add call. Call
adjust_frame_size with INHIBIT 5.
(free_frame_tool_bar, xg_change_toolbar_position): Remove
frame_size_history_add call.
(update_frame_tool_bar): Call adjust_frame_size with INHIBIT 2
and let it handle frame_inhibit_implied_resize and
fullheight/-width. Remove frame_size_history_add call.
* src/keyboard.c (Fsuspend_emacs): Call change_frame_size with
native sizes.
* src/nsfns.m (ns_set_tool_bar_lines): Call adjust_frame_size
with INHIBIT 2 and let it handle frame_inhibit_implied_resize
and fullheight/-width. Remove frame_size_history_add call.
(Fx_create_frame): Drop two last arguments in
gui_figure_window_size call. Do not SET_FRAME_WIDTH and
SET_FRAME_HEIGHT, the adjust_frame_size in
gui_figure_window_size did that already.
* src/nsterm.m (ns_set_window_size): Drop PIXELWISE argument and
its processing; WIDTH and HEIGHT represent native pixel sizes
now. Call change_frame_size with native sizes. Remove call to
frame_size_history_add.
([EmacsView viewDidResize:]): Call change_frame_size with native
sizes.
* src/term.c (Fresume_tty): Call change_frame_size with native
sizes.
* src/termhooks.h (*set_window_size_hook): Drop last argument
PIXELWISE.
* src/w32fns.c (w32_change_tab_bar_height)
(w32_change_tool_bar_height): Fix handling of these in the initial
phase before they have been resized at least once.
(Fx_create_frame, w32_create_tip_frame): Drop two last arguments
in gui_figure_window_size call. Do not SET_FRAME_WIDTH and
SET_FRAME_HEIGHT (or SET_FRAME_COLS and SET_FRAME_LINES), the
adjust_frame_size in gui_figure_window_size did that already.
* src/w32inevt.c (resize_event, maybe_generate_resize_event):
Pass native sizes to change_frame_size.
* src/w32term.c (w32_read_socket): When WM_WINDOWPOSCHANGED pass
native sizes to change_frame_size.
(w32_new_font): Recalculate FRAME_TAB_BAR_HEIGHT. Simplify
code.
(w32fullscreen_hook): Call change_frame_size with native sizes.
(w32_set_window_size): Drop argument PIXELWISE and its
processing; WIDTH and HEIGHT are native sizes now. Remove
frame_size_history_add calls. Pass native sizes to
change_frame_size.
* src/widget.c (set_frame_size): Set width and height of widget
directly. Call frame_size_history_plain instead of
frame_size_history_add.
(update_from_various_frame_slots): Call
frame_size_history_extra.
(EmacsFrameRealize): Call frame_size_history_plain.
(EmacsFrameResize): Call change_frame_size with native sizes.
Call frame_size_history_extra instead of frame_size_history_add.
(EmacsFrameSetCharSize): Call frame_size_history_extra. Drop
PIXELWISE argument in x_set_window_size call and specify pixels.
(pixel_to_text_size): Remove function.
* src/xdisp.c (resize_mini_window): Replace FRAME_WINDOWS_HEIGHT
with FRAME_INNER_HEIGHT.
(redisplay_tab_bar): Don't set tab_bar_redisplayed when we did
not redisplay it.
(redisplay_tool_bar): Don't call it for external tool bar.
Don't set tool_bar_redisplayed when we did not redisplay it.
(redisplay_window): When the tool bar is external call
update_frame_tool_bar directly.
* src/xfns.c (x_set_menu_bar_lines): Call adjust_frame_size only
if number of menu bar lines changed and fix 6th argument.
(x_change_tab_bar_height, x_change_tool_bar_height): Fix
handling of these in the initial phase before they have been
resized at least once.
(Fx_create_frame, x_create_tip_frame): Drop two last arguments
in gui_figure_window_size call. Do not SET_FRAME_WIDTH and
SET_FRAME_HEIGHT (or SET_FRAME_COLS and SET_FRAME_LINES), the
adjust_frame_size in gui_figure_window_size did that already.
* src/xmenu.c (update_frame_menubar): Fix 6th arg of
adjust_frame_size call.
(free_frame_menubar): For Motif frames fix fullscreen and
`frame-inhibit-implied-resize' handling. Fix 6th arg of
adjust_frame_size calls.
* src/xterm.c (x_net_wm_state): Remove call to
frame_size_history_add.
(handle_one_xevent): For PropertyNotify and UnmapNotify events
add frame_size_history_plain calls. For MapNotify and
ConfigureNotify events add a frame_size_history_extra call. For
ConfigureNotify events also handle delayed size changes and call
change_frame_size with native sizes.
(x_new_font): Recalculate FRAME_TAB_BAR_HEIGHT. Simplify code.
(x_handle_net_wm_state): Remove frame_size_history_add call.
(x_check_fullscreen): Remove frame_size_history_add call. Call
change_frame_size with native height.
(x_set_window_size_1): WIDTH and HEIGHT are now native. Remove
some frame_size_history_add calls and add frame_size_history_extra
calls instead. If the frame is not visible call adjust_frame_size
directly instead of calling change_frame_size.
(x_set_window_size): Drop PIXELWISE argument. WIDTH and HEIGHT
represent native sizes now.
(x_make_frame_visible, x_make_frame_invisible): Call
frame_size_history_plain.
* src/xterm.h (x_set_window_size): Drop last argument from
extern declaration.
2021-04-27 07:53:42 +00:00
|
|
|
|
entry item)
|
Allow setting frame pixel sizes from frame parameters (Bug#21415)
Also fix some misfeatures in frame (re-)sizing code, add more
debugging information and remove some dead code.
* lisp/frame.el (frame-notice-user-settings, make-frame): Change
parameter names when setting `frame-size-history'.
(frame--size-history): New function.
* src/frame.c (frame_inhibit_resize): If frame has not been made
yet, return t if inhibit_horizontal_resize or
inhibit_vertical_resize bit have been set.
(adjust_frame_size): Simplify.
(make_frame): Initialize inhibit_horizontal_resize,
inhibit_vertical_resize, tool_bar_redisplayed, tool_bar_resized.
(Fframe_after_make_frame): Reset inhibit_horizontal_resize and
inhibit_vertical_resize slots.
(x_set_frame_parameters): Handle `text-pixels' specification for
width and height parameters. Don't consider new_height or
new_width changes. Call adjust_frame_size instead of
Fset_frame_size.
(x_figure_window_size): Two new arguments x_width and y_width
returning frame's figures width and height. Calculate tool bar
height before frame sizes so SET_FRAME_HEIGHT can pick it up.
Handle `text-pixels' specification for width and height
parameters.
(Qtext_pixels, Qx_set_frame_parameters, Qset_frame_size)
(Qx_set_window_size_1, Qx_set_window_size_2)
(Qx_set_window_size_3, Qx_set_menu_bar_lines)
(Qupdate_frame_menubar, Qfree_frame_menubar_1)
(Qfree_frame_menubar_2): New symbols.
* src/frame.h (structure frame): New booleans
tool_bar_redisplayed, tool_bar_resized,
inhibit_horizontal_resize, inhibit_vertical_resize.
(x_figure_window_size): Update external declaration.
* src/gtkutil.c (xg_frame_set_char_size): Set size hints before
calling gtk_window_resize.
(update_frame_tool_bar): Make inhibiting of frame resizing more
discriminative. Set tool_bar_resized bit.
* src/nsfns.m (x_set_tool_bar_lines): Make inhibiting of frame
resizing more discriminative. Call adjust_frame_size instead of
x_set_window_size.
(Fx_create_frame): Handle x_width and x_height if
set by x_figure_window_size.
* src/nsterm.m (x_set_window_size): For GNUSTEP build don't
subtract 3 from tool bar height.
(x_set_window_size): Add frame_size_history_add call.
(x_new_font): Call adjust_frame_size instead of
x_set_window_size.
* src/w32fns.c (x_change_tool_bar_height): Reset
tool_bar_redisplayed and tool_bar_resized bits when adding tool
bar. Make inhibiting of frame resizing more discriminative.
(w32_wnd_proc): Remove dead code in WM_WINDOWPOSCHANGING case.
(Fx_create_frame): Handle x_width and x_height if set by
x_figure_window_size. Set size hints before adjusting frame size.
(x_create_tip_frame): Adjust x_figure_window_size call.
* src/w32term.c (x_set_window_size): Add frame_size_history_add
call.
* src/widget.c (set_frame_size): Remove dead code. Add
frame_size_history_add call. When frame_resize_pixelwise is t
use FRAME_PIXEL_WIDTH and FRAME_PIXEL_HEIGHT instead of
pixel_width and pixel_height.
(update_various_frame_slots): Remove dead code.
(EmacsFrameResize): Add more information in
frame_size_history_add call.
(EmacsFrameQueryGeometry): Round only when frame_resize_pixelwise
is not set.
* src/xdisp.c (redisplay_tool_bar): Set tool_bar_redisplayed bits.
* src/xfns.c (x_set_menu_bar_lines): Change argument name.
(x_change_tool_bar_height): Reset tool_bar_redisplayed and
tool_bar_resized bits when adding tool bar. Make inhibiting of
frame resizing more discriminative.
(Fx_create_frame): Handle x_width and x_height if set by
x_figure_window_size. Set size hints before adjusting frame size.
(x_create_tip_frame): Adjust x_figure_window_size call.
* src/xmenu.c (update_frame_menubar): Don't handle Lucid specially.
(set_frame_menubar): On Lucid never add core-border-width to
avoid that adding XtNinternalBorderWidth adds it again.
(free_frame_menubar): Handle frame_inhibit_resize true for Motif.
* src/xterm.c (x_new_font): In non-toolkit case handle size
change of menu bar.
(x_set_window_size_1): Fix calls to frame_size_history_add.
(x_wm_set_size_hint): Remove dead code. Set
size_hints.min_width and size_hints.min_height to base_width and
base_height.
2015-10-13 10:11:43 +00:00
|
|
|
|
(setq frame (window-normalize-frame frame))
|
|
|
|
|
(with-current-buffer (get-buffer-create "*frame-size-history*")
|
|
|
|
|
(erase-buffer)
|
|
|
|
|
(insert (format "Frame size history of %s\n" frame))
|
2019-04-14 15:27:50 +00:00
|
|
|
|
(while (consp (setq entry (pop history)))
|
Major rewrite of adjust_frame_size
Have adjust_frame_size pass native frame sizes to backends
instead of text sizes. Expand frame size history management.
Drop PIXELWISE argument from change_frame_size and convert
native to text sizes only when calling adjust_frame_size. Use
convention in arguments that -1 instead of 0 means that no size
change is required. When adjusting frame sizes pick up delayed
size changes (Bug#46827).
* lisp/frame.el (frame-notice-user-settings, make-frame): Don't
set frame size history.
(frame--size-history): Rewrite doc-string. Handle new formats
of `frame-size-history' entries.
* src/dispextern.h (delayed_size_change): Extern it.
(change_frame_size): Drop last argument from extern.
* src/dispnew.c (delayed_size_change): Make it global.
(handle_window_change_signal): Reformat. Drop last argument
from change_frame_size call.
(do_pending_window_change, init_display_interactive): Drop last
argument from change_frame_size call.
(change_frame_size_1): NEW_WIDTH and NEW_HEIGHT now specify
native sizes. Drop last argument PIXELWISE. Queue a change
when it either differs from F's current pixel sizes or F's
previously queued sizes. Inject frame_size_history_extra call
when queuing. Adopt convention that for queued sizes -1 means
that no size change is required. Convert from native to text
sizes when calling adjust_frame_size.
(change_frame_size): Drop last argument PIXELWISE and drop it
also in change_frame_size_1 calls.
* src/frame.c (frame_size_history_add): Remove.
(frame_inhibit_resize): Remove call to frame_size_history_add.
(set_menu_bar_lines, set_tab_bar_lines): Simplify. Drop last
argument from change_frame_size call.
(frame_windows_min_size): No more static.
(keep_ratio): Minor rewrite using macros.
(frame_size_history_adjust, frame_size_history_plain)
(frame_size_history_extra): New functions.
(adjust_frame_size): Major rewrite. Adopt new convention that
negative values for new sizes mean no change. Pick up delayed
size changes from F's new_width and new_height slots
(Bug#46827). Call set_window_size_hook with native instead of
text sizes. Do not sanitize window sizes any more. Call
frame_size_history_adjust instead of frame_size_history_add.
Always set F's resized_p slot to true.
(make_frame): Initialize new_width and new_height slots to -1.
Simplify setup of initial sizes and an adjust_frame_size call.
(Fframe_parameters): Drop processing F's new_pixelwise slot.
(check_frame_pixels): Reorder to make declarations appear first.
(Fset_frame_height, Fset_frame_width, Fset_frame_size): Pass
explicit width and height values to adjust_frame_size instead of
-1.
(gui_set_frame_parameters): Minor rewrite making sure that
explicit sizes and the corresponding parameter are passed to
adjust_frame_size. Remove frame_size_history_add call.
(gui_figure_window_size): Drop last two arguments. Simplify
assignment of initial size. Set new_height and new_width slots
to -1. Use adjust_frame_size to set sizes instead of returning
them to caller.
(syms_of_frame): Drop symbols used by frame size history; these
are now built on-the-fly. Also drop some menu bar related
symbols in favor of Qmenu_bar_lines.
* src/frame.h (struct frame): Remove new_pixelwise.
(SET_FRAME_COLS, SET_FRAME_LINES, SET_FRAME_WIDTH)
(SET_FRAME_HEIGHT): Remove macros.
(frame_size_history_add): Remove externs.
(frame_windows_min_size, frame_size_history_plain)
(frame_size_history_extra): Add externs.
(FRAME_WINDOWS_WIDTH, FRAME_WINDOWS_HEIGHT): Rename to
FRAME_INNER_WIDTH and FRAME_INNER_HEIGHT.
(gui_figure_window_size): Drop last two arguments from
extern.
* src/gtkutil.c (xg_frame_resized): Rename arguments to WIDTH
and HEIGHT. Consult delayed_size_change to handle case where
WIDTH and HEIGHT do not match F's new_width and new_height
values. Call change_frame_size with native sizes and without
PIXELWISE argument. Instead of frame_size_history_add call
frame_size_history_extra.
(xg_frame_set_char_size): WIDTH and HEIGHT are native sizes now;
fix adjust_frame_size call accordingly. Instead of
frame_size_history_add call frame_size_history_extra.
(style_changed_cb): Call xg_frame_set_char_size with native
instead of text sizes.
(tb_size_cb): Remove frame_size_history_add call. Call
adjust_frame_size with INHIBIT 5.
(free_frame_tool_bar, xg_change_toolbar_position): Remove
frame_size_history_add call.
(update_frame_tool_bar): Call adjust_frame_size with INHIBIT 2
and let it handle frame_inhibit_implied_resize and
fullheight/-width. Remove frame_size_history_add call.
* src/keyboard.c (Fsuspend_emacs): Call change_frame_size with
native sizes.
* src/nsfns.m (ns_set_tool_bar_lines): Call adjust_frame_size
with INHIBIT 2 and let it handle frame_inhibit_implied_resize
and fullheight/-width. Remove frame_size_history_add call.
(Fx_create_frame): Drop two last arguments in
gui_figure_window_size call. Do not SET_FRAME_WIDTH and
SET_FRAME_HEIGHT, the adjust_frame_size in
gui_figure_window_size did that already.
* src/nsterm.m (ns_set_window_size): Drop PIXELWISE argument and
its processing; WIDTH and HEIGHT represent native pixel sizes
now. Call change_frame_size with native sizes. Remove call to
frame_size_history_add.
([EmacsView viewDidResize:]): Call change_frame_size with native
sizes.
* src/term.c (Fresume_tty): Call change_frame_size with native
sizes.
* src/termhooks.h (*set_window_size_hook): Drop last argument
PIXELWISE.
* src/w32fns.c (w32_change_tab_bar_height)
(w32_change_tool_bar_height): Fix handling of these in the initial
phase before they have been resized at least once.
(Fx_create_frame, w32_create_tip_frame): Drop two last arguments
in gui_figure_window_size call. Do not SET_FRAME_WIDTH and
SET_FRAME_HEIGHT (or SET_FRAME_COLS and SET_FRAME_LINES), the
adjust_frame_size in gui_figure_window_size did that already.
* src/w32inevt.c (resize_event, maybe_generate_resize_event):
Pass native sizes to change_frame_size.
* src/w32term.c (w32_read_socket): When WM_WINDOWPOSCHANGED pass
native sizes to change_frame_size.
(w32_new_font): Recalculate FRAME_TAB_BAR_HEIGHT. Simplify
code.
(w32fullscreen_hook): Call change_frame_size with native sizes.
(w32_set_window_size): Drop argument PIXELWISE and its
processing; WIDTH and HEIGHT are native sizes now. Remove
frame_size_history_add calls. Pass native sizes to
change_frame_size.
* src/widget.c (set_frame_size): Set width and height of widget
directly. Call frame_size_history_plain instead of
frame_size_history_add.
(update_from_various_frame_slots): Call
frame_size_history_extra.
(EmacsFrameRealize): Call frame_size_history_plain.
(EmacsFrameResize): Call change_frame_size with native sizes.
Call frame_size_history_extra instead of frame_size_history_add.
(EmacsFrameSetCharSize): Call frame_size_history_extra. Drop
PIXELWISE argument in x_set_window_size call and specify pixels.
(pixel_to_text_size): Remove function.
* src/xdisp.c (resize_mini_window): Replace FRAME_WINDOWS_HEIGHT
with FRAME_INNER_HEIGHT.
(redisplay_tab_bar): Don't set tab_bar_redisplayed when we did
not redisplay it.
(redisplay_tool_bar): Don't call it for external tool bar.
Don't set tool_bar_redisplayed when we did not redisplay it.
(redisplay_window): When the tool bar is external call
update_frame_tool_bar directly.
* src/xfns.c (x_set_menu_bar_lines): Call adjust_frame_size only
if number of menu bar lines changed and fix 6th argument.
(x_change_tab_bar_height, x_change_tool_bar_height): Fix
handling of these in the initial phase before they have been
resized at least once.
(Fx_create_frame, x_create_tip_frame): Drop two last arguments
in gui_figure_window_size call. Do not SET_FRAME_WIDTH and
SET_FRAME_HEIGHT (or SET_FRAME_COLS and SET_FRAME_LINES), the
adjust_frame_size in gui_figure_window_size did that already.
* src/xmenu.c (update_frame_menubar): Fix 6th arg of
adjust_frame_size call.
(free_frame_menubar): For Motif frames fix fullscreen and
`frame-inhibit-implied-resize' handling. Fix 6th arg of
adjust_frame_size calls.
* src/xterm.c (x_net_wm_state): Remove call to
frame_size_history_add.
(handle_one_xevent): For PropertyNotify and UnmapNotify events
add frame_size_history_plain calls. For MapNotify and
ConfigureNotify events add a frame_size_history_extra call. For
ConfigureNotify events also handle delayed size changes and call
change_frame_size with native sizes.
(x_new_font): Recalculate FRAME_TAB_BAR_HEIGHT. Simplify code.
(x_handle_net_wm_state): Remove frame_size_history_add call.
(x_check_fullscreen): Remove frame_size_history_add call. Call
change_frame_size with native height.
(x_set_window_size_1): WIDTH and HEIGHT are now native. Remove
some frame_size_history_add calls and add frame_size_history_extra
calls instead. If the frame is not visible call adjust_frame_size
directly instead of calling change_frame_size.
(x_set_window_size): Drop PIXELWISE argument. WIDTH and HEIGHT
represent native sizes now.
(x_make_frame_visible, x_make_frame_invisible): Call
frame_size_history_plain.
* src/xterm.h (x_set_window_size): Drop last argument from
extern declaration.
2021-04-27 07:53:42 +00:00
|
|
|
|
(setq item (car entry))
|
|
|
|
|
(cond
|
|
|
|
|
((not (consp item))
|
|
|
|
|
;; An item added quickly for debugging purposes.
|
|
|
|
|
(insert (format "%s\n" entry)))
|
|
|
|
|
((and (eq (nth 0 item) frame) (= (nth 1 item) 1))
|
|
|
|
|
;; Length 1 is a "plain event".
|
|
|
|
|
(insert (format "%s\n" (nth 2 item))))
|
|
|
|
|
((and (eq (nth 0 item) frame) (= (nth 1 item) 2))
|
|
|
|
|
;; Length 2 is an "extra" item.
|
|
|
|
|
(insert (format "%s" (nth 2 item)))
|
|
|
|
|
(setq item (nth 0 (cdr entry)))
|
|
|
|
|
(insert (format ", PS=%sx%s" (nth 0 item) (nth 1 item)))
|
|
|
|
|
(when (or (>= (nth 2 item) 0) (>= (nth 3 item) 0))
|
|
|
|
|
(insert (format ", XS=%sx%s" (nth 2 item) (nth 3 item))))
|
|
|
|
|
(setq item (nth 1 (cdr entry)))
|
|
|
|
|
(when (or (>= (nth 0 item) 0) (>= (nth 1 item) 0))
|
|
|
|
|
(insert (format ", DS=%sx%s" (nth 0 item) (nth 1 item))))
|
|
|
|
|
(insert "\n"))
|
|
|
|
|
((and (eq (nth 0 item) frame) (= (nth 1 item) 5))
|
|
|
|
|
;; Length 5 is an `adjust-frame-size' item.
|
|
|
|
|
(insert (format "%s (%s)" (nth 3 item) (nth 2 item)))
|
|
|
|
|
(setq item (nth 0 (cdr entry)))
|
|
|
|
|
(unless (and (= (nth 0 item) (nth 2 item))
|
|
|
|
|
(= (nth 1 item) (nth 3 item)))
|
|
|
|
|
(insert (format ", TS=%sx%s~>%sx%s"
|
|
|
|
|
(nth 0 item) (nth 1 item) (nth 2 item) (nth 3 item))))
|
|
|
|
|
(setq item (nth 1 (cdr entry)))
|
|
|
|
|
(unless (and (= (nth 0 item) (nth 2 item))
|
|
|
|
|
(= (nth 1 item) (nth 3 item)))
|
|
|
|
|
(insert (format ", TC=%sx%s~>%sx%s"
|
|
|
|
|
(nth 0 item) (nth 1 item) (nth 2 item) (nth 3 item))))
|
|
|
|
|
(setq item (nth 2 (cdr entry)))
|
|
|
|
|
(unless (and (= (nth 0 item) (nth 2 item))
|
|
|
|
|
(= (nth 1 item) (nth 3 item)))
|
|
|
|
|
(insert (format ", NS=%sx%s~>%sx%s"
|
|
|
|
|
(nth 0 item) (nth 1 item) (nth 2 item) (nth 3 item))))
|
|
|
|
|
(setq item (nth 3 (cdr entry)))
|
|
|
|
|
(unless (and (= (nth 0 item) (nth 2 item))
|
|
|
|
|
(= (nth 1 item) (nth 3 item)))
|
|
|
|
|
(insert (format ", IS=%sx%s~>%sx%s"
|
|
|
|
|
(nth 0 item) (nth 1 item) (nth 2 item) (nth 3 item))))
|
|
|
|
|
(setq item (nth 4 (cdr entry)))
|
|
|
|
|
(insert (format ", MS=%sx%s" (nth 0 item) (nth 1 item)))
|
|
|
|
|
(when (nth 2 item) (insert " IH"))
|
|
|
|
|
(when (nth 3 item) (insert " IV"))
|
|
|
|
|
(insert "\n")))))))
|
Allow setting frame pixel sizes from frame parameters (Bug#21415)
Also fix some misfeatures in frame (re-)sizing code, add more
debugging information and remove some dead code.
* lisp/frame.el (frame-notice-user-settings, make-frame): Change
parameter names when setting `frame-size-history'.
(frame--size-history): New function.
* src/frame.c (frame_inhibit_resize): If frame has not been made
yet, return t if inhibit_horizontal_resize or
inhibit_vertical_resize bit have been set.
(adjust_frame_size): Simplify.
(make_frame): Initialize inhibit_horizontal_resize,
inhibit_vertical_resize, tool_bar_redisplayed, tool_bar_resized.
(Fframe_after_make_frame): Reset inhibit_horizontal_resize and
inhibit_vertical_resize slots.
(x_set_frame_parameters): Handle `text-pixels' specification for
width and height parameters. Don't consider new_height or
new_width changes. Call adjust_frame_size instead of
Fset_frame_size.
(x_figure_window_size): Two new arguments x_width and y_width
returning frame's figures width and height. Calculate tool bar
height before frame sizes so SET_FRAME_HEIGHT can pick it up.
Handle `text-pixels' specification for width and height
parameters.
(Qtext_pixels, Qx_set_frame_parameters, Qset_frame_size)
(Qx_set_window_size_1, Qx_set_window_size_2)
(Qx_set_window_size_3, Qx_set_menu_bar_lines)
(Qupdate_frame_menubar, Qfree_frame_menubar_1)
(Qfree_frame_menubar_2): New symbols.
* src/frame.h (structure frame): New booleans
tool_bar_redisplayed, tool_bar_resized,
inhibit_horizontal_resize, inhibit_vertical_resize.
(x_figure_window_size): Update external declaration.
* src/gtkutil.c (xg_frame_set_char_size): Set size hints before
calling gtk_window_resize.
(update_frame_tool_bar): Make inhibiting of frame resizing more
discriminative. Set tool_bar_resized bit.
* src/nsfns.m (x_set_tool_bar_lines): Make inhibiting of frame
resizing more discriminative. Call adjust_frame_size instead of
x_set_window_size.
(Fx_create_frame): Handle x_width and x_height if
set by x_figure_window_size.
* src/nsterm.m (x_set_window_size): For GNUSTEP build don't
subtract 3 from tool bar height.
(x_set_window_size): Add frame_size_history_add call.
(x_new_font): Call adjust_frame_size instead of
x_set_window_size.
* src/w32fns.c (x_change_tool_bar_height): Reset
tool_bar_redisplayed and tool_bar_resized bits when adding tool
bar. Make inhibiting of frame resizing more discriminative.
(w32_wnd_proc): Remove dead code in WM_WINDOWPOSCHANGING case.
(Fx_create_frame): Handle x_width and x_height if set by
x_figure_window_size. Set size hints before adjusting frame size.
(x_create_tip_frame): Adjust x_figure_window_size call.
* src/w32term.c (x_set_window_size): Add frame_size_history_add
call.
* src/widget.c (set_frame_size): Remove dead code. Add
frame_size_history_add call. When frame_resize_pixelwise is t
use FRAME_PIXEL_WIDTH and FRAME_PIXEL_HEIGHT instead of
pixel_width and pixel_height.
(update_various_frame_slots): Remove dead code.
(EmacsFrameResize): Add more information in
frame_size_history_add call.
(EmacsFrameQueryGeometry): Round only when frame_resize_pixelwise
is not set.
* src/xdisp.c (redisplay_tool_bar): Set tool_bar_redisplayed bits.
* src/xfns.c (x_set_menu_bar_lines): Change argument name.
(x_change_tool_bar_height): Reset tool_bar_redisplayed and
tool_bar_resized bits when adding tool bar. Make inhibiting of
frame resizing more discriminative.
(Fx_create_frame): Handle x_width and x_height if set by
x_figure_window_size. Set size hints before adjusting frame size.
(x_create_tip_frame): Adjust x_figure_window_size call.
* src/xmenu.c (update_frame_menubar): Don't handle Lucid specially.
(set_frame_menubar): On Lucid never add core-border-width to
avoid that adding XtNinternalBorderWidth adds it again.
(free_frame_menubar): Handle frame_inhibit_resize true for Motif.
* src/xterm.c (x_new_font): In non-toolkit case handle size
change of menu bar.
(x_set_window_size_1): Fix calls to frame_size_history_add.
(x_wm_set_size_hint): Remove dead code. Set
size_hints.min_width and size_hints.min_height to base_width and
base_height.
2015-10-13 10:11:43 +00:00
|
|
|
|
|
2015-08-21 09:00:59 +00:00
|
|
|
|
(declare-function x-frame-edges "xfns.c" (&optional frame type))
|
|
|
|
|
(declare-function w32-frame-edges "w32fns.c" (&optional frame type))
|
|
|
|
|
(declare-function ns-frame-edges "nsfns.m" (&optional frame type))
|
Add support for the Haiku operating system and its window system
* .gitignore: Add binaries specific to Haiku.
* Makefie.in (HAVE_BE_APP): New variable.
(install-arch-dep): Install Emacs and Emacs.pdmp when
using Haiku.
* configure.ac: Detect and configure for Haiku and
various related configurations.
(be-app, be-freetype, be-cairo): New options.
(HAVE_BE_APP, HAIKU_OBJ, HAIKU_CXX_OBJ)
(HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(HAIKU, HAVE_TINY_SPEED_T): New define.
(emacs_config_features): Add BE_APP.
* doc/emacs/Makefile.in (EMACSSOURCES): Add Haiku
appendix.
* doc/emacs/emacs.texi: Add Haiku appendix to menus and
include it.
* doc/emacs/haiku.texi: New Haiku appendix.
* doc/lispref/display.texi (Defining Faces, Window Systems):
Explain meaning of `haiku' as a window system identifier.
(haiku-use-system-tooltips): Explain meaning of system
tooltips on
Haiku.
* doc/lispref/frames.texi (Multiple Terminals): Explain
meaning of haiku as a display type.
(Frame Layout): Clarify section for Haiku frames.
(Size Parameters): Explain limitations of fullwidth and
fullheight on Haiku.
(Management Parameters): Explain limitations of
inhibiting double buffering on builds with Cairo,
and the inability of frames with no-accept-focus to
receive keyboard input on Haiku.
(Font and Color Parameters): Explain the different font
backends available on Haiku.
(Raising and Lowering): Explain that lowering and
restacking frames doesn't work on Haiku.
(Child Frames): Explain oddities of child frame
visibility on Haiku.
* doc/lispref/os.texi (System Environment): Explain
meaning of haiku.
* etc/MACHINES: Add appropriate notices for Haiku.
* etc/NEWS: Document changes.
* etc/PROBLEMS: Document font spacing bug on Haiku.
* lib-src/Makefile.in: Build be-resources binary on
Haiku.
(CXX, CXXFLAGS, NON_CXX_FLAGS, ALL_CXXFLAGS)
(HAVE_BE_APP, HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(DONT_INSTALL): Add be-resources binary if on Haiku.
(be-resources): New target.
* lib-src/be_resources: Add helper binary for setting
resources on the Emacs application.
* lib-src/emacsclient.c (decode_options): Set
alt_display to "be" on Haiku.
* lisp/cus-edit.el (custom-button, custom-button-mouse)
(custom-button-unraised, custom-button-pressed): Update
face definitions for Haiku.
* lisp/cus-start.el: Add haiku-debug-on-fatal-error and
haiku-use-system-tooltips.
* lisp/faces.el (face-valid-attribute-values): Clarify
attribute comment for Haiku.
(tool-bar): Add appropriate toolbar color for Haiku.
* lisp/frame.el (haiku-frame-geometry)
(haiku-mouse-absolute-pixel-position)
(haiku-set-mouse-absolute-pixel-position)
(haiku-frame-edges)
(haiku-frame-list-z-order): New function declarations.
(frame-geometry, frame-edges)
(mouse-absolute-pixel-position)
(set-mouse-absolute-pixel-position)
(frame-list-z-order): Call appropriate window system
functions on Haiku.
(display-mouse-p, display-graphic-p)
(display-images-p, display-pixel-height)
(display-pixel-width, display-mm-height)
(display-mm-width, display-backing-store)
(display-save-under, display-planes)
(display-color-cells, display-visual-class): Update type
tests for Haiku.
* lisp/international/mule-cmds.el
(set-coding-system-map): Also
prevent set-terminal-coding-system from appearing in the menu
bar on Haiku.
* lisp/loadup.el: Load Haiku-specific files when built
with Haiku, and don't rename newly built Emacs on Haiku as BFS
doesn't support hard links.
* lisp/menu-bar.el (menu-bar-open): Add for Haiku.
* lisp/mwheel.el (mouse-wheel-down-event): Expect
wheel-up on Haiku.
(mouse-wheel-up-event): Expect wheel-down on Haiku.
(mouse-wheel-left-event): Expect wheel-left on Haiku.
(mouse-wheel-right-event): Expect wheel-right on Haiku.
* lisp/net/browse-url.el
(browse-url--browser-defcustom-type):
Add option for WebPositive.
(browse-url-webpositive-program): New variable.
(browse-url-default-program): Search for WebPositive.
(browse-url-webpositive): New function.
* lisp/net/eww.el (eww-form-submit, eww-form-file)
(eww-form-checkbox, eww-form-select): Define faces
appropriately for Haiku.
* lisp/term/haiku-win.el: New file.
* lisp/tooltip.el (menu-or-popup-active-p): New function
declaration.
(tooltip-show-help): Don't use tooltips on Haiku when a
menu is active.
* lisp/version.el (haiku-get-version-string): New
function declaration.
(emacs-version): Add Haiku version string if
appropriate.
* src/Makefile.in: Also produce binary named "Emacs"
with Haiku resources set.
(CXX, HAIKU_OBJ, HAIKU_CXX_OBJ, HAIKU_LIBS)
(HAIKU_CFLAGS, HAVE_BE_APP, NON_CXX_FLAGS)
(ALL_CXX_FLAGS): New variables.
(.SUFFIXES): Add .cc.
(.cc.o): New target.
(base_obj): Add Haiku C objects.
(doc_obj, obj): Split objects that should scanned for
documentation into doc_obj.
(SOME_MACHINE_OBJECTS): Add appropriate Haiku C objects.
(all): Depend on Emacs and Emacs.pdmp on Haiku.
(LIBES): Add Haiku libraries.
(gl-stamp)
($(etc)/DOC): Scan doc_obj instead of obj
(temacs$(EXEEXT): Use C++ linker on Haiku.
(ctagsfiles3): New variable.
(TAGS): Scan C++ files.
* src/alloc.c (garbage_collect): Mark Haiku display.
* src/dispextern.h (HAVE_NATIVE_TRANSFORMS): Also enable
on Haiku.
(struct image): Add fields for Haiku transforms.
(RGB_PIXEL_COLOR): Define to unsigned long on Haiku as
well.
(sit_for): Also check USABLE_SIGPOLL.
(init_display_interactive): Set initial window system to
Haiku on Haiku builds.
* src/emacs.c (main): Define Haiku syms and init haiku
clipboard.
(shut_down_emacs): Quit BApplication on Haiku and
trigger debug
on aborts if haiku_debug_on_fatal_error.
(Vsystem_type): Update docstring.
* src/fileio.c (next-read-file-uses-dialog-p): Enable on
Haiku.
* src/filelock.c (WTMP_FILE): Only define if BOOT_TIME
is also defined.
* src/floatfns.c (double_integer_scale): Work around
Haiku libroot brain damage.
* src/font.c (syms_of_font): Define appropriate font
driver symbols for Haiku builds with various options.
* src/font.h: Also enable ftcrfont on Haiku builds with
Cairo.
(font_data_structures_may_be_ill_formed): Also enable on
Haiku builds that have Cairo.
* src/frame.c (Fframep): Update doc-string for Haiku
builds and return haiku if appropriate.
(syms_of_frame): New symbol `haiku'.
* src/frame.h (struct frame): Add output data for Haiku.
(FRAME_HAIKU_P): New macro.
(FRAME_WINDOW_P): Test for Haiku frames as well.
* src/ftcrfont.c (RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG): New macros.
(ftcrfont_draw): Add haiku specific code for Haiku
builds with Cairo.
* src/ftfont.c (ftfont_open): Set face.
(ftfont_has_char, ftfont_text_extents): Work around
crash.
(syms_of_ftfont): New symbol `mono'.
* src/ftfont.h (struct font_info): Enable Cairo-specific
fields for Cairo builds on Haiku.
* src/haiku_draw_support.cc:
* src/haiku_font_support.cc:
* src/haiku_io.c:
* src/haiku_select.cc:
* src/haiku_support.cc:
* src/haiku_support.h:
* src/haikufns.c:
* src/haikufont.c:
* src/haikugui.h:
* src/haikuimage.c:
* src/haikumenu.c:
* src/haikuselect.c:
* src/haikuselect.h:
* src/haikuterm.c:
* src/haikuterm.h: Add new files for Haiku windowing
support.
* src/haiku.c: Add new files for Haiku operating system
support.
* src/image.c: Implement image transforms and native XPM
support
on Haiku.
(GET_PIXEL, PUT_PIXEL, NO_PIXMAP)
(PIX_MASK_RETAIN, PIX_MASK_DRAW)
(RGB_TO_ULONG, RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG, RED16_FROM_ULONG, GREEN16_FROM_ULONG)
(BLUE16_FROM_ULONG): Define to appropriate values on
Haiku.
(image_create_bitmap_from_data): Add Haiku support.
(image_create_bitmap_from_file): Add TODO on Haiku.
(free_bitmap_record): Free bitmap on Haiku.
(image_size_in_bytes): Implement for Haiku bitmaps.
(image_set_transform): Implement on Haiku.
(image_create_x_image_and_pixmap_1): Implement on Haiku,
24-bit or 1-bit only.
(image_destroy_x_image, image_get_x_image): Use correct
img and pixmap values on Haiku.
(lookup_rgb_color): Use correct macro on Haiku.
(image_to_emacs_colors): Implement on Haiku.
(image_disable_image): Disable on Haiku.
(image_can_use_native_api): Test for translator presence
on Haiku.
(native_image_load): Use translator on Haiku.
(imagemagick_load_image): Add Haiku-specific quirks.
(Fimage_transforms_p): Allow rotate90 on Haiku.
(image_types): Enable native XPM support on Haiku.
(syms_of_image): Enable XPM images on Haiku.
* src/keyboard.c (kbd_buffer_get_event)
(handle_async_input, handle_input_available_signal)
(handle_user_signal, Fset_input_interrupt_mode)
(init_keyboard): Check for USABLE_SIGPOLL along with
USABLE_SIGIO.
* src/lisp.h (pD): Work around broken Haiku headers.
(HAVE_EXT_MENU_BAR): Define on Haiku.
(handle_input_available_signal): Enable if we just have
SIGPOLL as well.
* src/menu.c (have_boxes): Return true on Haiku.
(single_menu_item): Enable toolkit menus on Haiku.
(find_and_call_menu_selection): Also enable on Haiku.
* src/process.c (keyboard_bit_set): Enable with only
usable SIGPOLL.
(wait_reading_process_output): Test for SIGPOLL as well
as SIGIO availability.
* src/sound.c (sound_perror, vox_open)
(vox_configure, vox_close): Enable for usable SIGPOLL as
well.
* src/sysdep.c (sys_subshell): Enable for usable SIGPOLL.
(reset_sigio): Make conditional on F_SETOWN.
(request_sigio, unrequest_sigio)
(emacs_sigaction_init): Also handle SIGPOLLs.
(init_sys_modes): Disable TCXONC usage on Haiku, as it
doesn't have any ttys other than pseudo ttys, which don't
support C-s/C-q flow control, and causes compiler warnings.
(speeds): Disable high speeds if HAVE_TINY_SPEED_T.
* src/termhooks.h (enum output_method): Add output_haiku.
(struct terminal): Add Haiku display info.
(TERMINAL_FONT_CACHE): Enable for Haiku.
* src/terminal.c (Fterminal_live_p): Return `haiku' if
appropriate.
* src/verbose.mk.in (AM_V_CXX, AM_V_CXXLD): New logging
variables.
* src/xdisp.c (redisplay_internal)
(note_mouse_highlight): Return on Haiku if a popup is activated.
(display_menu_bar): Return on Haiku if frame is a Haiku
frame.
* src/xfaces.c (GCGraphicsExposures): Enable correctly on Haiku.
(x_create_gc): Enable dummy GC code on Haiku.
* src/xfns.c (x-server-version, x-file-dialog): Add
Haiku specifics to doc strings.
* src/xterm.c (syms_of_xterm): Add Haiku information to
doc string.
2021-11-20 13:30:08 +00:00
|
|
|
|
(declare-function haiku-frame-edges "haikufns.c" (&optional frame type))
|
2015-08-21 09:00:59 +00:00
|
|
|
|
|
2015-08-19 09:20:44 +00:00
|
|
|
|
(defun frame-edges (&optional frame type)
|
|
|
|
|
"Return coordinates of FRAME's edges.
|
|
|
|
|
FRAME must be a live frame and defaults to the selected one. The
|
|
|
|
|
list returned has the form (LEFT TOP RIGHT BOTTOM) where all
|
|
|
|
|
values are in pixels relative to the origin - the position (0, 0)
|
|
|
|
|
- of FRAME's display. For terminal frames all values are
|
|
|
|
|
relative to LEFT and TOP which are both zero.
|
|
|
|
|
|
|
|
|
|
Optional argument TYPE specifies the type of the edges. TYPE
|
|
|
|
|
`outer-edges' means to return the outer edges of FRAME. TYPE
|
|
|
|
|
`native-edges' (or nil) means to return the native edges of
|
|
|
|
|
FRAME. TYPE `inner-edges' means to return the inner edges of
|
|
|
|
|
FRAME."
|
2015-08-21 09:00:59 +00:00
|
|
|
|
(let* ((frame (window-normalize-frame frame))
|
|
|
|
|
(frame-type (framep-on-display frame)))
|
|
|
|
|
(cond
|
|
|
|
|
((eq frame-type 'x)
|
|
|
|
|
(x-frame-edges frame type))
|
|
|
|
|
((eq frame-type 'w32)
|
|
|
|
|
(w32-frame-edges frame type))
|
|
|
|
|
((eq frame-type 'ns)
|
|
|
|
|
(ns-frame-edges frame type))
|
Add support for the Haiku operating system and its window system
* .gitignore: Add binaries specific to Haiku.
* Makefie.in (HAVE_BE_APP): New variable.
(install-arch-dep): Install Emacs and Emacs.pdmp when
using Haiku.
* configure.ac: Detect and configure for Haiku and
various related configurations.
(be-app, be-freetype, be-cairo): New options.
(HAVE_BE_APP, HAIKU_OBJ, HAIKU_CXX_OBJ)
(HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(HAIKU, HAVE_TINY_SPEED_T): New define.
(emacs_config_features): Add BE_APP.
* doc/emacs/Makefile.in (EMACSSOURCES): Add Haiku
appendix.
* doc/emacs/emacs.texi: Add Haiku appendix to menus and
include it.
* doc/emacs/haiku.texi: New Haiku appendix.
* doc/lispref/display.texi (Defining Faces, Window Systems):
Explain meaning of `haiku' as a window system identifier.
(haiku-use-system-tooltips): Explain meaning of system
tooltips on
Haiku.
* doc/lispref/frames.texi (Multiple Terminals): Explain
meaning of haiku as a display type.
(Frame Layout): Clarify section for Haiku frames.
(Size Parameters): Explain limitations of fullwidth and
fullheight on Haiku.
(Management Parameters): Explain limitations of
inhibiting double buffering on builds with Cairo,
and the inability of frames with no-accept-focus to
receive keyboard input on Haiku.
(Font and Color Parameters): Explain the different font
backends available on Haiku.
(Raising and Lowering): Explain that lowering and
restacking frames doesn't work on Haiku.
(Child Frames): Explain oddities of child frame
visibility on Haiku.
* doc/lispref/os.texi (System Environment): Explain
meaning of haiku.
* etc/MACHINES: Add appropriate notices for Haiku.
* etc/NEWS: Document changes.
* etc/PROBLEMS: Document font spacing bug on Haiku.
* lib-src/Makefile.in: Build be-resources binary on
Haiku.
(CXX, CXXFLAGS, NON_CXX_FLAGS, ALL_CXXFLAGS)
(HAVE_BE_APP, HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(DONT_INSTALL): Add be-resources binary if on Haiku.
(be-resources): New target.
* lib-src/be_resources: Add helper binary for setting
resources on the Emacs application.
* lib-src/emacsclient.c (decode_options): Set
alt_display to "be" on Haiku.
* lisp/cus-edit.el (custom-button, custom-button-mouse)
(custom-button-unraised, custom-button-pressed): Update
face definitions for Haiku.
* lisp/cus-start.el: Add haiku-debug-on-fatal-error and
haiku-use-system-tooltips.
* lisp/faces.el (face-valid-attribute-values): Clarify
attribute comment for Haiku.
(tool-bar): Add appropriate toolbar color for Haiku.
* lisp/frame.el (haiku-frame-geometry)
(haiku-mouse-absolute-pixel-position)
(haiku-set-mouse-absolute-pixel-position)
(haiku-frame-edges)
(haiku-frame-list-z-order): New function declarations.
(frame-geometry, frame-edges)
(mouse-absolute-pixel-position)
(set-mouse-absolute-pixel-position)
(frame-list-z-order): Call appropriate window system
functions on Haiku.
(display-mouse-p, display-graphic-p)
(display-images-p, display-pixel-height)
(display-pixel-width, display-mm-height)
(display-mm-width, display-backing-store)
(display-save-under, display-planes)
(display-color-cells, display-visual-class): Update type
tests for Haiku.
* lisp/international/mule-cmds.el
(set-coding-system-map): Also
prevent set-terminal-coding-system from appearing in the menu
bar on Haiku.
* lisp/loadup.el: Load Haiku-specific files when built
with Haiku, and don't rename newly built Emacs on Haiku as BFS
doesn't support hard links.
* lisp/menu-bar.el (menu-bar-open): Add for Haiku.
* lisp/mwheel.el (mouse-wheel-down-event): Expect
wheel-up on Haiku.
(mouse-wheel-up-event): Expect wheel-down on Haiku.
(mouse-wheel-left-event): Expect wheel-left on Haiku.
(mouse-wheel-right-event): Expect wheel-right on Haiku.
* lisp/net/browse-url.el
(browse-url--browser-defcustom-type):
Add option for WebPositive.
(browse-url-webpositive-program): New variable.
(browse-url-default-program): Search for WebPositive.
(browse-url-webpositive): New function.
* lisp/net/eww.el (eww-form-submit, eww-form-file)
(eww-form-checkbox, eww-form-select): Define faces
appropriately for Haiku.
* lisp/term/haiku-win.el: New file.
* lisp/tooltip.el (menu-or-popup-active-p): New function
declaration.
(tooltip-show-help): Don't use tooltips on Haiku when a
menu is active.
* lisp/version.el (haiku-get-version-string): New
function declaration.
(emacs-version): Add Haiku version string if
appropriate.
* src/Makefile.in: Also produce binary named "Emacs"
with Haiku resources set.
(CXX, HAIKU_OBJ, HAIKU_CXX_OBJ, HAIKU_LIBS)
(HAIKU_CFLAGS, HAVE_BE_APP, NON_CXX_FLAGS)
(ALL_CXX_FLAGS): New variables.
(.SUFFIXES): Add .cc.
(.cc.o): New target.
(base_obj): Add Haiku C objects.
(doc_obj, obj): Split objects that should scanned for
documentation into doc_obj.
(SOME_MACHINE_OBJECTS): Add appropriate Haiku C objects.
(all): Depend on Emacs and Emacs.pdmp on Haiku.
(LIBES): Add Haiku libraries.
(gl-stamp)
($(etc)/DOC): Scan doc_obj instead of obj
(temacs$(EXEEXT): Use C++ linker on Haiku.
(ctagsfiles3): New variable.
(TAGS): Scan C++ files.
* src/alloc.c (garbage_collect): Mark Haiku display.
* src/dispextern.h (HAVE_NATIVE_TRANSFORMS): Also enable
on Haiku.
(struct image): Add fields for Haiku transforms.
(RGB_PIXEL_COLOR): Define to unsigned long on Haiku as
well.
(sit_for): Also check USABLE_SIGPOLL.
(init_display_interactive): Set initial window system to
Haiku on Haiku builds.
* src/emacs.c (main): Define Haiku syms and init haiku
clipboard.
(shut_down_emacs): Quit BApplication on Haiku and
trigger debug
on aborts if haiku_debug_on_fatal_error.
(Vsystem_type): Update docstring.
* src/fileio.c (next-read-file-uses-dialog-p): Enable on
Haiku.
* src/filelock.c (WTMP_FILE): Only define if BOOT_TIME
is also defined.
* src/floatfns.c (double_integer_scale): Work around
Haiku libroot brain damage.
* src/font.c (syms_of_font): Define appropriate font
driver symbols for Haiku builds with various options.
* src/font.h: Also enable ftcrfont on Haiku builds with
Cairo.
(font_data_structures_may_be_ill_formed): Also enable on
Haiku builds that have Cairo.
* src/frame.c (Fframep): Update doc-string for Haiku
builds and return haiku if appropriate.
(syms_of_frame): New symbol `haiku'.
* src/frame.h (struct frame): Add output data for Haiku.
(FRAME_HAIKU_P): New macro.
(FRAME_WINDOW_P): Test for Haiku frames as well.
* src/ftcrfont.c (RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG): New macros.
(ftcrfont_draw): Add haiku specific code for Haiku
builds with Cairo.
* src/ftfont.c (ftfont_open): Set face.
(ftfont_has_char, ftfont_text_extents): Work around
crash.
(syms_of_ftfont): New symbol `mono'.
* src/ftfont.h (struct font_info): Enable Cairo-specific
fields for Cairo builds on Haiku.
* src/haiku_draw_support.cc:
* src/haiku_font_support.cc:
* src/haiku_io.c:
* src/haiku_select.cc:
* src/haiku_support.cc:
* src/haiku_support.h:
* src/haikufns.c:
* src/haikufont.c:
* src/haikugui.h:
* src/haikuimage.c:
* src/haikumenu.c:
* src/haikuselect.c:
* src/haikuselect.h:
* src/haikuterm.c:
* src/haikuterm.h: Add new files for Haiku windowing
support.
* src/haiku.c: Add new files for Haiku operating system
support.
* src/image.c: Implement image transforms and native XPM
support
on Haiku.
(GET_PIXEL, PUT_PIXEL, NO_PIXMAP)
(PIX_MASK_RETAIN, PIX_MASK_DRAW)
(RGB_TO_ULONG, RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG, RED16_FROM_ULONG, GREEN16_FROM_ULONG)
(BLUE16_FROM_ULONG): Define to appropriate values on
Haiku.
(image_create_bitmap_from_data): Add Haiku support.
(image_create_bitmap_from_file): Add TODO on Haiku.
(free_bitmap_record): Free bitmap on Haiku.
(image_size_in_bytes): Implement for Haiku bitmaps.
(image_set_transform): Implement on Haiku.
(image_create_x_image_and_pixmap_1): Implement on Haiku,
24-bit or 1-bit only.
(image_destroy_x_image, image_get_x_image): Use correct
img and pixmap values on Haiku.
(lookup_rgb_color): Use correct macro on Haiku.
(image_to_emacs_colors): Implement on Haiku.
(image_disable_image): Disable on Haiku.
(image_can_use_native_api): Test for translator presence
on Haiku.
(native_image_load): Use translator on Haiku.
(imagemagick_load_image): Add Haiku-specific quirks.
(Fimage_transforms_p): Allow rotate90 on Haiku.
(image_types): Enable native XPM support on Haiku.
(syms_of_image): Enable XPM images on Haiku.
* src/keyboard.c (kbd_buffer_get_event)
(handle_async_input, handle_input_available_signal)
(handle_user_signal, Fset_input_interrupt_mode)
(init_keyboard): Check for USABLE_SIGPOLL along with
USABLE_SIGIO.
* src/lisp.h (pD): Work around broken Haiku headers.
(HAVE_EXT_MENU_BAR): Define on Haiku.
(handle_input_available_signal): Enable if we just have
SIGPOLL as well.
* src/menu.c (have_boxes): Return true on Haiku.
(single_menu_item): Enable toolkit menus on Haiku.
(find_and_call_menu_selection): Also enable on Haiku.
* src/process.c (keyboard_bit_set): Enable with only
usable SIGPOLL.
(wait_reading_process_output): Test for SIGPOLL as well
as SIGIO availability.
* src/sound.c (sound_perror, vox_open)
(vox_configure, vox_close): Enable for usable SIGPOLL as
well.
* src/sysdep.c (sys_subshell): Enable for usable SIGPOLL.
(reset_sigio): Make conditional on F_SETOWN.
(request_sigio, unrequest_sigio)
(emacs_sigaction_init): Also handle SIGPOLLs.
(init_sys_modes): Disable TCXONC usage on Haiku, as it
doesn't have any ttys other than pseudo ttys, which don't
support C-s/C-q flow control, and causes compiler warnings.
(speeds): Disable high speeds if HAVE_TINY_SPEED_T.
* src/termhooks.h (enum output_method): Add output_haiku.
(struct terminal): Add Haiku display info.
(TERMINAL_FONT_CACHE): Enable for Haiku.
* src/terminal.c (Fterminal_live_p): Return `haiku' if
appropriate.
* src/verbose.mk.in (AM_V_CXX, AM_V_CXXLD): New logging
variables.
* src/xdisp.c (redisplay_internal)
(note_mouse_highlight): Return on Haiku if a popup is activated.
(display_menu_bar): Return on Haiku if frame is a Haiku
frame.
* src/xfaces.c (GCGraphicsExposures): Enable correctly on Haiku.
(x_create_gc): Enable dummy GC code on Haiku.
* src/xfns.c (x-server-version, x-file-dialog): Add
Haiku specifics to doc strings.
* src/xterm.c (syms_of_xterm): Add Haiku information to
doc string.
2021-11-20 13:30:08 +00:00
|
|
|
|
((eq frame-type 'haiku)
|
|
|
|
|
(haiku-frame-edges frame type))
|
2015-08-21 09:00:59 +00:00
|
|
|
|
(t
|
|
|
|
|
(list 0 0 (frame-width frame) (frame-height frame))))))
|
|
|
|
|
|
|
|
|
|
(declare-function w32-mouse-absolute-pixel-position "w32fns.c")
|
|
|
|
|
(declare-function x-mouse-absolute-pixel-position "xfns.c")
|
2017-12-15 02:31:28 +00:00
|
|
|
|
(declare-function ns-mouse-absolute-pixel-position "nsfns.m")
|
Add support for the Haiku operating system and its window system
* .gitignore: Add binaries specific to Haiku.
* Makefie.in (HAVE_BE_APP): New variable.
(install-arch-dep): Install Emacs and Emacs.pdmp when
using Haiku.
* configure.ac: Detect and configure for Haiku and
various related configurations.
(be-app, be-freetype, be-cairo): New options.
(HAVE_BE_APP, HAIKU_OBJ, HAIKU_CXX_OBJ)
(HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(HAIKU, HAVE_TINY_SPEED_T): New define.
(emacs_config_features): Add BE_APP.
* doc/emacs/Makefile.in (EMACSSOURCES): Add Haiku
appendix.
* doc/emacs/emacs.texi: Add Haiku appendix to menus and
include it.
* doc/emacs/haiku.texi: New Haiku appendix.
* doc/lispref/display.texi (Defining Faces, Window Systems):
Explain meaning of `haiku' as a window system identifier.
(haiku-use-system-tooltips): Explain meaning of system
tooltips on
Haiku.
* doc/lispref/frames.texi (Multiple Terminals): Explain
meaning of haiku as a display type.
(Frame Layout): Clarify section for Haiku frames.
(Size Parameters): Explain limitations of fullwidth and
fullheight on Haiku.
(Management Parameters): Explain limitations of
inhibiting double buffering on builds with Cairo,
and the inability of frames with no-accept-focus to
receive keyboard input on Haiku.
(Font and Color Parameters): Explain the different font
backends available on Haiku.
(Raising and Lowering): Explain that lowering and
restacking frames doesn't work on Haiku.
(Child Frames): Explain oddities of child frame
visibility on Haiku.
* doc/lispref/os.texi (System Environment): Explain
meaning of haiku.
* etc/MACHINES: Add appropriate notices for Haiku.
* etc/NEWS: Document changes.
* etc/PROBLEMS: Document font spacing bug on Haiku.
* lib-src/Makefile.in: Build be-resources binary on
Haiku.
(CXX, CXXFLAGS, NON_CXX_FLAGS, ALL_CXXFLAGS)
(HAVE_BE_APP, HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(DONT_INSTALL): Add be-resources binary if on Haiku.
(be-resources): New target.
* lib-src/be_resources: Add helper binary for setting
resources on the Emacs application.
* lib-src/emacsclient.c (decode_options): Set
alt_display to "be" on Haiku.
* lisp/cus-edit.el (custom-button, custom-button-mouse)
(custom-button-unraised, custom-button-pressed): Update
face definitions for Haiku.
* lisp/cus-start.el: Add haiku-debug-on-fatal-error and
haiku-use-system-tooltips.
* lisp/faces.el (face-valid-attribute-values): Clarify
attribute comment for Haiku.
(tool-bar): Add appropriate toolbar color for Haiku.
* lisp/frame.el (haiku-frame-geometry)
(haiku-mouse-absolute-pixel-position)
(haiku-set-mouse-absolute-pixel-position)
(haiku-frame-edges)
(haiku-frame-list-z-order): New function declarations.
(frame-geometry, frame-edges)
(mouse-absolute-pixel-position)
(set-mouse-absolute-pixel-position)
(frame-list-z-order): Call appropriate window system
functions on Haiku.
(display-mouse-p, display-graphic-p)
(display-images-p, display-pixel-height)
(display-pixel-width, display-mm-height)
(display-mm-width, display-backing-store)
(display-save-under, display-planes)
(display-color-cells, display-visual-class): Update type
tests for Haiku.
* lisp/international/mule-cmds.el
(set-coding-system-map): Also
prevent set-terminal-coding-system from appearing in the menu
bar on Haiku.
* lisp/loadup.el: Load Haiku-specific files when built
with Haiku, and don't rename newly built Emacs on Haiku as BFS
doesn't support hard links.
* lisp/menu-bar.el (menu-bar-open): Add for Haiku.
* lisp/mwheel.el (mouse-wheel-down-event): Expect
wheel-up on Haiku.
(mouse-wheel-up-event): Expect wheel-down on Haiku.
(mouse-wheel-left-event): Expect wheel-left on Haiku.
(mouse-wheel-right-event): Expect wheel-right on Haiku.
* lisp/net/browse-url.el
(browse-url--browser-defcustom-type):
Add option for WebPositive.
(browse-url-webpositive-program): New variable.
(browse-url-default-program): Search for WebPositive.
(browse-url-webpositive): New function.
* lisp/net/eww.el (eww-form-submit, eww-form-file)
(eww-form-checkbox, eww-form-select): Define faces
appropriately for Haiku.
* lisp/term/haiku-win.el: New file.
* lisp/tooltip.el (menu-or-popup-active-p): New function
declaration.
(tooltip-show-help): Don't use tooltips on Haiku when a
menu is active.
* lisp/version.el (haiku-get-version-string): New
function declaration.
(emacs-version): Add Haiku version string if
appropriate.
* src/Makefile.in: Also produce binary named "Emacs"
with Haiku resources set.
(CXX, HAIKU_OBJ, HAIKU_CXX_OBJ, HAIKU_LIBS)
(HAIKU_CFLAGS, HAVE_BE_APP, NON_CXX_FLAGS)
(ALL_CXX_FLAGS): New variables.
(.SUFFIXES): Add .cc.
(.cc.o): New target.
(base_obj): Add Haiku C objects.
(doc_obj, obj): Split objects that should scanned for
documentation into doc_obj.
(SOME_MACHINE_OBJECTS): Add appropriate Haiku C objects.
(all): Depend on Emacs and Emacs.pdmp on Haiku.
(LIBES): Add Haiku libraries.
(gl-stamp)
($(etc)/DOC): Scan doc_obj instead of obj
(temacs$(EXEEXT): Use C++ linker on Haiku.
(ctagsfiles3): New variable.
(TAGS): Scan C++ files.
* src/alloc.c (garbage_collect): Mark Haiku display.
* src/dispextern.h (HAVE_NATIVE_TRANSFORMS): Also enable
on Haiku.
(struct image): Add fields for Haiku transforms.
(RGB_PIXEL_COLOR): Define to unsigned long on Haiku as
well.
(sit_for): Also check USABLE_SIGPOLL.
(init_display_interactive): Set initial window system to
Haiku on Haiku builds.
* src/emacs.c (main): Define Haiku syms and init haiku
clipboard.
(shut_down_emacs): Quit BApplication on Haiku and
trigger debug
on aborts if haiku_debug_on_fatal_error.
(Vsystem_type): Update docstring.
* src/fileio.c (next-read-file-uses-dialog-p): Enable on
Haiku.
* src/filelock.c (WTMP_FILE): Only define if BOOT_TIME
is also defined.
* src/floatfns.c (double_integer_scale): Work around
Haiku libroot brain damage.
* src/font.c (syms_of_font): Define appropriate font
driver symbols for Haiku builds with various options.
* src/font.h: Also enable ftcrfont on Haiku builds with
Cairo.
(font_data_structures_may_be_ill_formed): Also enable on
Haiku builds that have Cairo.
* src/frame.c (Fframep): Update doc-string for Haiku
builds and return haiku if appropriate.
(syms_of_frame): New symbol `haiku'.
* src/frame.h (struct frame): Add output data for Haiku.
(FRAME_HAIKU_P): New macro.
(FRAME_WINDOW_P): Test for Haiku frames as well.
* src/ftcrfont.c (RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG): New macros.
(ftcrfont_draw): Add haiku specific code for Haiku
builds with Cairo.
* src/ftfont.c (ftfont_open): Set face.
(ftfont_has_char, ftfont_text_extents): Work around
crash.
(syms_of_ftfont): New symbol `mono'.
* src/ftfont.h (struct font_info): Enable Cairo-specific
fields for Cairo builds on Haiku.
* src/haiku_draw_support.cc:
* src/haiku_font_support.cc:
* src/haiku_io.c:
* src/haiku_select.cc:
* src/haiku_support.cc:
* src/haiku_support.h:
* src/haikufns.c:
* src/haikufont.c:
* src/haikugui.h:
* src/haikuimage.c:
* src/haikumenu.c:
* src/haikuselect.c:
* src/haikuselect.h:
* src/haikuterm.c:
* src/haikuterm.h: Add new files for Haiku windowing
support.
* src/haiku.c: Add new files for Haiku operating system
support.
* src/image.c: Implement image transforms and native XPM
support
on Haiku.
(GET_PIXEL, PUT_PIXEL, NO_PIXMAP)
(PIX_MASK_RETAIN, PIX_MASK_DRAW)
(RGB_TO_ULONG, RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG, RED16_FROM_ULONG, GREEN16_FROM_ULONG)
(BLUE16_FROM_ULONG): Define to appropriate values on
Haiku.
(image_create_bitmap_from_data): Add Haiku support.
(image_create_bitmap_from_file): Add TODO on Haiku.
(free_bitmap_record): Free bitmap on Haiku.
(image_size_in_bytes): Implement for Haiku bitmaps.
(image_set_transform): Implement on Haiku.
(image_create_x_image_and_pixmap_1): Implement on Haiku,
24-bit or 1-bit only.
(image_destroy_x_image, image_get_x_image): Use correct
img and pixmap values on Haiku.
(lookup_rgb_color): Use correct macro on Haiku.
(image_to_emacs_colors): Implement on Haiku.
(image_disable_image): Disable on Haiku.
(image_can_use_native_api): Test for translator presence
on Haiku.
(native_image_load): Use translator on Haiku.
(imagemagick_load_image): Add Haiku-specific quirks.
(Fimage_transforms_p): Allow rotate90 on Haiku.
(image_types): Enable native XPM support on Haiku.
(syms_of_image): Enable XPM images on Haiku.
* src/keyboard.c (kbd_buffer_get_event)
(handle_async_input, handle_input_available_signal)
(handle_user_signal, Fset_input_interrupt_mode)
(init_keyboard): Check for USABLE_SIGPOLL along with
USABLE_SIGIO.
* src/lisp.h (pD): Work around broken Haiku headers.
(HAVE_EXT_MENU_BAR): Define on Haiku.
(handle_input_available_signal): Enable if we just have
SIGPOLL as well.
* src/menu.c (have_boxes): Return true on Haiku.
(single_menu_item): Enable toolkit menus on Haiku.
(find_and_call_menu_selection): Also enable on Haiku.
* src/process.c (keyboard_bit_set): Enable with only
usable SIGPOLL.
(wait_reading_process_output): Test for SIGPOLL as well
as SIGIO availability.
* src/sound.c (sound_perror, vox_open)
(vox_configure, vox_close): Enable for usable SIGPOLL as
well.
* src/sysdep.c (sys_subshell): Enable for usable SIGPOLL.
(reset_sigio): Make conditional on F_SETOWN.
(request_sigio, unrequest_sigio)
(emacs_sigaction_init): Also handle SIGPOLLs.
(init_sys_modes): Disable TCXONC usage on Haiku, as it
doesn't have any ttys other than pseudo ttys, which don't
support C-s/C-q flow control, and causes compiler warnings.
(speeds): Disable high speeds if HAVE_TINY_SPEED_T.
* src/termhooks.h (enum output_method): Add output_haiku.
(struct terminal): Add Haiku display info.
(TERMINAL_FONT_CACHE): Enable for Haiku.
* src/terminal.c (Fterminal_live_p): Return `haiku' if
appropriate.
* src/verbose.mk.in (AM_V_CXX, AM_V_CXXLD): New logging
variables.
* src/xdisp.c (redisplay_internal)
(note_mouse_highlight): Return on Haiku if a popup is activated.
(display_menu_bar): Return on Haiku if frame is a Haiku
frame.
* src/xfaces.c (GCGraphicsExposures): Enable correctly on Haiku.
(x_create_gc): Enable dummy GC code on Haiku.
* src/xfns.c (x-server-version, x-file-dialog): Add
Haiku specifics to doc strings.
* src/xterm.c (syms_of_xterm): Add Haiku information to
doc string.
2021-11-20 13:30:08 +00:00
|
|
|
|
(declare-function haiku-mouse-absolute-pixel-position "haikufns.c")
|
2015-08-21 09:00:59 +00:00
|
|
|
|
|
|
|
|
|
(defun mouse-absolute-pixel-position ()
|
|
|
|
|
"Return absolute position of mouse cursor in pixels.
|
|
|
|
|
The position is returned as a cons cell (X . Y) of the
|
|
|
|
|
coordinates of the mouse cursor position in pixels relative to a
|
|
|
|
|
position (0, 0) of the selected frame's terminal."
|
|
|
|
|
(let ((frame-type (framep-on-display)))
|
|
|
|
|
(cond
|
|
|
|
|
((eq frame-type 'x)
|
|
|
|
|
(x-mouse-absolute-pixel-position))
|
|
|
|
|
((eq frame-type 'w32)
|
|
|
|
|
(w32-mouse-absolute-pixel-position))
|
2017-07-15 20:57:18 +00:00
|
|
|
|
((eq frame-type 'ns)
|
|
|
|
|
(ns-mouse-absolute-pixel-position))
|
Add support for the Haiku operating system and its window system
* .gitignore: Add binaries specific to Haiku.
* Makefie.in (HAVE_BE_APP): New variable.
(install-arch-dep): Install Emacs and Emacs.pdmp when
using Haiku.
* configure.ac: Detect and configure for Haiku and
various related configurations.
(be-app, be-freetype, be-cairo): New options.
(HAVE_BE_APP, HAIKU_OBJ, HAIKU_CXX_OBJ)
(HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(HAIKU, HAVE_TINY_SPEED_T): New define.
(emacs_config_features): Add BE_APP.
* doc/emacs/Makefile.in (EMACSSOURCES): Add Haiku
appendix.
* doc/emacs/emacs.texi: Add Haiku appendix to menus and
include it.
* doc/emacs/haiku.texi: New Haiku appendix.
* doc/lispref/display.texi (Defining Faces, Window Systems):
Explain meaning of `haiku' as a window system identifier.
(haiku-use-system-tooltips): Explain meaning of system
tooltips on
Haiku.
* doc/lispref/frames.texi (Multiple Terminals): Explain
meaning of haiku as a display type.
(Frame Layout): Clarify section for Haiku frames.
(Size Parameters): Explain limitations of fullwidth and
fullheight on Haiku.
(Management Parameters): Explain limitations of
inhibiting double buffering on builds with Cairo,
and the inability of frames with no-accept-focus to
receive keyboard input on Haiku.
(Font and Color Parameters): Explain the different font
backends available on Haiku.
(Raising and Lowering): Explain that lowering and
restacking frames doesn't work on Haiku.
(Child Frames): Explain oddities of child frame
visibility on Haiku.
* doc/lispref/os.texi (System Environment): Explain
meaning of haiku.
* etc/MACHINES: Add appropriate notices for Haiku.
* etc/NEWS: Document changes.
* etc/PROBLEMS: Document font spacing bug on Haiku.
* lib-src/Makefile.in: Build be-resources binary on
Haiku.
(CXX, CXXFLAGS, NON_CXX_FLAGS, ALL_CXXFLAGS)
(HAVE_BE_APP, HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(DONT_INSTALL): Add be-resources binary if on Haiku.
(be-resources): New target.
* lib-src/be_resources: Add helper binary for setting
resources on the Emacs application.
* lib-src/emacsclient.c (decode_options): Set
alt_display to "be" on Haiku.
* lisp/cus-edit.el (custom-button, custom-button-mouse)
(custom-button-unraised, custom-button-pressed): Update
face definitions for Haiku.
* lisp/cus-start.el: Add haiku-debug-on-fatal-error and
haiku-use-system-tooltips.
* lisp/faces.el (face-valid-attribute-values): Clarify
attribute comment for Haiku.
(tool-bar): Add appropriate toolbar color for Haiku.
* lisp/frame.el (haiku-frame-geometry)
(haiku-mouse-absolute-pixel-position)
(haiku-set-mouse-absolute-pixel-position)
(haiku-frame-edges)
(haiku-frame-list-z-order): New function declarations.
(frame-geometry, frame-edges)
(mouse-absolute-pixel-position)
(set-mouse-absolute-pixel-position)
(frame-list-z-order): Call appropriate window system
functions on Haiku.
(display-mouse-p, display-graphic-p)
(display-images-p, display-pixel-height)
(display-pixel-width, display-mm-height)
(display-mm-width, display-backing-store)
(display-save-under, display-planes)
(display-color-cells, display-visual-class): Update type
tests for Haiku.
* lisp/international/mule-cmds.el
(set-coding-system-map): Also
prevent set-terminal-coding-system from appearing in the menu
bar on Haiku.
* lisp/loadup.el: Load Haiku-specific files when built
with Haiku, and don't rename newly built Emacs on Haiku as BFS
doesn't support hard links.
* lisp/menu-bar.el (menu-bar-open): Add for Haiku.
* lisp/mwheel.el (mouse-wheel-down-event): Expect
wheel-up on Haiku.
(mouse-wheel-up-event): Expect wheel-down on Haiku.
(mouse-wheel-left-event): Expect wheel-left on Haiku.
(mouse-wheel-right-event): Expect wheel-right on Haiku.
* lisp/net/browse-url.el
(browse-url--browser-defcustom-type):
Add option for WebPositive.
(browse-url-webpositive-program): New variable.
(browse-url-default-program): Search for WebPositive.
(browse-url-webpositive): New function.
* lisp/net/eww.el (eww-form-submit, eww-form-file)
(eww-form-checkbox, eww-form-select): Define faces
appropriately for Haiku.
* lisp/term/haiku-win.el: New file.
* lisp/tooltip.el (menu-or-popup-active-p): New function
declaration.
(tooltip-show-help): Don't use tooltips on Haiku when a
menu is active.
* lisp/version.el (haiku-get-version-string): New
function declaration.
(emacs-version): Add Haiku version string if
appropriate.
* src/Makefile.in: Also produce binary named "Emacs"
with Haiku resources set.
(CXX, HAIKU_OBJ, HAIKU_CXX_OBJ, HAIKU_LIBS)
(HAIKU_CFLAGS, HAVE_BE_APP, NON_CXX_FLAGS)
(ALL_CXX_FLAGS): New variables.
(.SUFFIXES): Add .cc.
(.cc.o): New target.
(base_obj): Add Haiku C objects.
(doc_obj, obj): Split objects that should scanned for
documentation into doc_obj.
(SOME_MACHINE_OBJECTS): Add appropriate Haiku C objects.
(all): Depend on Emacs and Emacs.pdmp on Haiku.
(LIBES): Add Haiku libraries.
(gl-stamp)
($(etc)/DOC): Scan doc_obj instead of obj
(temacs$(EXEEXT): Use C++ linker on Haiku.
(ctagsfiles3): New variable.
(TAGS): Scan C++ files.
* src/alloc.c (garbage_collect): Mark Haiku display.
* src/dispextern.h (HAVE_NATIVE_TRANSFORMS): Also enable
on Haiku.
(struct image): Add fields for Haiku transforms.
(RGB_PIXEL_COLOR): Define to unsigned long on Haiku as
well.
(sit_for): Also check USABLE_SIGPOLL.
(init_display_interactive): Set initial window system to
Haiku on Haiku builds.
* src/emacs.c (main): Define Haiku syms and init haiku
clipboard.
(shut_down_emacs): Quit BApplication on Haiku and
trigger debug
on aborts if haiku_debug_on_fatal_error.
(Vsystem_type): Update docstring.
* src/fileio.c (next-read-file-uses-dialog-p): Enable on
Haiku.
* src/filelock.c (WTMP_FILE): Only define if BOOT_TIME
is also defined.
* src/floatfns.c (double_integer_scale): Work around
Haiku libroot brain damage.
* src/font.c (syms_of_font): Define appropriate font
driver symbols for Haiku builds with various options.
* src/font.h: Also enable ftcrfont on Haiku builds with
Cairo.
(font_data_structures_may_be_ill_formed): Also enable on
Haiku builds that have Cairo.
* src/frame.c (Fframep): Update doc-string for Haiku
builds and return haiku if appropriate.
(syms_of_frame): New symbol `haiku'.
* src/frame.h (struct frame): Add output data for Haiku.
(FRAME_HAIKU_P): New macro.
(FRAME_WINDOW_P): Test for Haiku frames as well.
* src/ftcrfont.c (RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG): New macros.
(ftcrfont_draw): Add haiku specific code for Haiku
builds with Cairo.
* src/ftfont.c (ftfont_open): Set face.
(ftfont_has_char, ftfont_text_extents): Work around
crash.
(syms_of_ftfont): New symbol `mono'.
* src/ftfont.h (struct font_info): Enable Cairo-specific
fields for Cairo builds on Haiku.
* src/haiku_draw_support.cc:
* src/haiku_font_support.cc:
* src/haiku_io.c:
* src/haiku_select.cc:
* src/haiku_support.cc:
* src/haiku_support.h:
* src/haikufns.c:
* src/haikufont.c:
* src/haikugui.h:
* src/haikuimage.c:
* src/haikumenu.c:
* src/haikuselect.c:
* src/haikuselect.h:
* src/haikuterm.c:
* src/haikuterm.h: Add new files for Haiku windowing
support.
* src/haiku.c: Add new files for Haiku operating system
support.
* src/image.c: Implement image transforms and native XPM
support
on Haiku.
(GET_PIXEL, PUT_PIXEL, NO_PIXMAP)
(PIX_MASK_RETAIN, PIX_MASK_DRAW)
(RGB_TO_ULONG, RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG, RED16_FROM_ULONG, GREEN16_FROM_ULONG)
(BLUE16_FROM_ULONG): Define to appropriate values on
Haiku.
(image_create_bitmap_from_data): Add Haiku support.
(image_create_bitmap_from_file): Add TODO on Haiku.
(free_bitmap_record): Free bitmap on Haiku.
(image_size_in_bytes): Implement for Haiku bitmaps.
(image_set_transform): Implement on Haiku.
(image_create_x_image_and_pixmap_1): Implement on Haiku,
24-bit or 1-bit only.
(image_destroy_x_image, image_get_x_image): Use correct
img and pixmap values on Haiku.
(lookup_rgb_color): Use correct macro on Haiku.
(image_to_emacs_colors): Implement on Haiku.
(image_disable_image): Disable on Haiku.
(image_can_use_native_api): Test for translator presence
on Haiku.
(native_image_load): Use translator on Haiku.
(imagemagick_load_image): Add Haiku-specific quirks.
(Fimage_transforms_p): Allow rotate90 on Haiku.
(image_types): Enable native XPM support on Haiku.
(syms_of_image): Enable XPM images on Haiku.
* src/keyboard.c (kbd_buffer_get_event)
(handle_async_input, handle_input_available_signal)
(handle_user_signal, Fset_input_interrupt_mode)
(init_keyboard): Check for USABLE_SIGPOLL along with
USABLE_SIGIO.
* src/lisp.h (pD): Work around broken Haiku headers.
(HAVE_EXT_MENU_BAR): Define on Haiku.
(handle_input_available_signal): Enable if we just have
SIGPOLL as well.
* src/menu.c (have_boxes): Return true on Haiku.
(single_menu_item): Enable toolkit menus on Haiku.
(find_and_call_menu_selection): Also enable on Haiku.
* src/process.c (keyboard_bit_set): Enable with only
usable SIGPOLL.
(wait_reading_process_output): Test for SIGPOLL as well
as SIGIO availability.
* src/sound.c (sound_perror, vox_open)
(vox_configure, vox_close): Enable for usable SIGPOLL as
well.
* src/sysdep.c (sys_subshell): Enable for usable SIGPOLL.
(reset_sigio): Make conditional on F_SETOWN.
(request_sigio, unrequest_sigio)
(emacs_sigaction_init): Also handle SIGPOLLs.
(init_sys_modes): Disable TCXONC usage on Haiku, as it
doesn't have any ttys other than pseudo ttys, which don't
support C-s/C-q flow control, and causes compiler warnings.
(speeds): Disable high speeds if HAVE_TINY_SPEED_T.
* src/termhooks.h (enum output_method): Add output_haiku.
(struct terminal): Add Haiku display info.
(TERMINAL_FONT_CACHE): Enable for Haiku.
* src/terminal.c (Fterminal_live_p): Return `haiku' if
appropriate.
* src/verbose.mk.in (AM_V_CXX, AM_V_CXXLD): New logging
variables.
* src/xdisp.c (redisplay_internal)
(note_mouse_highlight): Return on Haiku if a popup is activated.
(display_menu_bar): Return on Haiku if frame is a Haiku
frame.
* src/xfaces.c (GCGraphicsExposures): Enable correctly on Haiku.
(x_create_gc): Enable dummy GC code on Haiku.
* src/xfns.c (x-server-version, x-file-dialog): Add
Haiku specifics to doc strings.
* src/xterm.c (syms_of_xterm): Add Haiku information to
doc string.
2021-11-20 13:30:08 +00:00
|
|
|
|
((eq frame-type 'haiku)
|
|
|
|
|
(haiku-mouse-absolute-pixel-position))
|
2015-08-21 09:00:59 +00:00
|
|
|
|
(t
|
|
|
|
|
(cons 0 0)))))
|
|
|
|
|
|
2017-05-18 19:31:46 +00:00
|
|
|
|
(declare-function ns-set-mouse-absolute-pixel-position "nsfns.m" (x y))
|
2015-08-21 09:00:59 +00:00
|
|
|
|
(declare-function w32-set-mouse-absolute-pixel-position "w32fns.c" (x y))
|
|
|
|
|
(declare-function x-set-mouse-absolute-pixel-position "xfns.c" (x y))
|
Add support for the Haiku operating system and its window system
* .gitignore: Add binaries specific to Haiku.
* Makefie.in (HAVE_BE_APP): New variable.
(install-arch-dep): Install Emacs and Emacs.pdmp when
using Haiku.
* configure.ac: Detect and configure for Haiku and
various related configurations.
(be-app, be-freetype, be-cairo): New options.
(HAVE_BE_APP, HAIKU_OBJ, HAIKU_CXX_OBJ)
(HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(HAIKU, HAVE_TINY_SPEED_T): New define.
(emacs_config_features): Add BE_APP.
* doc/emacs/Makefile.in (EMACSSOURCES): Add Haiku
appendix.
* doc/emacs/emacs.texi: Add Haiku appendix to menus and
include it.
* doc/emacs/haiku.texi: New Haiku appendix.
* doc/lispref/display.texi (Defining Faces, Window Systems):
Explain meaning of `haiku' as a window system identifier.
(haiku-use-system-tooltips): Explain meaning of system
tooltips on
Haiku.
* doc/lispref/frames.texi (Multiple Terminals): Explain
meaning of haiku as a display type.
(Frame Layout): Clarify section for Haiku frames.
(Size Parameters): Explain limitations of fullwidth and
fullheight on Haiku.
(Management Parameters): Explain limitations of
inhibiting double buffering on builds with Cairo,
and the inability of frames with no-accept-focus to
receive keyboard input on Haiku.
(Font and Color Parameters): Explain the different font
backends available on Haiku.
(Raising and Lowering): Explain that lowering and
restacking frames doesn't work on Haiku.
(Child Frames): Explain oddities of child frame
visibility on Haiku.
* doc/lispref/os.texi (System Environment): Explain
meaning of haiku.
* etc/MACHINES: Add appropriate notices for Haiku.
* etc/NEWS: Document changes.
* etc/PROBLEMS: Document font spacing bug on Haiku.
* lib-src/Makefile.in: Build be-resources binary on
Haiku.
(CXX, CXXFLAGS, NON_CXX_FLAGS, ALL_CXXFLAGS)
(HAVE_BE_APP, HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(DONT_INSTALL): Add be-resources binary if on Haiku.
(be-resources): New target.
* lib-src/be_resources: Add helper binary for setting
resources on the Emacs application.
* lib-src/emacsclient.c (decode_options): Set
alt_display to "be" on Haiku.
* lisp/cus-edit.el (custom-button, custom-button-mouse)
(custom-button-unraised, custom-button-pressed): Update
face definitions for Haiku.
* lisp/cus-start.el: Add haiku-debug-on-fatal-error and
haiku-use-system-tooltips.
* lisp/faces.el (face-valid-attribute-values): Clarify
attribute comment for Haiku.
(tool-bar): Add appropriate toolbar color for Haiku.
* lisp/frame.el (haiku-frame-geometry)
(haiku-mouse-absolute-pixel-position)
(haiku-set-mouse-absolute-pixel-position)
(haiku-frame-edges)
(haiku-frame-list-z-order): New function declarations.
(frame-geometry, frame-edges)
(mouse-absolute-pixel-position)
(set-mouse-absolute-pixel-position)
(frame-list-z-order): Call appropriate window system
functions on Haiku.
(display-mouse-p, display-graphic-p)
(display-images-p, display-pixel-height)
(display-pixel-width, display-mm-height)
(display-mm-width, display-backing-store)
(display-save-under, display-planes)
(display-color-cells, display-visual-class): Update type
tests for Haiku.
* lisp/international/mule-cmds.el
(set-coding-system-map): Also
prevent set-terminal-coding-system from appearing in the menu
bar on Haiku.
* lisp/loadup.el: Load Haiku-specific files when built
with Haiku, and don't rename newly built Emacs on Haiku as BFS
doesn't support hard links.
* lisp/menu-bar.el (menu-bar-open): Add for Haiku.
* lisp/mwheel.el (mouse-wheel-down-event): Expect
wheel-up on Haiku.
(mouse-wheel-up-event): Expect wheel-down on Haiku.
(mouse-wheel-left-event): Expect wheel-left on Haiku.
(mouse-wheel-right-event): Expect wheel-right on Haiku.
* lisp/net/browse-url.el
(browse-url--browser-defcustom-type):
Add option for WebPositive.
(browse-url-webpositive-program): New variable.
(browse-url-default-program): Search for WebPositive.
(browse-url-webpositive): New function.
* lisp/net/eww.el (eww-form-submit, eww-form-file)
(eww-form-checkbox, eww-form-select): Define faces
appropriately for Haiku.
* lisp/term/haiku-win.el: New file.
* lisp/tooltip.el (menu-or-popup-active-p): New function
declaration.
(tooltip-show-help): Don't use tooltips on Haiku when a
menu is active.
* lisp/version.el (haiku-get-version-string): New
function declaration.
(emacs-version): Add Haiku version string if
appropriate.
* src/Makefile.in: Also produce binary named "Emacs"
with Haiku resources set.
(CXX, HAIKU_OBJ, HAIKU_CXX_OBJ, HAIKU_LIBS)
(HAIKU_CFLAGS, HAVE_BE_APP, NON_CXX_FLAGS)
(ALL_CXX_FLAGS): New variables.
(.SUFFIXES): Add .cc.
(.cc.o): New target.
(base_obj): Add Haiku C objects.
(doc_obj, obj): Split objects that should scanned for
documentation into doc_obj.
(SOME_MACHINE_OBJECTS): Add appropriate Haiku C objects.
(all): Depend on Emacs and Emacs.pdmp on Haiku.
(LIBES): Add Haiku libraries.
(gl-stamp)
($(etc)/DOC): Scan doc_obj instead of obj
(temacs$(EXEEXT): Use C++ linker on Haiku.
(ctagsfiles3): New variable.
(TAGS): Scan C++ files.
* src/alloc.c (garbage_collect): Mark Haiku display.
* src/dispextern.h (HAVE_NATIVE_TRANSFORMS): Also enable
on Haiku.
(struct image): Add fields for Haiku transforms.
(RGB_PIXEL_COLOR): Define to unsigned long on Haiku as
well.
(sit_for): Also check USABLE_SIGPOLL.
(init_display_interactive): Set initial window system to
Haiku on Haiku builds.
* src/emacs.c (main): Define Haiku syms and init haiku
clipboard.
(shut_down_emacs): Quit BApplication on Haiku and
trigger debug
on aborts if haiku_debug_on_fatal_error.
(Vsystem_type): Update docstring.
* src/fileio.c (next-read-file-uses-dialog-p): Enable on
Haiku.
* src/filelock.c (WTMP_FILE): Only define if BOOT_TIME
is also defined.
* src/floatfns.c (double_integer_scale): Work around
Haiku libroot brain damage.
* src/font.c (syms_of_font): Define appropriate font
driver symbols for Haiku builds with various options.
* src/font.h: Also enable ftcrfont on Haiku builds with
Cairo.
(font_data_structures_may_be_ill_formed): Also enable on
Haiku builds that have Cairo.
* src/frame.c (Fframep): Update doc-string for Haiku
builds and return haiku if appropriate.
(syms_of_frame): New symbol `haiku'.
* src/frame.h (struct frame): Add output data for Haiku.
(FRAME_HAIKU_P): New macro.
(FRAME_WINDOW_P): Test for Haiku frames as well.
* src/ftcrfont.c (RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG): New macros.
(ftcrfont_draw): Add haiku specific code for Haiku
builds with Cairo.
* src/ftfont.c (ftfont_open): Set face.
(ftfont_has_char, ftfont_text_extents): Work around
crash.
(syms_of_ftfont): New symbol `mono'.
* src/ftfont.h (struct font_info): Enable Cairo-specific
fields for Cairo builds on Haiku.
* src/haiku_draw_support.cc:
* src/haiku_font_support.cc:
* src/haiku_io.c:
* src/haiku_select.cc:
* src/haiku_support.cc:
* src/haiku_support.h:
* src/haikufns.c:
* src/haikufont.c:
* src/haikugui.h:
* src/haikuimage.c:
* src/haikumenu.c:
* src/haikuselect.c:
* src/haikuselect.h:
* src/haikuterm.c:
* src/haikuterm.h: Add new files for Haiku windowing
support.
* src/haiku.c: Add new files for Haiku operating system
support.
* src/image.c: Implement image transforms and native XPM
support
on Haiku.
(GET_PIXEL, PUT_PIXEL, NO_PIXMAP)
(PIX_MASK_RETAIN, PIX_MASK_DRAW)
(RGB_TO_ULONG, RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG, RED16_FROM_ULONG, GREEN16_FROM_ULONG)
(BLUE16_FROM_ULONG): Define to appropriate values on
Haiku.
(image_create_bitmap_from_data): Add Haiku support.
(image_create_bitmap_from_file): Add TODO on Haiku.
(free_bitmap_record): Free bitmap on Haiku.
(image_size_in_bytes): Implement for Haiku bitmaps.
(image_set_transform): Implement on Haiku.
(image_create_x_image_and_pixmap_1): Implement on Haiku,
24-bit or 1-bit only.
(image_destroy_x_image, image_get_x_image): Use correct
img and pixmap values on Haiku.
(lookup_rgb_color): Use correct macro on Haiku.
(image_to_emacs_colors): Implement on Haiku.
(image_disable_image): Disable on Haiku.
(image_can_use_native_api): Test for translator presence
on Haiku.
(native_image_load): Use translator on Haiku.
(imagemagick_load_image): Add Haiku-specific quirks.
(Fimage_transforms_p): Allow rotate90 on Haiku.
(image_types): Enable native XPM support on Haiku.
(syms_of_image): Enable XPM images on Haiku.
* src/keyboard.c (kbd_buffer_get_event)
(handle_async_input, handle_input_available_signal)
(handle_user_signal, Fset_input_interrupt_mode)
(init_keyboard): Check for USABLE_SIGPOLL along with
USABLE_SIGIO.
* src/lisp.h (pD): Work around broken Haiku headers.
(HAVE_EXT_MENU_BAR): Define on Haiku.
(handle_input_available_signal): Enable if we just have
SIGPOLL as well.
* src/menu.c (have_boxes): Return true on Haiku.
(single_menu_item): Enable toolkit menus on Haiku.
(find_and_call_menu_selection): Also enable on Haiku.
* src/process.c (keyboard_bit_set): Enable with only
usable SIGPOLL.
(wait_reading_process_output): Test for SIGPOLL as well
as SIGIO availability.
* src/sound.c (sound_perror, vox_open)
(vox_configure, vox_close): Enable for usable SIGPOLL as
well.
* src/sysdep.c (sys_subshell): Enable for usable SIGPOLL.
(reset_sigio): Make conditional on F_SETOWN.
(request_sigio, unrequest_sigio)
(emacs_sigaction_init): Also handle SIGPOLLs.
(init_sys_modes): Disable TCXONC usage on Haiku, as it
doesn't have any ttys other than pseudo ttys, which don't
support C-s/C-q flow control, and causes compiler warnings.
(speeds): Disable high speeds if HAVE_TINY_SPEED_T.
* src/termhooks.h (enum output_method): Add output_haiku.
(struct terminal): Add Haiku display info.
(TERMINAL_FONT_CACHE): Enable for Haiku.
* src/terminal.c (Fterminal_live_p): Return `haiku' if
appropriate.
* src/verbose.mk.in (AM_V_CXX, AM_V_CXXLD): New logging
variables.
* src/xdisp.c (redisplay_internal)
(note_mouse_highlight): Return on Haiku if a popup is activated.
(display_menu_bar): Return on Haiku if frame is a Haiku
frame.
* src/xfaces.c (GCGraphicsExposures): Enable correctly on Haiku.
(x_create_gc): Enable dummy GC code on Haiku.
* src/xfns.c (x-server-version, x-file-dialog): Add
Haiku specifics to doc strings.
* src/xterm.c (syms_of_xterm): Add Haiku information to
doc string.
2021-11-20 13:30:08 +00:00
|
|
|
|
(declare-function haiku-set-mouse-absolute-pixel-position "haikufns.c" (x y))
|
2015-08-21 09:00:59 +00:00
|
|
|
|
|
|
|
|
|
(defun set-mouse-absolute-pixel-position (x y)
|
|
|
|
|
"Move mouse pointer to absolute pixel position (X, Y).
|
|
|
|
|
The coordinates X and Y are interpreted in pixels relative to a
|
|
|
|
|
position (0, 0) of the selected frame's terminal."
|
|
|
|
|
(let ((frame-type (framep-on-display)))
|
|
|
|
|
(cond
|
2017-05-18 19:31:46 +00:00
|
|
|
|
((eq frame-type 'ns)
|
|
|
|
|
(ns-set-mouse-absolute-pixel-position x y))
|
2015-08-21 09:00:59 +00:00
|
|
|
|
((eq frame-type 'x)
|
|
|
|
|
(x-set-mouse-absolute-pixel-position x y))
|
|
|
|
|
((eq frame-type 'w32)
|
Add support for the Haiku operating system and its window system
* .gitignore: Add binaries specific to Haiku.
* Makefie.in (HAVE_BE_APP): New variable.
(install-arch-dep): Install Emacs and Emacs.pdmp when
using Haiku.
* configure.ac: Detect and configure for Haiku and
various related configurations.
(be-app, be-freetype, be-cairo): New options.
(HAVE_BE_APP, HAIKU_OBJ, HAIKU_CXX_OBJ)
(HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(HAIKU, HAVE_TINY_SPEED_T): New define.
(emacs_config_features): Add BE_APP.
* doc/emacs/Makefile.in (EMACSSOURCES): Add Haiku
appendix.
* doc/emacs/emacs.texi: Add Haiku appendix to menus and
include it.
* doc/emacs/haiku.texi: New Haiku appendix.
* doc/lispref/display.texi (Defining Faces, Window Systems):
Explain meaning of `haiku' as a window system identifier.
(haiku-use-system-tooltips): Explain meaning of system
tooltips on
Haiku.
* doc/lispref/frames.texi (Multiple Terminals): Explain
meaning of haiku as a display type.
(Frame Layout): Clarify section for Haiku frames.
(Size Parameters): Explain limitations of fullwidth and
fullheight on Haiku.
(Management Parameters): Explain limitations of
inhibiting double buffering on builds with Cairo,
and the inability of frames with no-accept-focus to
receive keyboard input on Haiku.
(Font and Color Parameters): Explain the different font
backends available on Haiku.
(Raising and Lowering): Explain that lowering and
restacking frames doesn't work on Haiku.
(Child Frames): Explain oddities of child frame
visibility on Haiku.
* doc/lispref/os.texi (System Environment): Explain
meaning of haiku.
* etc/MACHINES: Add appropriate notices for Haiku.
* etc/NEWS: Document changes.
* etc/PROBLEMS: Document font spacing bug on Haiku.
* lib-src/Makefile.in: Build be-resources binary on
Haiku.
(CXX, CXXFLAGS, NON_CXX_FLAGS, ALL_CXXFLAGS)
(HAVE_BE_APP, HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(DONT_INSTALL): Add be-resources binary if on Haiku.
(be-resources): New target.
* lib-src/be_resources: Add helper binary for setting
resources on the Emacs application.
* lib-src/emacsclient.c (decode_options): Set
alt_display to "be" on Haiku.
* lisp/cus-edit.el (custom-button, custom-button-mouse)
(custom-button-unraised, custom-button-pressed): Update
face definitions for Haiku.
* lisp/cus-start.el: Add haiku-debug-on-fatal-error and
haiku-use-system-tooltips.
* lisp/faces.el (face-valid-attribute-values): Clarify
attribute comment for Haiku.
(tool-bar): Add appropriate toolbar color for Haiku.
* lisp/frame.el (haiku-frame-geometry)
(haiku-mouse-absolute-pixel-position)
(haiku-set-mouse-absolute-pixel-position)
(haiku-frame-edges)
(haiku-frame-list-z-order): New function declarations.
(frame-geometry, frame-edges)
(mouse-absolute-pixel-position)
(set-mouse-absolute-pixel-position)
(frame-list-z-order): Call appropriate window system
functions on Haiku.
(display-mouse-p, display-graphic-p)
(display-images-p, display-pixel-height)
(display-pixel-width, display-mm-height)
(display-mm-width, display-backing-store)
(display-save-under, display-planes)
(display-color-cells, display-visual-class): Update type
tests for Haiku.
* lisp/international/mule-cmds.el
(set-coding-system-map): Also
prevent set-terminal-coding-system from appearing in the menu
bar on Haiku.
* lisp/loadup.el: Load Haiku-specific files when built
with Haiku, and don't rename newly built Emacs on Haiku as BFS
doesn't support hard links.
* lisp/menu-bar.el (menu-bar-open): Add for Haiku.
* lisp/mwheel.el (mouse-wheel-down-event): Expect
wheel-up on Haiku.
(mouse-wheel-up-event): Expect wheel-down on Haiku.
(mouse-wheel-left-event): Expect wheel-left on Haiku.
(mouse-wheel-right-event): Expect wheel-right on Haiku.
* lisp/net/browse-url.el
(browse-url--browser-defcustom-type):
Add option for WebPositive.
(browse-url-webpositive-program): New variable.
(browse-url-default-program): Search for WebPositive.
(browse-url-webpositive): New function.
* lisp/net/eww.el (eww-form-submit, eww-form-file)
(eww-form-checkbox, eww-form-select): Define faces
appropriately for Haiku.
* lisp/term/haiku-win.el: New file.
* lisp/tooltip.el (menu-or-popup-active-p): New function
declaration.
(tooltip-show-help): Don't use tooltips on Haiku when a
menu is active.
* lisp/version.el (haiku-get-version-string): New
function declaration.
(emacs-version): Add Haiku version string if
appropriate.
* src/Makefile.in: Also produce binary named "Emacs"
with Haiku resources set.
(CXX, HAIKU_OBJ, HAIKU_CXX_OBJ, HAIKU_LIBS)
(HAIKU_CFLAGS, HAVE_BE_APP, NON_CXX_FLAGS)
(ALL_CXX_FLAGS): New variables.
(.SUFFIXES): Add .cc.
(.cc.o): New target.
(base_obj): Add Haiku C objects.
(doc_obj, obj): Split objects that should scanned for
documentation into doc_obj.
(SOME_MACHINE_OBJECTS): Add appropriate Haiku C objects.
(all): Depend on Emacs and Emacs.pdmp on Haiku.
(LIBES): Add Haiku libraries.
(gl-stamp)
($(etc)/DOC): Scan doc_obj instead of obj
(temacs$(EXEEXT): Use C++ linker on Haiku.
(ctagsfiles3): New variable.
(TAGS): Scan C++ files.
* src/alloc.c (garbage_collect): Mark Haiku display.
* src/dispextern.h (HAVE_NATIVE_TRANSFORMS): Also enable
on Haiku.
(struct image): Add fields for Haiku transforms.
(RGB_PIXEL_COLOR): Define to unsigned long on Haiku as
well.
(sit_for): Also check USABLE_SIGPOLL.
(init_display_interactive): Set initial window system to
Haiku on Haiku builds.
* src/emacs.c (main): Define Haiku syms and init haiku
clipboard.
(shut_down_emacs): Quit BApplication on Haiku and
trigger debug
on aborts if haiku_debug_on_fatal_error.
(Vsystem_type): Update docstring.
* src/fileio.c (next-read-file-uses-dialog-p): Enable on
Haiku.
* src/filelock.c (WTMP_FILE): Only define if BOOT_TIME
is also defined.
* src/floatfns.c (double_integer_scale): Work around
Haiku libroot brain damage.
* src/font.c (syms_of_font): Define appropriate font
driver symbols for Haiku builds with various options.
* src/font.h: Also enable ftcrfont on Haiku builds with
Cairo.
(font_data_structures_may_be_ill_formed): Also enable on
Haiku builds that have Cairo.
* src/frame.c (Fframep): Update doc-string for Haiku
builds and return haiku if appropriate.
(syms_of_frame): New symbol `haiku'.
* src/frame.h (struct frame): Add output data for Haiku.
(FRAME_HAIKU_P): New macro.
(FRAME_WINDOW_P): Test for Haiku frames as well.
* src/ftcrfont.c (RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG): New macros.
(ftcrfont_draw): Add haiku specific code for Haiku
builds with Cairo.
* src/ftfont.c (ftfont_open): Set face.
(ftfont_has_char, ftfont_text_extents): Work around
crash.
(syms_of_ftfont): New symbol `mono'.
* src/ftfont.h (struct font_info): Enable Cairo-specific
fields for Cairo builds on Haiku.
* src/haiku_draw_support.cc:
* src/haiku_font_support.cc:
* src/haiku_io.c:
* src/haiku_select.cc:
* src/haiku_support.cc:
* src/haiku_support.h:
* src/haikufns.c:
* src/haikufont.c:
* src/haikugui.h:
* src/haikuimage.c:
* src/haikumenu.c:
* src/haikuselect.c:
* src/haikuselect.h:
* src/haikuterm.c:
* src/haikuterm.h: Add new files for Haiku windowing
support.
* src/haiku.c: Add new files for Haiku operating system
support.
* src/image.c: Implement image transforms and native XPM
support
on Haiku.
(GET_PIXEL, PUT_PIXEL, NO_PIXMAP)
(PIX_MASK_RETAIN, PIX_MASK_DRAW)
(RGB_TO_ULONG, RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG, RED16_FROM_ULONG, GREEN16_FROM_ULONG)
(BLUE16_FROM_ULONG): Define to appropriate values on
Haiku.
(image_create_bitmap_from_data): Add Haiku support.
(image_create_bitmap_from_file): Add TODO on Haiku.
(free_bitmap_record): Free bitmap on Haiku.
(image_size_in_bytes): Implement for Haiku bitmaps.
(image_set_transform): Implement on Haiku.
(image_create_x_image_and_pixmap_1): Implement on Haiku,
24-bit or 1-bit only.
(image_destroy_x_image, image_get_x_image): Use correct
img and pixmap values on Haiku.
(lookup_rgb_color): Use correct macro on Haiku.
(image_to_emacs_colors): Implement on Haiku.
(image_disable_image): Disable on Haiku.
(image_can_use_native_api): Test for translator presence
on Haiku.
(native_image_load): Use translator on Haiku.
(imagemagick_load_image): Add Haiku-specific quirks.
(Fimage_transforms_p): Allow rotate90 on Haiku.
(image_types): Enable native XPM support on Haiku.
(syms_of_image): Enable XPM images on Haiku.
* src/keyboard.c (kbd_buffer_get_event)
(handle_async_input, handle_input_available_signal)
(handle_user_signal, Fset_input_interrupt_mode)
(init_keyboard): Check for USABLE_SIGPOLL along with
USABLE_SIGIO.
* src/lisp.h (pD): Work around broken Haiku headers.
(HAVE_EXT_MENU_BAR): Define on Haiku.
(handle_input_available_signal): Enable if we just have
SIGPOLL as well.
* src/menu.c (have_boxes): Return true on Haiku.
(single_menu_item): Enable toolkit menus on Haiku.
(find_and_call_menu_selection): Also enable on Haiku.
* src/process.c (keyboard_bit_set): Enable with only
usable SIGPOLL.
(wait_reading_process_output): Test for SIGPOLL as well
as SIGIO availability.
* src/sound.c (sound_perror, vox_open)
(vox_configure, vox_close): Enable for usable SIGPOLL as
well.
* src/sysdep.c (sys_subshell): Enable for usable SIGPOLL.
(reset_sigio): Make conditional on F_SETOWN.
(request_sigio, unrequest_sigio)
(emacs_sigaction_init): Also handle SIGPOLLs.
(init_sys_modes): Disable TCXONC usage on Haiku, as it
doesn't have any ttys other than pseudo ttys, which don't
support C-s/C-q flow control, and causes compiler warnings.
(speeds): Disable high speeds if HAVE_TINY_SPEED_T.
* src/termhooks.h (enum output_method): Add output_haiku.
(struct terminal): Add Haiku display info.
(TERMINAL_FONT_CACHE): Enable for Haiku.
* src/terminal.c (Fterminal_live_p): Return `haiku' if
appropriate.
* src/verbose.mk.in (AM_V_CXX, AM_V_CXXLD): New logging
variables.
* src/xdisp.c (redisplay_internal)
(note_mouse_highlight): Return on Haiku if a popup is activated.
(display_menu_bar): Return on Haiku if frame is a Haiku
frame.
* src/xfaces.c (GCGraphicsExposures): Enable correctly on Haiku.
(x_create_gc): Enable dummy GC code on Haiku.
* src/xfns.c (x-server-version, x-file-dialog): Add
Haiku specifics to doc strings.
* src/xterm.c (syms_of_xterm): Add Haiku information to
doc string.
2021-11-20 13:30:08 +00:00
|
|
|
|
(w32-set-mouse-absolute-pixel-position x y))
|
|
|
|
|
((eq frame-type 'haiku)
|
|
|
|
|
(haiku-set-mouse-absolute-pixel-position x y)))))
|
2015-08-19 09:20:44 +00:00
|
|
|
|
|
2013-05-07 01:12:22 +00:00
|
|
|
|
(defun frame-monitor-attributes (&optional frame)
|
|
|
|
|
"Return the attributes of the physical monitor dominating FRAME.
|
2014-10-04 03:03:52 +00:00
|
|
|
|
If FRAME is omitted or nil, describe the currently selected frame.
|
2013-05-07 01:12:22 +00:00
|
|
|
|
|
|
|
|
|
A frame is dominated by a physical monitor when either the
|
|
|
|
|
largest area of the frame resides in the monitor, or the monitor
|
|
|
|
|
is the closest to the frame if the frame does not intersect any
|
|
|
|
|
physical monitors.
|
|
|
|
|
|
|
|
|
|
See `display-monitor-attributes-list' for the list of attribute
|
|
|
|
|
keys and their meanings."
|
|
|
|
|
(or frame (setq frame (selected-frame)))
|
|
|
|
|
(cl-loop for attributes in (display-monitor-attributes-list frame)
|
|
|
|
|
for frames = (cdr (assq 'frames attributes))
|
2019-03-19 21:43:18 +00:00
|
|
|
|
if (memq frame frames) return attributes
|
|
|
|
|
;; On broken frames monitor attributes,
|
|
|
|
|
;; fall back to the last monitor.
|
|
|
|
|
finally return attributes))
|
2013-05-07 01:12:22 +00:00
|
|
|
|
|
2017-06-10 09:28:03 +00:00
|
|
|
|
(defun frame-monitor-attribute (attribute &optional frame x y)
|
|
|
|
|
"Return the value of ATTRIBUTE on FRAME's monitor.
|
|
|
|
|
If FRAME is omitted or nil, use currently selected frame.
|
|
|
|
|
|
|
|
|
|
By default, the current monitor is the physical monitor
|
|
|
|
|
dominating the selected frame. A frame is dominated by a
|
|
|
|
|
physical monitor when either the largest area of the frame
|
|
|
|
|
resides in the monitor, or the monitor is the closest to the
|
|
|
|
|
frame if the frame does not intersect any physical monitors.
|
|
|
|
|
|
|
|
|
|
If X and Y are both numbers, then ignore the value of FRAME; the
|
|
|
|
|
monitor is determined to be the physical monitor that contains
|
|
|
|
|
the pixel coordinate (X, Y).
|
|
|
|
|
|
|
|
|
|
See `display-monitor-attributes-list' for the list of attribute
|
|
|
|
|
keys and their meanings."
|
|
|
|
|
(if (and (numberp x)
|
|
|
|
|
(numberp y))
|
|
|
|
|
(cl-loop for monitor in (display-monitor-attributes-list)
|
|
|
|
|
for geometry = (alist-get 'geometry monitor)
|
|
|
|
|
for min-x = (pop geometry)
|
|
|
|
|
for min-y = (pop geometry)
|
|
|
|
|
for max-x = (+ min-x (pop geometry))
|
|
|
|
|
for max-y = (+ min-y (car geometry))
|
|
|
|
|
when (and (<= min-x x)
|
|
|
|
|
(< x max-x)
|
|
|
|
|
(<= min-y y)
|
|
|
|
|
(< y max-y))
|
|
|
|
|
return (alist-get attribute monitor))
|
|
|
|
|
(alist-get attribute (frame-monitor-attributes frame))))
|
|
|
|
|
|
|
|
|
|
(defun frame-monitor-geometry (&optional frame x y)
|
|
|
|
|
"Return the geometry of FRAME's monitor.
|
|
|
|
|
FRAME can be a frame name, a terminal name, or a frame.
|
|
|
|
|
If FRAME is omitted or nil, use the currently selected frame.
|
|
|
|
|
|
|
|
|
|
By default, the current monitor is said to be the physical
|
2017-06-10 18:44:27 +00:00
|
|
|
|
monitor dominating the selected frame. A frame is dominated by
|
2017-06-10 09:28:03 +00:00
|
|
|
|
a physical monitor when either the largest area of the frame resides
|
|
|
|
|
in the monitor, or the monitor is the closest to the frame if the
|
|
|
|
|
frame does not intersect any physical monitors.
|
|
|
|
|
|
|
|
|
|
If X and Y are both numbers, then ignore the value of FRAME; the
|
|
|
|
|
monitor is determined to be the physical monitor that contains
|
|
|
|
|
the pixel coordinate (X, Y).
|
|
|
|
|
|
|
|
|
|
See `display-monitor-attributes-list' for information on the
|
|
|
|
|
geometry attribute."
|
|
|
|
|
(frame-monitor-attribute 'geometry frame x y))
|
|
|
|
|
|
|
|
|
|
(defun frame-monitor-workarea (&optional frame x y)
|
|
|
|
|
"Return the workarea of FRAME's monitor.
|
|
|
|
|
FRAME can be a frame name, a terminal name, or a frame.
|
|
|
|
|
If FRAME is omitted or nil, use currently selected frame.
|
|
|
|
|
|
|
|
|
|
By default, the current monitor is said to be the physical
|
|
|
|
|
monitor dominating the selected frame. A frame is dominated by
|
|
|
|
|
a physical monitor when either the largest area of the frame resides
|
|
|
|
|
in the monitor, or the monitor is the closest to the frame if the
|
|
|
|
|
frame does not intersect any physical monitors.
|
|
|
|
|
|
|
|
|
|
If X and Y are both numbers, then ignore the value of FRAME; the
|
|
|
|
|
monitor is determined to be the physical monitor that contains
|
|
|
|
|
the pixel coordinate (X, Y).
|
|
|
|
|
|
|
|
|
|
See `display-monitor-attributes-list' for information on the
|
|
|
|
|
workarea attribute."
|
|
|
|
|
(frame-monitor-attribute 'workarea frame x y))
|
|
|
|
|
|
Add new frame parameters and associated functions
Add new frame parameters `undecorated', `override-redirect',
`parent-frame', `skip-taskbar', `no-focus-on-map',
`no-accept-focus', `z-group', `delete-before', `no-other-frame',
`mouse-wheel-frame', `min-width', `min-height'. Add new
functions `frame-restack' and `frame-list-z-order'.
* lisp/cus-start.el (focus-follows-mouse): Adapt customization
type.
* lisp/frame.el (handle-delete-frame): Handle child and
`delete-before' frames.
(other-frame): Stop looking for other frame after one round.
(frame-list-z-order, frame-restack): New functions.
(delete-other-frames): Handle child frames.
* lisp/frameset.el (frameset-persistent-filter-alist)
(frameset--record-relationships): Handle `delete-before',
`parent-frame' and `mouse-wheel-frame' parameters. Rename
latter from `frameset--record-minibuffer-relationships'.
(frameset--restore-frame): Handle ‘parent-frame’ parameter
specially.
(frameset-restore): Handle `delete-before', `parent-frame' and
`mouse-wheel-frame' parameters.
* lisp/mwheel.el (mwheel-scroll): Handle `mouse-wheel-frame'
parameter.
* lisp/window.el (window--min-size-ignore-p): Fix doc-string.
(mouse-autoselect-window-select, handle-select-window): Major
rewrite. Try to not ignore errors. Handle auto-selection of
child frames and different values of `focus-follows-mouse'.
* src/frame.c (frame_windows_min_size): Handle new `min-width'
and `min-height' frame parameters.
(make_frame): Initialize new frame structure members.
(do_switch_frame): Don't reset internal_last_event_frame for
descendant frames.
(Fframe_parent, frame_ancestor_p, Fframe_ancestor_p): New
functions.
(candidate_frame): Don't return `no-other-frame' frame.
(other_frames): New function replacing other_visible_frames.
(delete_frame): Rewrite. Handle child and `delete-before' frames.
(Fmake_frame_invisible): Call other_frames.
(store_frame_param): Check `delete-before' and `parent-frame'
parameters for circular dependencies.
(frame_parms, syms_of_frame): Add entries for and define new
frame parameters.
(focus_follows_mouse): New meaningful value `auto-raise'.
* src/frame.h (z_group): New enumeration type.
(frame): New slots parent_frame, undecorated, override_redirect,
skip_taskbar, no_focus_on_map, no_accept_focus, z_group.
(fset_parent_frame): New inlined function.
(FRAME_UNDECORATED, FRAME_OVERRIDE_REDIRECT)
(FRAME_PARENT_FRAME, FRAME_SKIP_TASKBAR, FRAME_NO_FOCUS_ON_MAP)
(FRAME_NO_ACCEPT_FOCUS, FRAME_Z_GROUP, FRAME_Z_GROUP_NONE)
(FRAME_Z_GROUP_ABOVE, FRAME_Z_GROUP_ABOVE_SUSPENDED)
(FRAME_Z_GROUP_BELOW): New macros.
(frame_ancestor_p): Add declaration.
* src/gtkutil.c (xg_create_frame_widgets): Handle
`undecorated' and `override-redirect' frame parameters.
(x_wm_set_size_hint): None for child frames.
(xg_set_undecorated, xg_frame_restack, xg_set_skip_taskbar)
(xg_set_no_focus_on_map, xg_set_no_accept_focus)
(xg_set_override_redirect): New functions.
(xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos):
Don't let scrollbars obscure child frames.
* src/gtkutil.h: (xg_set_undecorated, xg_frame_restack)
(xg_set_skip_taskbar, xg_set_no_focus_on_map)
(xg_set_no_accept_focus, xg_set_override_redirect): Add extern
declarations.
* src/nsfns.m (ns_frame_parm_handlers): Add entries for new
frame parameters.
(Fx_create_frame): Install `min-width' and `min-height' frame
parameters.
* src/nsterm.m (mouseMoved:): Handle focus_follows_mouse change.
* src/w32fns.c (WS_EX_NOACTIVATE): Define if necessary.
(x_real_positions): Handle child frames.
(x_set_menu_bar_lines): Don't for child frames.
(x_set_undecorated, x_set_parent_frame, x_set_skip_taskbar)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_z_group): New functions.
(w32_createvscrollbar, w32_createhscrollbar): Don't draw
scroll bars over child frames.
(w32_createwindow): Handle new frame parameters and child frames.
(w32_wnd_proc): Let mouse clicks into a child frame activate
the frame. Try to handle the `no-accept-focus' parameter. Do
SetFocus when our window is brought to top or becomes the
foreground window.
(w32_window): Don't initialize menu bar for child frames.
(Fx_create_frame): Handle new frame parameters.
(x_create_tip_frame): Set explicit_parent slot.
(w32_dialog_in_progress): New function.
(Fx_file_dialog): Handle `z-group-above' frames.
(w32_frame_list_z_order, Fw32_frame_list_z_order)
(w32_frame_restack, Fw32_frame_restack): New functions.
(w32_frame_parm_handlers): Add entries for new frame
parameters.
* src/w32font.c (Fx_select_font): Handle `z-group-above'
frames during font selection dialogue.
* src/w32term.c (construct_mouse_wheel): Construct mouse wheel
event from F's w32 window.
(w32_mouse_position): Handle child frames.
(w32_set_vertical_scroll_bar, w32_set_horizontal_scroll_bar):
Don't draw scroll bars over child frames.
(w32_read_socket): Always erase background of child frames.
When generating SELECT_WINDOW_EVENTs handle new value of
`focus-follows-mouse' and handle `no-accept-focus' parameter.
Handle `mouse-wheel-frame' parameter.
(x_calc_absolute_position, x_set_offset, x_set_window_size):
Handle child frames.
(x_make_frame_visible): Handle child frames specially. Handle
`no-focus-on-map' parameter.
* src/w32term.h (w32_dialog_in_progress): Add external
declaration.
* src/xdisp.c (x_consider_frame_title, prepare_menu_bars): Not
for child frames.
* src/xfns.c (Xm/MwmUtil.h): Include for WM hints.
(PropMotifWmHints, PROP_MOTIF_WM_HINTS_ELEMENTS): Define for
non-Motif, non-GTK case.
(x_real_pos_and_offsets): Handle child frames.
(x_set_undecorated, x_set_parent_frame)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_override_redirect): New functions.
(x_set_menu_bar_lines): Not for child frames.
(x_window): Handle `undecorated' and `override_redirect' cases.
(Fx_create_frame): Handle new frame parameters.
(frame_geometry): Handle child frames and outer border.
(x_frame_list_z_order, Fx_frame_list_z_order)
(x_frame_restack, Fx_frame_restack): New functions.
(Fx_file_dialog, Fx_select_font): Set x_menu_set_in_use.
(x_frame_parm_handlers): Add entries for new frame parameters.
* src/xmenu.c (x_menu_set_in_use): Handle `z-group-above'
frames.
* src/xterm.c (x_set_frame_alpha): Don't set alpha of parent
for child frames.
(XTmouse_position): Handle child frames.
(x_scroll_bar_create, x_scroll_bar_expose): Don't let scroll
bars obscure child frames.
(handle_one_xevent): Handle child frame positions. If necessary
set `skip-taskbar' and reassign proper `z-group' when we are
mapped. When generating SELECT_WINDOW_EVENTs handle new value
of `focus-follows-mouse'. Handle `mouse-wheel-frame' parameter.
Let mouse clicks into a child frame activate the frame.
(x_calc_absolute_position, x_set_offset): Handle child frames
specially.
(x_set_skip_taskbar, x_set_z_group): New functions.
(x_make_frame_visible): Handle child frames.
(ATOM_REFS_INIT): Add entries for
Xatom_net_wm_state_skip_taskbar, Xatom_net_wm_state_above,
Xatom_net_wm_state_below.
* src/xterm.h (top-level): Declare Xatom_net_wm_state_above,
Xatom_net_wm_state_below and Xatom_net_wm_state_skip_taskbar.
(x_set_skip_taskbar, x_set_z_group): Add extern declarations.
2017-04-12 08:38:25 +00:00
|
|
|
|
(declare-function x-frame-list-z-order "xfns.c" (&optional display))
|
|
|
|
|
(declare-function w32-frame-list-z-order "w32fns.c" (&optional display))
|
2017-04-20 14:25:56 +00:00
|
|
|
|
(declare-function ns-frame-list-z-order "nsfns.m" (&optional display))
|
Add support for the Haiku operating system and its window system
* .gitignore: Add binaries specific to Haiku.
* Makefie.in (HAVE_BE_APP): New variable.
(install-arch-dep): Install Emacs and Emacs.pdmp when
using Haiku.
* configure.ac: Detect and configure for Haiku and
various related configurations.
(be-app, be-freetype, be-cairo): New options.
(HAVE_BE_APP, HAIKU_OBJ, HAIKU_CXX_OBJ)
(HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(HAIKU, HAVE_TINY_SPEED_T): New define.
(emacs_config_features): Add BE_APP.
* doc/emacs/Makefile.in (EMACSSOURCES): Add Haiku
appendix.
* doc/emacs/emacs.texi: Add Haiku appendix to menus and
include it.
* doc/emacs/haiku.texi: New Haiku appendix.
* doc/lispref/display.texi (Defining Faces, Window Systems):
Explain meaning of `haiku' as a window system identifier.
(haiku-use-system-tooltips): Explain meaning of system
tooltips on
Haiku.
* doc/lispref/frames.texi (Multiple Terminals): Explain
meaning of haiku as a display type.
(Frame Layout): Clarify section for Haiku frames.
(Size Parameters): Explain limitations of fullwidth and
fullheight on Haiku.
(Management Parameters): Explain limitations of
inhibiting double buffering on builds with Cairo,
and the inability of frames with no-accept-focus to
receive keyboard input on Haiku.
(Font and Color Parameters): Explain the different font
backends available on Haiku.
(Raising and Lowering): Explain that lowering and
restacking frames doesn't work on Haiku.
(Child Frames): Explain oddities of child frame
visibility on Haiku.
* doc/lispref/os.texi (System Environment): Explain
meaning of haiku.
* etc/MACHINES: Add appropriate notices for Haiku.
* etc/NEWS: Document changes.
* etc/PROBLEMS: Document font spacing bug on Haiku.
* lib-src/Makefile.in: Build be-resources binary on
Haiku.
(CXX, CXXFLAGS, NON_CXX_FLAGS, ALL_CXXFLAGS)
(HAVE_BE_APP, HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(DONT_INSTALL): Add be-resources binary if on Haiku.
(be-resources): New target.
* lib-src/be_resources: Add helper binary for setting
resources on the Emacs application.
* lib-src/emacsclient.c (decode_options): Set
alt_display to "be" on Haiku.
* lisp/cus-edit.el (custom-button, custom-button-mouse)
(custom-button-unraised, custom-button-pressed): Update
face definitions for Haiku.
* lisp/cus-start.el: Add haiku-debug-on-fatal-error and
haiku-use-system-tooltips.
* lisp/faces.el (face-valid-attribute-values): Clarify
attribute comment for Haiku.
(tool-bar): Add appropriate toolbar color for Haiku.
* lisp/frame.el (haiku-frame-geometry)
(haiku-mouse-absolute-pixel-position)
(haiku-set-mouse-absolute-pixel-position)
(haiku-frame-edges)
(haiku-frame-list-z-order): New function declarations.
(frame-geometry, frame-edges)
(mouse-absolute-pixel-position)
(set-mouse-absolute-pixel-position)
(frame-list-z-order): Call appropriate window system
functions on Haiku.
(display-mouse-p, display-graphic-p)
(display-images-p, display-pixel-height)
(display-pixel-width, display-mm-height)
(display-mm-width, display-backing-store)
(display-save-under, display-planes)
(display-color-cells, display-visual-class): Update type
tests for Haiku.
* lisp/international/mule-cmds.el
(set-coding-system-map): Also
prevent set-terminal-coding-system from appearing in the menu
bar on Haiku.
* lisp/loadup.el: Load Haiku-specific files when built
with Haiku, and don't rename newly built Emacs on Haiku as BFS
doesn't support hard links.
* lisp/menu-bar.el (menu-bar-open): Add for Haiku.
* lisp/mwheel.el (mouse-wheel-down-event): Expect
wheel-up on Haiku.
(mouse-wheel-up-event): Expect wheel-down on Haiku.
(mouse-wheel-left-event): Expect wheel-left on Haiku.
(mouse-wheel-right-event): Expect wheel-right on Haiku.
* lisp/net/browse-url.el
(browse-url--browser-defcustom-type):
Add option for WebPositive.
(browse-url-webpositive-program): New variable.
(browse-url-default-program): Search for WebPositive.
(browse-url-webpositive): New function.
* lisp/net/eww.el (eww-form-submit, eww-form-file)
(eww-form-checkbox, eww-form-select): Define faces
appropriately for Haiku.
* lisp/term/haiku-win.el: New file.
* lisp/tooltip.el (menu-or-popup-active-p): New function
declaration.
(tooltip-show-help): Don't use tooltips on Haiku when a
menu is active.
* lisp/version.el (haiku-get-version-string): New
function declaration.
(emacs-version): Add Haiku version string if
appropriate.
* src/Makefile.in: Also produce binary named "Emacs"
with Haiku resources set.
(CXX, HAIKU_OBJ, HAIKU_CXX_OBJ, HAIKU_LIBS)
(HAIKU_CFLAGS, HAVE_BE_APP, NON_CXX_FLAGS)
(ALL_CXX_FLAGS): New variables.
(.SUFFIXES): Add .cc.
(.cc.o): New target.
(base_obj): Add Haiku C objects.
(doc_obj, obj): Split objects that should scanned for
documentation into doc_obj.
(SOME_MACHINE_OBJECTS): Add appropriate Haiku C objects.
(all): Depend on Emacs and Emacs.pdmp on Haiku.
(LIBES): Add Haiku libraries.
(gl-stamp)
($(etc)/DOC): Scan doc_obj instead of obj
(temacs$(EXEEXT): Use C++ linker on Haiku.
(ctagsfiles3): New variable.
(TAGS): Scan C++ files.
* src/alloc.c (garbage_collect): Mark Haiku display.
* src/dispextern.h (HAVE_NATIVE_TRANSFORMS): Also enable
on Haiku.
(struct image): Add fields for Haiku transforms.
(RGB_PIXEL_COLOR): Define to unsigned long on Haiku as
well.
(sit_for): Also check USABLE_SIGPOLL.
(init_display_interactive): Set initial window system to
Haiku on Haiku builds.
* src/emacs.c (main): Define Haiku syms and init haiku
clipboard.
(shut_down_emacs): Quit BApplication on Haiku and
trigger debug
on aborts if haiku_debug_on_fatal_error.
(Vsystem_type): Update docstring.
* src/fileio.c (next-read-file-uses-dialog-p): Enable on
Haiku.
* src/filelock.c (WTMP_FILE): Only define if BOOT_TIME
is also defined.
* src/floatfns.c (double_integer_scale): Work around
Haiku libroot brain damage.
* src/font.c (syms_of_font): Define appropriate font
driver symbols for Haiku builds with various options.
* src/font.h: Also enable ftcrfont on Haiku builds with
Cairo.
(font_data_structures_may_be_ill_formed): Also enable on
Haiku builds that have Cairo.
* src/frame.c (Fframep): Update doc-string for Haiku
builds and return haiku if appropriate.
(syms_of_frame): New symbol `haiku'.
* src/frame.h (struct frame): Add output data for Haiku.
(FRAME_HAIKU_P): New macro.
(FRAME_WINDOW_P): Test for Haiku frames as well.
* src/ftcrfont.c (RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG): New macros.
(ftcrfont_draw): Add haiku specific code for Haiku
builds with Cairo.
* src/ftfont.c (ftfont_open): Set face.
(ftfont_has_char, ftfont_text_extents): Work around
crash.
(syms_of_ftfont): New symbol `mono'.
* src/ftfont.h (struct font_info): Enable Cairo-specific
fields for Cairo builds on Haiku.
* src/haiku_draw_support.cc:
* src/haiku_font_support.cc:
* src/haiku_io.c:
* src/haiku_select.cc:
* src/haiku_support.cc:
* src/haiku_support.h:
* src/haikufns.c:
* src/haikufont.c:
* src/haikugui.h:
* src/haikuimage.c:
* src/haikumenu.c:
* src/haikuselect.c:
* src/haikuselect.h:
* src/haikuterm.c:
* src/haikuterm.h: Add new files for Haiku windowing
support.
* src/haiku.c: Add new files for Haiku operating system
support.
* src/image.c: Implement image transforms and native XPM
support
on Haiku.
(GET_PIXEL, PUT_PIXEL, NO_PIXMAP)
(PIX_MASK_RETAIN, PIX_MASK_DRAW)
(RGB_TO_ULONG, RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG, RED16_FROM_ULONG, GREEN16_FROM_ULONG)
(BLUE16_FROM_ULONG): Define to appropriate values on
Haiku.
(image_create_bitmap_from_data): Add Haiku support.
(image_create_bitmap_from_file): Add TODO on Haiku.
(free_bitmap_record): Free bitmap on Haiku.
(image_size_in_bytes): Implement for Haiku bitmaps.
(image_set_transform): Implement on Haiku.
(image_create_x_image_and_pixmap_1): Implement on Haiku,
24-bit or 1-bit only.
(image_destroy_x_image, image_get_x_image): Use correct
img and pixmap values on Haiku.
(lookup_rgb_color): Use correct macro on Haiku.
(image_to_emacs_colors): Implement on Haiku.
(image_disable_image): Disable on Haiku.
(image_can_use_native_api): Test for translator presence
on Haiku.
(native_image_load): Use translator on Haiku.
(imagemagick_load_image): Add Haiku-specific quirks.
(Fimage_transforms_p): Allow rotate90 on Haiku.
(image_types): Enable native XPM support on Haiku.
(syms_of_image): Enable XPM images on Haiku.
* src/keyboard.c (kbd_buffer_get_event)
(handle_async_input, handle_input_available_signal)
(handle_user_signal, Fset_input_interrupt_mode)
(init_keyboard): Check for USABLE_SIGPOLL along with
USABLE_SIGIO.
* src/lisp.h (pD): Work around broken Haiku headers.
(HAVE_EXT_MENU_BAR): Define on Haiku.
(handle_input_available_signal): Enable if we just have
SIGPOLL as well.
* src/menu.c (have_boxes): Return true on Haiku.
(single_menu_item): Enable toolkit menus on Haiku.
(find_and_call_menu_selection): Also enable on Haiku.
* src/process.c (keyboard_bit_set): Enable with only
usable SIGPOLL.
(wait_reading_process_output): Test for SIGPOLL as well
as SIGIO availability.
* src/sound.c (sound_perror, vox_open)
(vox_configure, vox_close): Enable for usable SIGPOLL as
well.
* src/sysdep.c (sys_subshell): Enable for usable SIGPOLL.
(reset_sigio): Make conditional on F_SETOWN.
(request_sigio, unrequest_sigio)
(emacs_sigaction_init): Also handle SIGPOLLs.
(init_sys_modes): Disable TCXONC usage on Haiku, as it
doesn't have any ttys other than pseudo ttys, which don't
support C-s/C-q flow control, and causes compiler warnings.
(speeds): Disable high speeds if HAVE_TINY_SPEED_T.
* src/termhooks.h (enum output_method): Add output_haiku.
(struct terminal): Add Haiku display info.
(TERMINAL_FONT_CACHE): Enable for Haiku.
* src/terminal.c (Fterminal_live_p): Return `haiku' if
appropriate.
* src/verbose.mk.in (AM_V_CXX, AM_V_CXXLD): New logging
variables.
* src/xdisp.c (redisplay_internal)
(note_mouse_highlight): Return on Haiku if a popup is activated.
(display_menu_bar): Return on Haiku if frame is a Haiku
frame.
* src/xfaces.c (GCGraphicsExposures): Enable correctly on Haiku.
(x_create_gc): Enable dummy GC code on Haiku.
* src/xfns.c (x-server-version, x-file-dialog): Add
Haiku specifics to doc strings.
* src/xterm.c (syms_of_xterm): Add Haiku information to
doc string.
2021-11-20 13:30:08 +00:00
|
|
|
|
(declare-function haiku-frame-list-z-order "haikufns.c" (&optional display))
|
Add new frame parameters and associated functions
Add new frame parameters `undecorated', `override-redirect',
`parent-frame', `skip-taskbar', `no-focus-on-map',
`no-accept-focus', `z-group', `delete-before', `no-other-frame',
`mouse-wheel-frame', `min-width', `min-height'. Add new
functions `frame-restack' and `frame-list-z-order'.
* lisp/cus-start.el (focus-follows-mouse): Adapt customization
type.
* lisp/frame.el (handle-delete-frame): Handle child and
`delete-before' frames.
(other-frame): Stop looking for other frame after one round.
(frame-list-z-order, frame-restack): New functions.
(delete-other-frames): Handle child frames.
* lisp/frameset.el (frameset-persistent-filter-alist)
(frameset--record-relationships): Handle `delete-before',
`parent-frame' and `mouse-wheel-frame' parameters. Rename
latter from `frameset--record-minibuffer-relationships'.
(frameset--restore-frame): Handle ‘parent-frame’ parameter
specially.
(frameset-restore): Handle `delete-before', `parent-frame' and
`mouse-wheel-frame' parameters.
* lisp/mwheel.el (mwheel-scroll): Handle `mouse-wheel-frame'
parameter.
* lisp/window.el (window--min-size-ignore-p): Fix doc-string.
(mouse-autoselect-window-select, handle-select-window): Major
rewrite. Try to not ignore errors. Handle auto-selection of
child frames and different values of `focus-follows-mouse'.
* src/frame.c (frame_windows_min_size): Handle new `min-width'
and `min-height' frame parameters.
(make_frame): Initialize new frame structure members.
(do_switch_frame): Don't reset internal_last_event_frame for
descendant frames.
(Fframe_parent, frame_ancestor_p, Fframe_ancestor_p): New
functions.
(candidate_frame): Don't return `no-other-frame' frame.
(other_frames): New function replacing other_visible_frames.
(delete_frame): Rewrite. Handle child and `delete-before' frames.
(Fmake_frame_invisible): Call other_frames.
(store_frame_param): Check `delete-before' and `parent-frame'
parameters for circular dependencies.
(frame_parms, syms_of_frame): Add entries for and define new
frame parameters.
(focus_follows_mouse): New meaningful value `auto-raise'.
* src/frame.h (z_group): New enumeration type.
(frame): New slots parent_frame, undecorated, override_redirect,
skip_taskbar, no_focus_on_map, no_accept_focus, z_group.
(fset_parent_frame): New inlined function.
(FRAME_UNDECORATED, FRAME_OVERRIDE_REDIRECT)
(FRAME_PARENT_FRAME, FRAME_SKIP_TASKBAR, FRAME_NO_FOCUS_ON_MAP)
(FRAME_NO_ACCEPT_FOCUS, FRAME_Z_GROUP, FRAME_Z_GROUP_NONE)
(FRAME_Z_GROUP_ABOVE, FRAME_Z_GROUP_ABOVE_SUSPENDED)
(FRAME_Z_GROUP_BELOW): New macros.
(frame_ancestor_p): Add declaration.
* src/gtkutil.c (xg_create_frame_widgets): Handle
`undecorated' and `override-redirect' frame parameters.
(x_wm_set_size_hint): None for child frames.
(xg_set_undecorated, xg_frame_restack, xg_set_skip_taskbar)
(xg_set_no_focus_on_map, xg_set_no_accept_focus)
(xg_set_override_redirect): New functions.
(xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos):
Don't let scrollbars obscure child frames.
* src/gtkutil.h: (xg_set_undecorated, xg_frame_restack)
(xg_set_skip_taskbar, xg_set_no_focus_on_map)
(xg_set_no_accept_focus, xg_set_override_redirect): Add extern
declarations.
* src/nsfns.m (ns_frame_parm_handlers): Add entries for new
frame parameters.
(Fx_create_frame): Install `min-width' and `min-height' frame
parameters.
* src/nsterm.m (mouseMoved:): Handle focus_follows_mouse change.
* src/w32fns.c (WS_EX_NOACTIVATE): Define if necessary.
(x_real_positions): Handle child frames.
(x_set_menu_bar_lines): Don't for child frames.
(x_set_undecorated, x_set_parent_frame, x_set_skip_taskbar)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_z_group): New functions.
(w32_createvscrollbar, w32_createhscrollbar): Don't draw
scroll bars over child frames.
(w32_createwindow): Handle new frame parameters and child frames.
(w32_wnd_proc): Let mouse clicks into a child frame activate
the frame. Try to handle the `no-accept-focus' parameter. Do
SetFocus when our window is brought to top or becomes the
foreground window.
(w32_window): Don't initialize menu bar for child frames.
(Fx_create_frame): Handle new frame parameters.
(x_create_tip_frame): Set explicit_parent slot.
(w32_dialog_in_progress): New function.
(Fx_file_dialog): Handle `z-group-above' frames.
(w32_frame_list_z_order, Fw32_frame_list_z_order)
(w32_frame_restack, Fw32_frame_restack): New functions.
(w32_frame_parm_handlers): Add entries for new frame
parameters.
* src/w32font.c (Fx_select_font): Handle `z-group-above'
frames during font selection dialogue.
* src/w32term.c (construct_mouse_wheel): Construct mouse wheel
event from F's w32 window.
(w32_mouse_position): Handle child frames.
(w32_set_vertical_scroll_bar, w32_set_horizontal_scroll_bar):
Don't draw scroll bars over child frames.
(w32_read_socket): Always erase background of child frames.
When generating SELECT_WINDOW_EVENTs handle new value of
`focus-follows-mouse' and handle `no-accept-focus' parameter.
Handle `mouse-wheel-frame' parameter.
(x_calc_absolute_position, x_set_offset, x_set_window_size):
Handle child frames.
(x_make_frame_visible): Handle child frames specially. Handle
`no-focus-on-map' parameter.
* src/w32term.h (w32_dialog_in_progress): Add external
declaration.
* src/xdisp.c (x_consider_frame_title, prepare_menu_bars): Not
for child frames.
* src/xfns.c (Xm/MwmUtil.h): Include for WM hints.
(PropMotifWmHints, PROP_MOTIF_WM_HINTS_ELEMENTS): Define for
non-Motif, non-GTK case.
(x_real_pos_and_offsets): Handle child frames.
(x_set_undecorated, x_set_parent_frame)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_override_redirect): New functions.
(x_set_menu_bar_lines): Not for child frames.
(x_window): Handle `undecorated' and `override_redirect' cases.
(Fx_create_frame): Handle new frame parameters.
(frame_geometry): Handle child frames and outer border.
(x_frame_list_z_order, Fx_frame_list_z_order)
(x_frame_restack, Fx_frame_restack): New functions.
(Fx_file_dialog, Fx_select_font): Set x_menu_set_in_use.
(x_frame_parm_handlers): Add entries for new frame parameters.
* src/xmenu.c (x_menu_set_in_use): Handle `z-group-above'
frames.
* src/xterm.c (x_set_frame_alpha): Don't set alpha of parent
for child frames.
(XTmouse_position): Handle child frames.
(x_scroll_bar_create, x_scroll_bar_expose): Don't let scroll
bars obscure child frames.
(handle_one_xevent): Handle child frame positions. If necessary
set `skip-taskbar' and reassign proper `z-group' when we are
mapped. When generating SELECT_WINDOW_EVENTs handle new value
of `focus-follows-mouse'. Handle `mouse-wheel-frame' parameter.
Let mouse clicks into a child frame activate the frame.
(x_calc_absolute_position, x_set_offset): Handle child frames
specially.
(x_set_skip_taskbar, x_set_z_group): New functions.
(x_make_frame_visible): Handle child frames.
(ATOM_REFS_INIT): Add entries for
Xatom_net_wm_state_skip_taskbar, Xatom_net_wm_state_above,
Xatom_net_wm_state_below.
* src/xterm.h (top-level): Declare Xatom_net_wm_state_above,
Xatom_net_wm_state_below and Xatom_net_wm_state_skip_taskbar.
(x_set_skip_taskbar, x_set_z_group): Add extern declarations.
2017-04-12 08:38:25 +00:00
|
|
|
|
|
|
|
|
|
(defun frame-list-z-order (&optional display)
|
|
|
|
|
"Return list of Emacs' frames, in Z (stacking) order.
|
|
|
|
|
The optional argument DISPLAY specifies which display to poll.
|
|
|
|
|
DISPLAY should be either a frame or a display name (a string).
|
|
|
|
|
If omitted or nil, that stands for the selected frame's display.
|
|
|
|
|
|
|
|
|
|
Frames are listed from topmost (first) to bottommost (last). As
|
|
|
|
|
a special case, if DISPLAY is non-nil and specifies a live frame,
|
|
|
|
|
return the child frames of that frame in Z (stacking) order.
|
|
|
|
|
|
|
|
|
|
Return nil if DISPLAY contains no Emacs frame."
|
|
|
|
|
(let ((frame-type (framep-on-display display)))
|
|
|
|
|
(cond
|
|
|
|
|
((eq frame-type 'x)
|
|
|
|
|
(x-frame-list-z-order display))
|
|
|
|
|
((eq frame-type 'w32)
|
2017-04-20 14:25:56 +00:00
|
|
|
|
(w32-frame-list-z-order display))
|
|
|
|
|
((eq frame-type 'ns)
|
Add support for the Haiku operating system and its window system
* .gitignore: Add binaries specific to Haiku.
* Makefie.in (HAVE_BE_APP): New variable.
(install-arch-dep): Install Emacs and Emacs.pdmp when
using Haiku.
* configure.ac: Detect and configure for Haiku and
various related configurations.
(be-app, be-freetype, be-cairo): New options.
(HAVE_BE_APP, HAIKU_OBJ, HAIKU_CXX_OBJ)
(HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(HAIKU, HAVE_TINY_SPEED_T): New define.
(emacs_config_features): Add BE_APP.
* doc/emacs/Makefile.in (EMACSSOURCES): Add Haiku
appendix.
* doc/emacs/emacs.texi: Add Haiku appendix to menus and
include it.
* doc/emacs/haiku.texi: New Haiku appendix.
* doc/lispref/display.texi (Defining Faces, Window Systems):
Explain meaning of `haiku' as a window system identifier.
(haiku-use-system-tooltips): Explain meaning of system
tooltips on
Haiku.
* doc/lispref/frames.texi (Multiple Terminals): Explain
meaning of haiku as a display type.
(Frame Layout): Clarify section for Haiku frames.
(Size Parameters): Explain limitations of fullwidth and
fullheight on Haiku.
(Management Parameters): Explain limitations of
inhibiting double buffering on builds with Cairo,
and the inability of frames with no-accept-focus to
receive keyboard input on Haiku.
(Font and Color Parameters): Explain the different font
backends available on Haiku.
(Raising and Lowering): Explain that lowering and
restacking frames doesn't work on Haiku.
(Child Frames): Explain oddities of child frame
visibility on Haiku.
* doc/lispref/os.texi (System Environment): Explain
meaning of haiku.
* etc/MACHINES: Add appropriate notices for Haiku.
* etc/NEWS: Document changes.
* etc/PROBLEMS: Document font spacing bug on Haiku.
* lib-src/Makefile.in: Build be-resources binary on
Haiku.
(CXX, CXXFLAGS, NON_CXX_FLAGS, ALL_CXXFLAGS)
(HAVE_BE_APP, HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(DONT_INSTALL): Add be-resources binary if on Haiku.
(be-resources): New target.
* lib-src/be_resources: Add helper binary for setting
resources on the Emacs application.
* lib-src/emacsclient.c (decode_options): Set
alt_display to "be" on Haiku.
* lisp/cus-edit.el (custom-button, custom-button-mouse)
(custom-button-unraised, custom-button-pressed): Update
face definitions for Haiku.
* lisp/cus-start.el: Add haiku-debug-on-fatal-error and
haiku-use-system-tooltips.
* lisp/faces.el (face-valid-attribute-values): Clarify
attribute comment for Haiku.
(tool-bar): Add appropriate toolbar color for Haiku.
* lisp/frame.el (haiku-frame-geometry)
(haiku-mouse-absolute-pixel-position)
(haiku-set-mouse-absolute-pixel-position)
(haiku-frame-edges)
(haiku-frame-list-z-order): New function declarations.
(frame-geometry, frame-edges)
(mouse-absolute-pixel-position)
(set-mouse-absolute-pixel-position)
(frame-list-z-order): Call appropriate window system
functions on Haiku.
(display-mouse-p, display-graphic-p)
(display-images-p, display-pixel-height)
(display-pixel-width, display-mm-height)
(display-mm-width, display-backing-store)
(display-save-under, display-planes)
(display-color-cells, display-visual-class): Update type
tests for Haiku.
* lisp/international/mule-cmds.el
(set-coding-system-map): Also
prevent set-terminal-coding-system from appearing in the menu
bar on Haiku.
* lisp/loadup.el: Load Haiku-specific files when built
with Haiku, and don't rename newly built Emacs on Haiku as BFS
doesn't support hard links.
* lisp/menu-bar.el (menu-bar-open): Add for Haiku.
* lisp/mwheel.el (mouse-wheel-down-event): Expect
wheel-up on Haiku.
(mouse-wheel-up-event): Expect wheel-down on Haiku.
(mouse-wheel-left-event): Expect wheel-left on Haiku.
(mouse-wheel-right-event): Expect wheel-right on Haiku.
* lisp/net/browse-url.el
(browse-url--browser-defcustom-type):
Add option for WebPositive.
(browse-url-webpositive-program): New variable.
(browse-url-default-program): Search for WebPositive.
(browse-url-webpositive): New function.
* lisp/net/eww.el (eww-form-submit, eww-form-file)
(eww-form-checkbox, eww-form-select): Define faces
appropriately for Haiku.
* lisp/term/haiku-win.el: New file.
* lisp/tooltip.el (menu-or-popup-active-p): New function
declaration.
(tooltip-show-help): Don't use tooltips on Haiku when a
menu is active.
* lisp/version.el (haiku-get-version-string): New
function declaration.
(emacs-version): Add Haiku version string if
appropriate.
* src/Makefile.in: Also produce binary named "Emacs"
with Haiku resources set.
(CXX, HAIKU_OBJ, HAIKU_CXX_OBJ, HAIKU_LIBS)
(HAIKU_CFLAGS, HAVE_BE_APP, NON_CXX_FLAGS)
(ALL_CXX_FLAGS): New variables.
(.SUFFIXES): Add .cc.
(.cc.o): New target.
(base_obj): Add Haiku C objects.
(doc_obj, obj): Split objects that should scanned for
documentation into doc_obj.
(SOME_MACHINE_OBJECTS): Add appropriate Haiku C objects.
(all): Depend on Emacs and Emacs.pdmp on Haiku.
(LIBES): Add Haiku libraries.
(gl-stamp)
($(etc)/DOC): Scan doc_obj instead of obj
(temacs$(EXEEXT): Use C++ linker on Haiku.
(ctagsfiles3): New variable.
(TAGS): Scan C++ files.
* src/alloc.c (garbage_collect): Mark Haiku display.
* src/dispextern.h (HAVE_NATIVE_TRANSFORMS): Also enable
on Haiku.
(struct image): Add fields for Haiku transforms.
(RGB_PIXEL_COLOR): Define to unsigned long on Haiku as
well.
(sit_for): Also check USABLE_SIGPOLL.
(init_display_interactive): Set initial window system to
Haiku on Haiku builds.
* src/emacs.c (main): Define Haiku syms and init haiku
clipboard.
(shut_down_emacs): Quit BApplication on Haiku and
trigger debug
on aborts if haiku_debug_on_fatal_error.
(Vsystem_type): Update docstring.
* src/fileio.c (next-read-file-uses-dialog-p): Enable on
Haiku.
* src/filelock.c (WTMP_FILE): Only define if BOOT_TIME
is also defined.
* src/floatfns.c (double_integer_scale): Work around
Haiku libroot brain damage.
* src/font.c (syms_of_font): Define appropriate font
driver symbols for Haiku builds with various options.
* src/font.h: Also enable ftcrfont on Haiku builds with
Cairo.
(font_data_structures_may_be_ill_formed): Also enable on
Haiku builds that have Cairo.
* src/frame.c (Fframep): Update doc-string for Haiku
builds and return haiku if appropriate.
(syms_of_frame): New symbol `haiku'.
* src/frame.h (struct frame): Add output data for Haiku.
(FRAME_HAIKU_P): New macro.
(FRAME_WINDOW_P): Test for Haiku frames as well.
* src/ftcrfont.c (RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG): New macros.
(ftcrfont_draw): Add haiku specific code for Haiku
builds with Cairo.
* src/ftfont.c (ftfont_open): Set face.
(ftfont_has_char, ftfont_text_extents): Work around
crash.
(syms_of_ftfont): New symbol `mono'.
* src/ftfont.h (struct font_info): Enable Cairo-specific
fields for Cairo builds on Haiku.
* src/haiku_draw_support.cc:
* src/haiku_font_support.cc:
* src/haiku_io.c:
* src/haiku_select.cc:
* src/haiku_support.cc:
* src/haiku_support.h:
* src/haikufns.c:
* src/haikufont.c:
* src/haikugui.h:
* src/haikuimage.c:
* src/haikumenu.c:
* src/haikuselect.c:
* src/haikuselect.h:
* src/haikuterm.c:
* src/haikuterm.h: Add new files for Haiku windowing
support.
* src/haiku.c: Add new files for Haiku operating system
support.
* src/image.c: Implement image transforms and native XPM
support
on Haiku.
(GET_PIXEL, PUT_PIXEL, NO_PIXMAP)
(PIX_MASK_RETAIN, PIX_MASK_DRAW)
(RGB_TO_ULONG, RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG, RED16_FROM_ULONG, GREEN16_FROM_ULONG)
(BLUE16_FROM_ULONG): Define to appropriate values on
Haiku.
(image_create_bitmap_from_data): Add Haiku support.
(image_create_bitmap_from_file): Add TODO on Haiku.
(free_bitmap_record): Free bitmap on Haiku.
(image_size_in_bytes): Implement for Haiku bitmaps.
(image_set_transform): Implement on Haiku.
(image_create_x_image_and_pixmap_1): Implement on Haiku,
24-bit or 1-bit only.
(image_destroy_x_image, image_get_x_image): Use correct
img and pixmap values on Haiku.
(lookup_rgb_color): Use correct macro on Haiku.
(image_to_emacs_colors): Implement on Haiku.
(image_disable_image): Disable on Haiku.
(image_can_use_native_api): Test for translator presence
on Haiku.
(native_image_load): Use translator on Haiku.
(imagemagick_load_image): Add Haiku-specific quirks.
(Fimage_transforms_p): Allow rotate90 on Haiku.
(image_types): Enable native XPM support on Haiku.
(syms_of_image): Enable XPM images on Haiku.
* src/keyboard.c (kbd_buffer_get_event)
(handle_async_input, handle_input_available_signal)
(handle_user_signal, Fset_input_interrupt_mode)
(init_keyboard): Check for USABLE_SIGPOLL along with
USABLE_SIGIO.
* src/lisp.h (pD): Work around broken Haiku headers.
(HAVE_EXT_MENU_BAR): Define on Haiku.
(handle_input_available_signal): Enable if we just have
SIGPOLL as well.
* src/menu.c (have_boxes): Return true on Haiku.
(single_menu_item): Enable toolkit menus on Haiku.
(find_and_call_menu_selection): Also enable on Haiku.
* src/process.c (keyboard_bit_set): Enable with only
usable SIGPOLL.
(wait_reading_process_output): Test for SIGPOLL as well
as SIGIO availability.
* src/sound.c (sound_perror, vox_open)
(vox_configure, vox_close): Enable for usable SIGPOLL as
well.
* src/sysdep.c (sys_subshell): Enable for usable SIGPOLL.
(reset_sigio): Make conditional on F_SETOWN.
(request_sigio, unrequest_sigio)
(emacs_sigaction_init): Also handle SIGPOLLs.
(init_sys_modes): Disable TCXONC usage on Haiku, as it
doesn't have any ttys other than pseudo ttys, which don't
support C-s/C-q flow control, and causes compiler warnings.
(speeds): Disable high speeds if HAVE_TINY_SPEED_T.
* src/termhooks.h (enum output_method): Add output_haiku.
(struct terminal): Add Haiku display info.
(TERMINAL_FONT_CACHE): Enable for Haiku.
* src/terminal.c (Fterminal_live_p): Return `haiku' if
appropriate.
* src/verbose.mk.in (AM_V_CXX, AM_V_CXXLD): New logging
variables.
* src/xdisp.c (redisplay_internal)
(note_mouse_highlight): Return on Haiku if a popup is activated.
(display_menu_bar): Return on Haiku if frame is a Haiku
frame.
* src/xfaces.c (GCGraphicsExposures): Enable correctly on Haiku.
(x_create_gc): Enable dummy GC code on Haiku.
* src/xfns.c (x-server-version, x-file-dialog): Add
Haiku specifics to doc strings.
* src/xterm.c (syms_of_xterm): Add Haiku information to
doc string.
2021-11-20 13:30:08 +00:00
|
|
|
|
(ns-frame-list-z-order display))
|
|
|
|
|
((eq frame-type 'haiku)
|
|
|
|
|
(haiku-frame-list-z-order display)))))
|
Add new frame parameters and associated functions
Add new frame parameters `undecorated', `override-redirect',
`parent-frame', `skip-taskbar', `no-focus-on-map',
`no-accept-focus', `z-group', `delete-before', `no-other-frame',
`mouse-wheel-frame', `min-width', `min-height'. Add new
functions `frame-restack' and `frame-list-z-order'.
* lisp/cus-start.el (focus-follows-mouse): Adapt customization
type.
* lisp/frame.el (handle-delete-frame): Handle child and
`delete-before' frames.
(other-frame): Stop looking for other frame after one round.
(frame-list-z-order, frame-restack): New functions.
(delete-other-frames): Handle child frames.
* lisp/frameset.el (frameset-persistent-filter-alist)
(frameset--record-relationships): Handle `delete-before',
`parent-frame' and `mouse-wheel-frame' parameters. Rename
latter from `frameset--record-minibuffer-relationships'.
(frameset--restore-frame): Handle ‘parent-frame’ parameter
specially.
(frameset-restore): Handle `delete-before', `parent-frame' and
`mouse-wheel-frame' parameters.
* lisp/mwheel.el (mwheel-scroll): Handle `mouse-wheel-frame'
parameter.
* lisp/window.el (window--min-size-ignore-p): Fix doc-string.
(mouse-autoselect-window-select, handle-select-window): Major
rewrite. Try to not ignore errors. Handle auto-selection of
child frames and different values of `focus-follows-mouse'.
* src/frame.c (frame_windows_min_size): Handle new `min-width'
and `min-height' frame parameters.
(make_frame): Initialize new frame structure members.
(do_switch_frame): Don't reset internal_last_event_frame for
descendant frames.
(Fframe_parent, frame_ancestor_p, Fframe_ancestor_p): New
functions.
(candidate_frame): Don't return `no-other-frame' frame.
(other_frames): New function replacing other_visible_frames.
(delete_frame): Rewrite. Handle child and `delete-before' frames.
(Fmake_frame_invisible): Call other_frames.
(store_frame_param): Check `delete-before' and `parent-frame'
parameters for circular dependencies.
(frame_parms, syms_of_frame): Add entries for and define new
frame parameters.
(focus_follows_mouse): New meaningful value `auto-raise'.
* src/frame.h (z_group): New enumeration type.
(frame): New slots parent_frame, undecorated, override_redirect,
skip_taskbar, no_focus_on_map, no_accept_focus, z_group.
(fset_parent_frame): New inlined function.
(FRAME_UNDECORATED, FRAME_OVERRIDE_REDIRECT)
(FRAME_PARENT_FRAME, FRAME_SKIP_TASKBAR, FRAME_NO_FOCUS_ON_MAP)
(FRAME_NO_ACCEPT_FOCUS, FRAME_Z_GROUP, FRAME_Z_GROUP_NONE)
(FRAME_Z_GROUP_ABOVE, FRAME_Z_GROUP_ABOVE_SUSPENDED)
(FRAME_Z_GROUP_BELOW): New macros.
(frame_ancestor_p): Add declaration.
* src/gtkutil.c (xg_create_frame_widgets): Handle
`undecorated' and `override-redirect' frame parameters.
(x_wm_set_size_hint): None for child frames.
(xg_set_undecorated, xg_frame_restack, xg_set_skip_taskbar)
(xg_set_no_focus_on_map, xg_set_no_accept_focus)
(xg_set_override_redirect): New functions.
(xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos):
Don't let scrollbars obscure child frames.
* src/gtkutil.h: (xg_set_undecorated, xg_frame_restack)
(xg_set_skip_taskbar, xg_set_no_focus_on_map)
(xg_set_no_accept_focus, xg_set_override_redirect): Add extern
declarations.
* src/nsfns.m (ns_frame_parm_handlers): Add entries for new
frame parameters.
(Fx_create_frame): Install `min-width' and `min-height' frame
parameters.
* src/nsterm.m (mouseMoved:): Handle focus_follows_mouse change.
* src/w32fns.c (WS_EX_NOACTIVATE): Define if necessary.
(x_real_positions): Handle child frames.
(x_set_menu_bar_lines): Don't for child frames.
(x_set_undecorated, x_set_parent_frame, x_set_skip_taskbar)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_z_group): New functions.
(w32_createvscrollbar, w32_createhscrollbar): Don't draw
scroll bars over child frames.
(w32_createwindow): Handle new frame parameters and child frames.
(w32_wnd_proc): Let mouse clicks into a child frame activate
the frame. Try to handle the `no-accept-focus' parameter. Do
SetFocus when our window is brought to top or becomes the
foreground window.
(w32_window): Don't initialize menu bar for child frames.
(Fx_create_frame): Handle new frame parameters.
(x_create_tip_frame): Set explicit_parent slot.
(w32_dialog_in_progress): New function.
(Fx_file_dialog): Handle `z-group-above' frames.
(w32_frame_list_z_order, Fw32_frame_list_z_order)
(w32_frame_restack, Fw32_frame_restack): New functions.
(w32_frame_parm_handlers): Add entries for new frame
parameters.
* src/w32font.c (Fx_select_font): Handle `z-group-above'
frames during font selection dialogue.
* src/w32term.c (construct_mouse_wheel): Construct mouse wheel
event from F's w32 window.
(w32_mouse_position): Handle child frames.
(w32_set_vertical_scroll_bar, w32_set_horizontal_scroll_bar):
Don't draw scroll bars over child frames.
(w32_read_socket): Always erase background of child frames.
When generating SELECT_WINDOW_EVENTs handle new value of
`focus-follows-mouse' and handle `no-accept-focus' parameter.
Handle `mouse-wheel-frame' parameter.
(x_calc_absolute_position, x_set_offset, x_set_window_size):
Handle child frames.
(x_make_frame_visible): Handle child frames specially. Handle
`no-focus-on-map' parameter.
* src/w32term.h (w32_dialog_in_progress): Add external
declaration.
* src/xdisp.c (x_consider_frame_title, prepare_menu_bars): Not
for child frames.
* src/xfns.c (Xm/MwmUtil.h): Include for WM hints.
(PropMotifWmHints, PROP_MOTIF_WM_HINTS_ELEMENTS): Define for
non-Motif, non-GTK case.
(x_real_pos_and_offsets): Handle child frames.
(x_set_undecorated, x_set_parent_frame)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_override_redirect): New functions.
(x_set_menu_bar_lines): Not for child frames.
(x_window): Handle `undecorated' and `override_redirect' cases.
(Fx_create_frame): Handle new frame parameters.
(frame_geometry): Handle child frames and outer border.
(x_frame_list_z_order, Fx_frame_list_z_order)
(x_frame_restack, Fx_frame_restack): New functions.
(Fx_file_dialog, Fx_select_font): Set x_menu_set_in_use.
(x_frame_parm_handlers): Add entries for new frame parameters.
* src/xmenu.c (x_menu_set_in_use): Handle `z-group-above'
frames.
* src/xterm.c (x_set_frame_alpha): Don't set alpha of parent
for child frames.
(XTmouse_position): Handle child frames.
(x_scroll_bar_create, x_scroll_bar_expose): Don't let scroll
bars obscure child frames.
(handle_one_xevent): Handle child frame positions. If necessary
set `skip-taskbar' and reassign proper `z-group' when we are
mapped. When generating SELECT_WINDOW_EVENTs handle new value
of `focus-follows-mouse'. Handle `mouse-wheel-frame' parameter.
Let mouse clicks into a child frame activate the frame.
(x_calc_absolute_position, x_set_offset): Handle child frames
specially.
(x_set_skip_taskbar, x_set_z_group): New functions.
(x_make_frame_visible): Handle child frames.
(ATOM_REFS_INIT): Add entries for
Xatom_net_wm_state_skip_taskbar, Xatom_net_wm_state_above,
Xatom_net_wm_state_below.
* src/xterm.h (top-level): Declare Xatom_net_wm_state_above,
Xatom_net_wm_state_below and Xatom_net_wm_state_skip_taskbar.
(x_set_skip_taskbar, x_set_z_group): Add extern declarations.
2017-04-12 08:38:25 +00:00
|
|
|
|
|
|
|
|
|
(declare-function x-frame-restack "xfns.c" (frame1 frame2 &optional above))
|
|
|
|
|
(declare-function w32-frame-restack "w32fns.c" (frame1 frame2 &optional above))
|
2017-04-20 14:25:56 +00:00
|
|
|
|
(declare-function ns-frame-restack "nsfns.m" (frame1 frame2 &optional above))
|
Add new frame parameters and associated functions
Add new frame parameters `undecorated', `override-redirect',
`parent-frame', `skip-taskbar', `no-focus-on-map',
`no-accept-focus', `z-group', `delete-before', `no-other-frame',
`mouse-wheel-frame', `min-width', `min-height'. Add new
functions `frame-restack' and `frame-list-z-order'.
* lisp/cus-start.el (focus-follows-mouse): Adapt customization
type.
* lisp/frame.el (handle-delete-frame): Handle child and
`delete-before' frames.
(other-frame): Stop looking for other frame after one round.
(frame-list-z-order, frame-restack): New functions.
(delete-other-frames): Handle child frames.
* lisp/frameset.el (frameset-persistent-filter-alist)
(frameset--record-relationships): Handle `delete-before',
`parent-frame' and `mouse-wheel-frame' parameters. Rename
latter from `frameset--record-minibuffer-relationships'.
(frameset--restore-frame): Handle ‘parent-frame’ parameter
specially.
(frameset-restore): Handle `delete-before', `parent-frame' and
`mouse-wheel-frame' parameters.
* lisp/mwheel.el (mwheel-scroll): Handle `mouse-wheel-frame'
parameter.
* lisp/window.el (window--min-size-ignore-p): Fix doc-string.
(mouse-autoselect-window-select, handle-select-window): Major
rewrite. Try to not ignore errors. Handle auto-selection of
child frames and different values of `focus-follows-mouse'.
* src/frame.c (frame_windows_min_size): Handle new `min-width'
and `min-height' frame parameters.
(make_frame): Initialize new frame structure members.
(do_switch_frame): Don't reset internal_last_event_frame for
descendant frames.
(Fframe_parent, frame_ancestor_p, Fframe_ancestor_p): New
functions.
(candidate_frame): Don't return `no-other-frame' frame.
(other_frames): New function replacing other_visible_frames.
(delete_frame): Rewrite. Handle child and `delete-before' frames.
(Fmake_frame_invisible): Call other_frames.
(store_frame_param): Check `delete-before' and `parent-frame'
parameters for circular dependencies.
(frame_parms, syms_of_frame): Add entries for and define new
frame parameters.
(focus_follows_mouse): New meaningful value `auto-raise'.
* src/frame.h (z_group): New enumeration type.
(frame): New slots parent_frame, undecorated, override_redirect,
skip_taskbar, no_focus_on_map, no_accept_focus, z_group.
(fset_parent_frame): New inlined function.
(FRAME_UNDECORATED, FRAME_OVERRIDE_REDIRECT)
(FRAME_PARENT_FRAME, FRAME_SKIP_TASKBAR, FRAME_NO_FOCUS_ON_MAP)
(FRAME_NO_ACCEPT_FOCUS, FRAME_Z_GROUP, FRAME_Z_GROUP_NONE)
(FRAME_Z_GROUP_ABOVE, FRAME_Z_GROUP_ABOVE_SUSPENDED)
(FRAME_Z_GROUP_BELOW): New macros.
(frame_ancestor_p): Add declaration.
* src/gtkutil.c (xg_create_frame_widgets): Handle
`undecorated' and `override-redirect' frame parameters.
(x_wm_set_size_hint): None for child frames.
(xg_set_undecorated, xg_frame_restack, xg_set_skip_taskbar)
(xg_set_no_focus_on_map, xg_set_no_accept_focus)
(xg_set_override_redirect): New functions.
(xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos):
Don't let scrollbars obscure child frames.
* src/gtkutil.h: (xg_set_undecorated, xg_frame_restack)
(xg_set_skip_taskbar, xg_set_no_focus_on_map)
(xg_set_no_accept_focus, xg_set_override_redirect): Add extern
declarations.
* src/nsfns.m (ns_frame_parm_handlers): Add entries for new
frame parameters.
(Fx_create_frame): Install `min-width' and `min-height' frame
parameters.
* src/nsterm.m (mouseMoved:): Handle focus_follows_mouse change.
* src/w32fns.c (WS_EX_NOACTIVATE): Define if necessary.
(x_real_positions): Handle child frames.
(x_set_menu_bar_lines): Don't for child frames.
(x_set_undecorated, x_set_parent_frame, x_set_skip_taskbar)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_z_group): New functions.
(w32_createvscrollbar, w32_createhscrollbar): Don't draw
scroll bars over child frames.
(w32_createwindow): Handle new frame parameters and child frames.
(w32_wnd_proc): Let mouse clicks into a child frame activate
the frame. Try to handle the `no-accept-focus' parameter. Do
SetFocus when our window is brought to top or becomes the
foreground window.
(w32_window): Don't initialize menu bar for child frames.
(Fx_create_frame): Handle new frame parameters.
(x_create_tip_frame): Set explicit_parent slot.
(w32_dialog_in_progress): New function.
(Fx_file_dialog): Handle `z-group-above' frames.
(w32_frame_list_z_order, Fw32_frame_list_z_order)
(w32_frame_restack, Fw32_frame_restack): New functions.
(w32_frame_parm_handlers): Add entries for new frame
parameters.
* src/w32font.c (Fx_select_font): Handle `z-group-above'
frames during font selection dialogue.
* src/w32term.c (construct_mouse_wheel): Construct mouse wheel
event from F's w32 window.
(w32_mouse_position): Handle child frames.
(w32_set_vertical_scroll_bar, w32_set_horizontal_scroll_bar):
Don't draw scroll bars over child frames.
(w32_read_socket): Always erase background of child frames.
When generating SELECT_WINDOW_EVENTs handle new value of
`focus-follows-mouse' and handle `no-accept-focus' parameter.
Handle `mouse-wheel-frame' parameter.
(x_calc_absolute_position, x_set_offset, x_set_window_size):
Handle child frames.
(x_make_frame_visible): Handle child frames specially. Handle
`no-focus-on-map' parameter.
* src/w32term.h (w32_dialog_in_progress): Add external
declaration.
* src/xdisp.c (x_consider_frame_title, prepare_menu_bars): Not
for child frames.
* src/xfns.c (Xm/MwmUtil.h): Include for WM hints.
(PropMotifWmHints, PROP_MOTIF_WM_HINTS_ELEMENTS): Define for
non-Motif, non-GTK case.
(x_real_pos_and_offsets): Handle child frames.
(x_set_undecorated, x_set_parent_frame)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_override_redirect): New functions.
(x_set_menu_bar_lines): Not for child frames.
(x_window): Handle `undecorated' and `override_redirect' cases.
(Fx_create_frame): Handle new frame parameters.
(frame_geometry): Handle child frames and outer border.
(x_frame_list_z_order, Fx_frame_list_z_order)
(x_frame_restack, Fx_frame_restack): New functions.
(Fx_file_dialog, Fx_select_font): Set x_menu_set_in_use.
(x_frame_parm_handlers): Add entries for new frame parameters.
* src/xmenu.c (x_menu_set_in_use): Handle `z-group-above'
frames.
* src/xterm.c (x_set_frame_alpha): Don't set alpha of parent
for child frames.
(XTmouse_position): Handle child frames.
(x_scroll_bar_create, x_scroll_bar_expose): Don't let scroll
bars obscure child frames.
(handle_one_xevent): Handle child frame positions. If necessary
set `skip-taskbar' and reassign proper `z-group' when we are
mapped. When generating SELECT_WINDOW_EVENTs handle new value
of `focus-follows-mouse'. Handle `mouse-wheel-frame' parameter.
Let mouse clicks into a child frame activate the frame.
(x_calc_absolute_position, x_set_offset): Handle child frames
specially.
(x_set_skip_taskbar, x_set_z_group): New functions.
(x_make_frame_visible): Handle child frames.
(ATOM_REFS_INIT): Add entries for
Xatom_net_wm_state_skip_taskbar, Xatom_net_wm_state_above,
Xatom_net_wm_state_below.
* src/xterm.h (top-level): Declare Xatom_net_wm_state_above,
Xatom_net_wm_state_below and Xatom_net_wm_state_skip_taskbar.
(x_set_skip_taskbar, x_set_z_group): Add extern declarations.
2017-04-12 08:38:25 +00:00
|
|
|
|
|
|
|
|
|
(defun frame-restack (frame1 frame2 &optional above)
|
|
|
|
|
"Restack FRAME1 below FRAME2.
|
|
|
|
|
This implies that if both frames are visible and the display
|
|
|
|
|
areas of these frames overlap, FRAME2 will (partially) obscure
|
|
|
|
|
FRAME1. If the optional third argument ABOVE is non-nil, restack
|
|
|
|
|
FRAME1 above FRAME2. This means that if both frames are visible
|
|
|
|
|
and the display areas of these frames overlap, FRAME1 will
|
|
|
|
|
\(partially) obscure FRAME2.
|
|
|
|
|
|
|
|
|
|
This may be thought of as an atomic action performed in two
|
|
|
|
|
steps: The first step removes FRAME1's window-system window from
|
|
|
|
|
the display. The second step reinserts FRAME1's window
|
|
|
|
|
below (above if ABOVE is true) that of FRAME2. Hence the
|
|
|
|
|
position of FRAME2 in its display's Z (stacking) order relative
|
|
|
|
|
to all other frames excluding FRAME1 remains unaltered.
|
|
|
|
|
|
lisp/*.el, src/*.c: Fix typos in docstrings
* lisp/apropos.el (apropos-do-all):
* lisp/auth-source-pass.el (auth-source-pass--select-from-entries):
* lisp/auth-source.el (auth-source-user-or-password):
* lisp/calc/calc-forms.el (math-tzone-names):
* lisp/calendar/diary-lib.el (diary-face-attrs)
(diary-mark-entries-1):
* lisp/cedet/cedet-files.el (cedet-files-list-recursively):
* lisp/cedet/ede.el (ede-constructing, ede-deep-rescan):
* lisp/cedet/ede/cpp-root.el (ede-cpp-root-header-file-p):
* lisp/cedet/ede/proj.el (ede-proj-target-makefile):
* lisp/cedet/inversion.el (inversion-check-version)
(inversion-test):
* lisp/cedet/mode-local.el (mode-local-map-file-buffers):
* lisp/cedet/semantic/complete.el (semantic-displayer-ghost):
* lisp/cedet/semantic/db-find.el (semanticdb-find-translate-path-default):
* lisp/cedet/semantic/db.el (semanticdb-table)
(semanticdb-search-system-databases):
* lisp/cedet/semantic/imenu.el (semantic-imenu-index-directory):
* lisp/cedet/semantic/java.el (semantic-java-doc-keywords-map):
* lisp/cedet/semantic/lex-spp.el (semantic-lex-spp-use-headers-flag):
* lisp/cedet/semantic/lex.el (semantic-lex-make-keyword-table)
(semantic-lex-make-type-table, semantic-lex-debug-analyzers):
* lisp/cedet/semantic/tag-ls.el (semantic-tag-abstract-p)
(semantic-tag-leaf-p, semantic-tag-static-p)
(semantic-tag-prototype-p):
* lisp/dnd.el (dnd-open-remote-file-function, dnd-open-local-file):
* lisp/emacs-lisp/eieio-opt.el (eieio-build-class-alist)
(eieio-read-class, eieio-read-subclass):
* lisp/emacs-lisp/generator.el (cps--replace-variable-references)
(cps--handle-loop-for):
* lisp/erc/erc-dcc.el (erc-dcc-list, erc-dcc-member, erc-dcc-server)
(erc-dcc-auto-mask-p, erc-dcc-get-file, erc-dcc-chat-accept):
* lisp/eshell/em-pred.el (eshell-pred-file-type):
* lisp/faces.el (defined-colors-with-face-attributes):
* lisp/font-core.el (font-lock-mode):
* lisp/frame.el (frame-restack):
* lisp/net/shr.el (shr-image-animate):
* lisp/org/org-agenda.el (org-agenda-change-all-lines)
(org-agenda-today-p):
* lisp/org/org-id.el (org-id-get):
* lisp/org/org.el (org-highlight-latex-and-related)
(org--valid-property-p):
* lisp/org/ox-beamer.el (org-beamer--get-label):
* lisp/org/ox-latex.el (org-latex--caption-above-p):
* lisp/org/ox-odt.el (org-odt--copy-image-file)
(org-odt--copy-formula-file):
* lisp/org/ox.el (org-export-with-timestamps):
* lisp/progmodes/verilog-mode.el (verilog-indent-declaration-macros):
* lisp/ses.el (ses-file-format-extend-parameter-list):
* lisp/term.el (ansi-term):
* lisp/textmodes/bibtex.el (bibtex-no-opt-remove-re)
(bibtex-beginning-of-first-entry, bibtex-autokey-get-title)
(bibtex-read-key, bibtex-initialize):
* lisp/textmodes/flyspell.el (flyspell-word):
* lisp/view.el (view-mode-exit):
* src/composite.c:
* src/floatfns.c (Fisnan): Fix typos in docstrings.
2019-09-19 02:32:25 +00:00
|
|
|
|
Some window managers may refuse to restack windows."
|
Add new frame parameters and associated functions
Add new frame parameters `undecorated', `override-redirect',
`parent-frame', `skip-taskbar', `no-focus-on-map',
`no-accept-focus', `z-group', `delete-before', `no-other-frame',
`mouse-wheel-frame', `min-width', `min-height'. Add new
functions `frame-restack' and `frame-list-z-order'.
* lisp/cus-start.el (focus-follows-mouse): Adapt customization
type.
* lisp/frame.el (handle-delete-frame): Handle child and
`delete-before' frames.
(other-frame): Stop looking for other frame after one round.
(frame-list-z-order, frame-restack): New functions.
(delete-other-frames): Handle child frames.
* lisp/frameset.el (frameset-persistent-filter-alist)
(frameset--record-relationships): Handle `delete-before',
`parent-frame' and `mouse-wheel-frame' parameters. Rename
latter from `frameset--record-minibuffer-relationships'.
(frameset--restore-frame): Handle ‘parent-frame’ parameter
specially.
(frameset-restore): Handle `delete-before', `parent-frame' and
`mouse-wheel-frame' parameters.
* lisp/mwheel.el (mwheel-scroll): Handle `mouse-wheel-frame'
parameter.
* lisp/window.el (window--min-size-ignore-p): Fix doc-string.
(mouse-autoselect-window-select, handle-select-window): Major
rewrite. Try to not ignore errors. Handle auto-selection of
child frames and different values of `focus-follows-mouse'.
* src/frame.c (frame_windows_min_size): Handle new `min-width'
and `min-height' frame parameters.
(make_frame): Initialize new frame structure members.
(do_switch_frame): Don't reset internal_last_event_frame for
descendant frames.
(Fframe_parent, frame_ancestor_p, Fframe_ancestor_p): New
functions.
(candidate_frame): Don't return `no-other-frame' frame.
(other_frames): New function replacing other_visible_frames.
(delete_frame): Rewrite. Handle child and `delete-before' frames.
(Fmake_frame_invisible): Call other_frames.
(store_frame_param): Check `delete-before' and `parent-frame'
parameters for circular dependencies.
(frame_parms, syms_of_frame): Add entries for and define new
frame parameters.
(focus_follows_mouse): New meaningful value `auto-raise'.
* src/frame.h (z_group): New enumeration type.
(frame): New slots parent_frame, undecorated, override_redirect,
skip_taskbar, no_focus_on_map, no_accept_focus, z_group.
(fset_parent_frame): New inlined function.
(FRAME_UNDECORATED, FRAME_OVERRIDE_REDIRECT)
(FRAME_PARENT_FRAME, FRAME_SKIP_TASKBAR, FRAME_NO_FOCUS_ON_MAP)
(FRAME_NO_ACCEPT_FOCUS, FRAME_Z_GROUP, FRAME_Z_GROUP_NONE)
(FRAME_Z_GROUP_ABOVE, FRAME_Z_GROUP_ABOVE_SUSPENDED)
(FRAME_Z_GROUP_BELOW): New macros.
(frame_ancestor_p): Add declaration.
* src/gtkutil.c (xg_create_frame_widgets): Handle
`undecorated' and `override-redirect' frame parameters.
(x_wm_set_size_hint): None for child frames.
(xg_set_undecorated, xg_frame_restack, xg_set_skip_taskbar)
(xg_set_no_focus_on_map, xg_set_no_accept_focus)
(xg_set_override_redirect): New functions.
(xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos):
Don't let scrollbars obscure child frames.
* src/gtkutil.h: (xg_set_undecorated, xg_frame_restack)
(xg_set_skip_taskbar, xg_set_no_focus_on_map)
(xg_set_no_accept_focus, xg_set_override_redirect): Add extern
declarations.
* src/nsfns.m (ns_frame_parm_handlers): Add entries for new
frame parameters.
(Fx_create_frame): Install `min-width' and `min-height' frame
parameters.
* src/nsterm.m (mouseMoved:): Handle focus_follows_mouse change.
* src/w32fns.c (WS_EX_NOACTIVATE): Define if necessary.
(x_real_positions): Handle child frames.
(x_set_menu_bar_lines): Don't for child frames.
(x_set_undecorated, x_set_parent_frame, x_set_skip_taskbar)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_z_group): New functions.
(w32_createvscrollbar, w32_createhscrollbar): Don't draw
scroll bars over child frames.
(w32_createwindow): Handle new frame parameters and child frames.
(w32_wnd_proc): Let mouse clicks into a child frame activate
the frame. Try to handle the `no-accept-focus' parameter. Do
SetFocus when our window is brought to top or becomes the
foreground window.
(w32_window): Don't initialize menu bar for child frames.
(Fx_create_frame): Handle new frame parameters.
(x_create_tip_frame): Set explicit_parent slot.
(w32_dialog_in_progress): New function.
(Fx_file_dialog): Handle `z-group-above' frames.
(w32_frame_list_z_order, Fw32_frame_list_z_order)
(w32_frame_restack, Fw32_frame_restack): New functions.
(w32_frame_parm_handlers): Add entries for new frame
parameters.
* src/w32font.c (Fx_select_font): Handle `z-group-above'
frames during font selection dialogue.
* src/w32term.c (construct_mouse_wheel): Construct mouse wheel
event from F's w32 window.
(w32_mouse_position): Handle child frames.
(w32_set_vertical_scroll_bar, w32_set_horizontal_scroll_bar):
Don't draw scroll bars over child frames.
(w32_read_socket): Always erase background of child frames.
When generating SELECT_WINDOW_EVENTs handle new value of
`focus-follows-mouse' and handle `no-accept-focus' parameter.
Handle `mouse-wheel-frame' parameter.
(x_calc_absolute_position, x_set_offset, x_set_window_size):
Handle child frames.
(x_make_frame_visible): Handle child frames specially. Handle
`no-focus-on-map' parameter.
* src/w32term.h (w32_dialog_in_progress): Add external
declaration.
* src/xdisp.c (x_consider_frame_title, prepare_menu_bars): Not
for child frames.
* src/xfns.c (Xm/MwmUtil.h): Include for WM hints.
(PropMotifWmHints, PROP_MOTIF_WM_HINTS_ELEMENTS): Define for
non-Motif, non-GTK case.
(x_real_pos_and_offsets): Handle child frames.
(x_set_undecorated, x_set_parent_frame)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_override_redirect): New functions.
(x_set_menu_bar_lines): Not for child frames.
(x_window): Handle `undecorated' and `override_redirect' cases.
(Fx_create_frame): Handle new frame parameters.
(frame_geometry): Handle child frames and outer border.
(x_frame_list_z_order, Fx_frame_list_z_order)
(x_frame_restack, Fx_frame_restack): New functions.
(Fx_file_dialog, Fx_select_font): Set x_menu_set_in_use.
(x_frame_parm_handlers): Add entries for new frame parameters.
* src/xmenu.c (x_menu_set_in_use): Handle `z-group-above'
frames.
* src/xterm.c (x_set_frame_alpha): Don't set alpha of parent
for child frames.
(XTmouse_position): Handle child frames.
(x_scroll_bar_create, x_scroll_bar_expose): Don't let scroll
bars obscure child frames.
(handle_one_xevent): Handle child frame positions. If necessary
set `skip-taskbar' and reassign proper `z-group' when we are
mapped. When generating SELECT_WINDOW_EVENTs handle new value
of `focus-follows-mouse'. Handle `mouse-wheel-frame' parameter.
Let mouse clicks into a child frame activate the frame.
(x_calc_absolute_position, x_set_offset): Handle child frames
specially.
(x_set_skip_taskbar, x_set_z_group): New functions.
(x_make_frame_visible): Handle child frames.
(ATOM_REFS_INIT): Add entries for
Xatom_net_wm_state_skip_taskbar, Xatom_net_wm_state_above,
Xatom_net_wm_state_below.
* src/xterm.h (top-level): Declare Xatom_net_wm_state_above,
Xatom_net_wm_state_below and Xatom_net_wm_state_skip_taskbar.
(x_set_skip_taskbar, x_set_z_group): Add extern declarations.
2017-04-12 08:38:25 +00:00
|
|
|
|
(if (and (frame-live-p frame1)
|
|
|
|
|
(frame-live-p frame2)
|
|
|
|
|
(equal (frame-parameter frame1 'display)
|
|
|
|
|
(frame-parameter frame2 'display)))
|
|
|
|
|
(let ((frame-type (framep-on-display frame1)))
|
|
|
|
|
(cond
|
|
|
|
|
((eq frame-type 'x)
|
|
|
|
|
(x-frame-restack frame1 frame2 above))
|
|
|
|
|
((eq frame-type 'w32)
|
2017-04-14 09:02:38 +00:00
|
|
|
|
(w32-frame-restack frame1 frame2 above))
|
|
|
|
|
((eq frame-type 'ns)
|
|
|
|
|
(ns-frame-restack frame1 frame2 above))))
|
Add new frame parameters and associated functions
Add new frame parameters `undecorated', `override-redirect',
`parent-frame', `skip-taskbar', `no-focus-on-map',
`no-accept-focus', `z-group', `delete-before', `no-other-frame',
`mouse-wheel-frame', `min-width', `min-height'. Add new
functions `frame-restack' and `frame-list-z-order'.
* lisp/cus-start.el (focus-follows-mouse): Adapt customization
type.
* lisp/frame.el (handle-delete-frame): Handle child and
`delete-before' frames.
(other-frame): Stop looking for other frame after one round.
(frame-list-z-order, frame-restack): New functions.
(delete-other-frames): Handle child frames.
* lisp/frameset.el (frameset-persistent-filter-alist)
(frameset--record-relationships): Handle `delete-before',
`parent-frame' and `mouse-wheel-frame' parameters. Rename
latter from `frameset--record-minibuffer-relationships'.
(frameset--restore-frame): Handle ‘parent-frame’ parameter
specially.
(frameset-restore): Handle `delete-before', `parent-frame' and
`mouse-wheel-frame' parameters.
* lisp/mwheel.el (mwheel-scroll): Handle `mouse-wheel-frame'
parameter.
* lisp/window.el (window--min-size-ignore-p): Fix doc-string.
(mouse-autoselect-window-select, handle-select-window): Major
rewrite. Try to not ignore errors. Handle auto-selection of
child frames and different values of `focus-follows-mouse'.
* src/frame.c (frame_windows_min_size): Handle new `min-width'
and `min-height' frame parameters.
(make_frame): Initialize new frame structure members.
(do_switch_frame): Don't reset internal_last_event_frame for
descendant frames.
(Fframe_parent, frame_ancestor_p, Fframe_ancestor_p): New
functions.
(candidate_frame): Don't return `no-other-frame' frame.
(other_frames): New function replacing other_visible_frames.
(delete_frame): Rewrite. Handle child and `delete-before' frames.
(Fmake_frame_invisible): Call other_frames.
(store_frame_param): Check `delete-before' and `parent-frame'
parameters for circular dependencies.
(frame_parms, syms_of_frame): Add entries for and define new
frame parameters.
(focus_follows_mouse): New meaningful value `auto-raise'.
* src/frame.h (z_group): New enumeration type.
(frame): New slots parent_frame, undecorated, override_redirect,
skip_taskbar, no_focus_on_map, no_accept_focus, z_group.
(fset_parent_frame): New inlined function.
(FRAME_UNDECORATED, FRAME_OVERRIDE_REDIRECT)
(FRAME_PARENT_FRAME, FRAME_SKIP_TASKBAR, FRAME_NO_FOCUS_ON_MAP)
(FRAME_NO_ACCEPT_FOCUS, FRAME_Z_GROUP, FRAME_Z_GROUP_NONE)
(FRAME_Z_GROUP_ABOVE, FRAME_Z_GROUP_ABOVE_SUSPENDED)
(FRAME_Z_GROUP_BELOW): New macros.
(frame_ancestor_p): Add declaration.
* src/gtkutil.c (xg_create_frame_widgets): Handle
`undecorated' and `override-redirect' frame parameters.
(x_wm_set_size_hint): None for child frames.
(xg_set_undecorated, xg_frame_restack, xg_set_skip_taskbar)
(xg_set_no_focus_on_map, xg_set_no_accept_focus)
(xg_set_override_redirect): New functions.
(xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos):
Don't let scrollbars obscure child frames.
* src/gtkutil.h: (xg_set_undecorated, xg_frame_restack)
(xg_set_skip_taskbar, xg_set_no_focus_on_map)
(xg_set_no_accept_focus, xg_set_override_redirect): Add extern
declarations.
* src/nsfns.m (ns_frame_parm_handlers): Add entries for new
frame parameters.
(Fx_create_frame): Install `min-width' and `min-height' frame
parameters.
* src/nsterm.m (mouseMoved:): Handle focus_follows_mouse change.
* src/w32fns.c (WS_EX_NOACTIVATE): Define if necessary.
(x_real_positions): Handle child frames.
(x_set_menu_bar_lines): Don't for child frames.
(x_set_undecorated, x_set_parent_frame, x_set_skip_taskbar)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_z_group): New functions.
(w32_createvscrollbar, w32_createhscrollbar): Don't draw
scroll bars over child frames.
(w32_createwindow): Handle new frame parameters and child frames.
(w32_wnd_proc): Let mouse clicks into a child frame activate
the frame. Try to handle the `no-accept-focus' parameter. Do
SetFocus when our window is brought to top or becomes the
foreground window.
(w32_window): Don't initialize menu bar for child frames.
(Fx_create_frame): Handle new frame parameters.
(x_create_tip_frame): Set explicit_parent slot.
(w32_dialog_in_progress): New function.
(Fx_file_dialog): Handle `z-group-above' frames.
(w32_frame_list_z_order, Fw32_frame_list_z_order)
(w32_frame_restack, Fw32_frame_restack): New functions.
(w32_frame_parm_handlers): Add entries for new frame
parameters.
* src/w32font.c (Fx_select_font): Handle `z-group-above'
frames during font selection dialogue.
* src/w32term.c (construct_mouse_wheel): Construct mouse wheel
event from F's w32 window.
(w32_mouse_position): Handle child frames.
(w32_set_vertical_scroll_bar, w32_set_horizontal_scroll_bar):
Don't draw scroll bars over child frames.
(w32_read_socket): Always erase background of child frames.
When generating SELECT_WINDOW_EVENTs handle new value of
`focus-follows-mouse' and handle `no-accept-focus' parameter.
Handle `mouse-wheel-frame' parameter.
(x_calc_absolute_position, x_set_offset, x_set_window_size):
Handle child frames.
(x_make_frame_visible): Handle child frames specially. Handle
`no-focus-on-map' parameter.
* src/w32term.h (w32_dialog_in_progress): Add external
declaration.
* src/xdisp.c (x_consider_frame_title, prepare_menu_bars): Not
for child frames.
* src/xfns.c (Xm/MwmUtil.h): Include for WM hints.
(PropMotifWmHints, PROP_MOTIF_WM_HINTS_ELEMENTS): Define for
non-Motif, non-GTK case.
(x_real_pos_and_offsets): Handle child frames.
(x_set_undecorated, x_set_parent_frame)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_override_redirect): New functions.
(x_set_menu_bar_lines): Not for child frames.
(x_window): Handle `undecorated' and `override_redirect' cases.
(Fx_create_frame): Handle new frame parameters.
(frame_geometry): Handle child frames and outer border.
(x_frame_list_z_order, Fx_frame_list_z_order)
(x_frame_restack, Fx_frame_restack): New functions.
(Fx_file_dialog, Fx_select_font): Set x_menu_set_in_use.
(x_frame_parm_handlers): Add entries for new frame parameters.
* src/xmenu.c (x_menu_set_in_use): Handle `z-group-above'
frames.
* src/xterm.c (x_set_frame_alpha): Don't set alpha of parent
for child frames.
(XTmouse_position): Handle child frames.
(x_scroll_bar_create, x_scroll_bar_expose): Don't let scroll
bars obscure child frames.
(handle_one_xevent): Handle child frame positions. If necessary
set `skip-taskbar' and reassign proper `z-group' when we are
mapped. When generating SELECT_WINDOW_EVENTs handle new value
of `focus-follows-mouse'. Handle `mouse-wheel-frame' parameter.
Let mouse clicks into a child frame activate the frame.
(x_calc_absolute_position, x_set_offset): Handle child frames
specially.
(x_set_skip_taskbar, x_set_z_group): New functions.
(x_make_frame_visible): Handle child frames.
(ATOM_REFS_INIT): Add entries for
Xatom_net_wm_state_skip_taskbar, Xatom_net_wm_state_above,
Xatom_net_wm_state_below.
* src/xterm.h (top-level): Declare Xatom_net_wm_state_above,
Xatom_net_wm_state_below and Xatom_net_wm_state_skip_taskbar.
(x_set_skip_taskbar, x_set_z_group): Add extern declarations.
2017-04-12 08:38:25 +00:00
|
|
|
|
(error "Cannot restack frames")))
|
|
|
|
|
|
2017-04-11 10:37:26 +00:00
|
|
|
|
(defun frame-size-changed-p (&optional frame)
|
|
|
|
|
"Return non-nil when the size of FRAME has changed.
|
|
|
|
|
More precisely, return non-nil when the inner width or height of
|
|
|
|
|
FRAME has changed since `window-size-change-functions' was run
|
|
|
|
|
for FRAME."
|
|
|
|
|
(let* ((frame (window-normalize-frame frame))
|
|
|
|
|
(root (frame-root-window frame))
|
|
|
|
|
(mini (minibuffer-window frame))
|
Run window change functions during redisplay
* doc/lispref/windows.texi (Window Sizes): Move (and rename)
descriptions of 'window-pixel-height-before-size-change' and
'window-pixel-width-before-size-change' to Window Hooks
section.
(Window Configurations): Remove warning against use of
'save-window-excursion' in 'window-size-change-functions'.
(Window Hooks): Rewrite section according to redesign of
window change functions.
* lisp/erc/erc-track.el (erc-window-configuration-change)
(erc-modified-channels-update): Call latter directly from
'window-configuration-change-hook' instead via
'post-command-hook'.
* lisp/frame.el (frame-size-changed-p): Change nomenclature
in let bindings.
* lisp/net/rcirc.el (rcirc-window-configuration-change)
(rcirc-window-configuration-change-1): Call latter directly
from 'window-configuration-change-hook' instead via
'post-command-hook'.
* lisp/window.el (window-pixel-width-before-size-change)
(window-pixel-height-before-size-change): Defalias.
(window--resize-mini-window, window-resize)
(adjust-window-trailing-edge, delete-window)
(delete-other-windows, balance-windows): Don't run
'window-configuration-change-hook' any more from here.
(split-window): Don't run 'window-configuration-change-hook'
from here. 'run-window-scroll-functions' from here.
(window--adjust-process-windows): Run from
'window-configuration-change-hook' only.
* src/frame.c (old_selected_frame): New Lisp variable.
(make_frame): Initialize frame's change_stamp slot.
(Fold_selected_frame): New function.
* src/frame.h (struct frame): New slots old_selected_window,
window_change, change_stamp and number_of_windows.
(fset_old_selected_window): New inlined function.
(FRAME_WINDOW_CHANGE, FRAME_OLD_SELECTED_WINDOW): New macros.
* src/window.c (old_selected_window): New Lisp variable.
(wset_old_buffer): New inlined function.
(Fframe_old_selected_window, Fold_selected_window)
(Fwindow_old_buffer): New functions.
(Fwindow_old_pixel_width, Fwindow_old_pixel_height): Rename
from Fwindow_pixel_width_before_size_change and
Fwindow_pixel_height_before_size_change. Update doc-strings.
(Fwindow_old_body_pixel_width, Fwindow_old_body_pixel_height):
New functions.
(Fdelete_other_windows_internal): Set frame's window_change
slot instead of running 'window-configuration-change-hook'.
(Frun_window_configuration_change_hook): In doc-string tell
that this function is no more needed.
(Frun_window_scroll_functions): Amend doc-string. Run with
window's buffer current.
(window_sub_list, window_change_record_windows)
(window_change_record_frame, window_change_record)
(run_window_change_functions_1, run_window_change_functions):
New functions.
(set_window_buffer): Set frame's window_change slot instead of
running 'window-configuration-change-hook'.
(make_window): Don't initialize pixel_width_before_size_change
and pixel_height_before_size_change slots.
(window_resize_apply, Fdelete_window_internal): Set frame's
window_change slot.
(Fsplit_window_internal): Set frame's window_change slot.
Don't run 'window-scroll-functions' from here.
* src/window.h (struct window): New slots old_buffer,
change_stamp, old_pixel_width (renamed from
pixel_width_before_size_change), old_pixel_height (renamed
from pixel_height_before_size_change), old_body_pixel_width
and old_body_pixel_height.
* src/xdisp.c (init_iterator): Set frame's window_change slot
when the body height or width changes.
(prepare_menu_bars): Don't run_window_size_change_functions.
(redisplay_internal): Don't run_window_size_change_functions,
run_window_change_functions instead.
2019-01-11 09:02:47 +00:00
|
|
|
|
(mini-old-height 0)
|
2017-04-11 10:37:26 +00:00
|
|
|
|
(mini-height 0))
|
|
|
|
|
;; FRAME's minibuffer window counts iff it's on FRAME and FRAME is
|
|
|
|
|
;; not a minibuffer-only frame.
|
|
|
|
|
(when (and (eq (window-frame mini) frame) (not (eq mini root)))
|
Run window change functions during redisplay
* doc/lispref/windows.texi (Window Sizes): Move (and rename)
descriptions of 'window-pixel-height-before-size-change' and
'window-pixel-width-before-size-change' to Window Hooks
section.
(Window Configurations): Remove warning against use of
'save-window-excursion' in 'window-size-change-functions'.
(Window Hooks): Rewrite section according to redesign of
window change functions.
* lisp/erc/erc-track.el (erc-window-configuration-change)
(erc-modified-channels-update): Call latter directly from
'window-configuration-change-hook' instead via
'post-command-hook'.
* lisp/frame.el (frame-size-changed-p): Change nomenclature
in let bindings.
* lisp/net/rcirc.el (rcirc-window-configuration-change)
(rcirc-window-configuration-change-1): Call latter directly
from 'window-configuration-change-hook' instead via
'post-command-hook'.
* lisp/window.el (window-pixel-width-before-size-change)
(window-pixel-height-before-size-change): Defalias.
(window--resize-mini-window, window-resize)
(adjust-window-trailing-edge, delete-window)
(delete-other-windows, balance-windows): Don't run
'window-configuration-change-hook' any more from here.
(split-window): Don't run 'window-configuration-change-hook'
from here. 'run-window-scroll-functions' from here.
(window--adjust-process-windows): Run from
'window-configuration-change-hook' only.
* src/frame.c (old_selected_frame): New Lisp variable.
(make_frame): Initialize frame's change_stamp slot.
(Fold_selected_frame): New function.
* src/frame.h (struct frame): New slots old_selected_window,
window_change, change_stamp and number_of_windows.
(fset_old_selected_window): New inlined function.
(FRAME_WINDOW_CHANGE, FRAME_OLD_SELECTED_WINDOW): New macros.
* src/window.c (old_selected_window): New Lisp variable.
(wset_old_buffer): New inlined function.
(Fframe_old_selected_window, Fold_selected_window)
(Fwindow_old_buffer): New functions.
(Fwindow_old_pixel_width, Fwindow_old_pixel_height): Rename
from Fwindow_pixel_width_before_size_change and
Fwindow_pixel_height_before_size_change. Update doc-strings.
(Fwindow_old_body_pixel_width, Fwindow_old_body_pixel_height):
New functions.
(Fdelete_other_windows_internal): Set frame's window_change
slot instead of running 'window-configuration-change-hook'.
(Frun_window_configuration_change_hook): In doc-string tell
that this function is no more needed.
(Frun_window_scroll_functions): Amend doc-string. Run with
window's buffer current.
(window_sub_list, window_change_record_windows)
(window_change_record_frame, window_change_record)
(run_window_change_functions_1, run_window_change_functions):
New functions.
(set_window_buffer): Set frame's window_change slot instead of
running 'window-configuration-change-hook'.
(make_window): Don't initialize pixel_width_before_size_change
and pixel_height_before_size_change slots.
(window_resize_apply, Fdelete_window_internal): Set frame's
window_change slot.
(Fsplit_window_internal): Set frame's window_change slot.
Don't run 'window-scroll-functions' from here.
* src/window.h (struct window): New slots old_buffer,
change_stamp, old_pixel_width (renamed from
pixel_width_before_size_change), old_pixel_height (renamed
from pixel_height_before_size_change), old_body_pixel_width
and old_body_pixel_height.
* src/xdisp.c (init_iterator): Set frame's window_change slot
when the body height or width changes.
(prepare_menu_bars): Don't run_window_size_change_functions.
(redisplay_internal): Don't run_window_size_change_functions,
run_window_change_functions instead.
2019-01-11 09:02:47 +00:00
|
|
|
|
(setq mini-old-height (window-old-pixel-height mini))
|
2017-04-11 10:37:26 +00:00
|
|
|
|
(setq mini-height (window-pixel-height mini)))
|
|
|
|
|
;; Return non-nil when either the width of the root or the sum of
|
|
|
|
|
;; the heights of root and minibuffer window changed.
|
Run window change functions during redisplay
* doc/lispref/windows.texi (Window Sizes): Move (and rename)
descriptions of 'window-pixel-height-before-size-change' and
'window-pixel-width-before-size-change' to Window Hooks
section.
(Window Configurations): Remove warning against use of
'save-window-excursion' in 'window-size-change-functions'.
(Window Hooks): Rewrite section according to redesign of
window change functions.
* lisp/erc/erc-track.el (erc-window-configuration-change)
(erc-modified-channels-update): Call latter directly from
'window-configuration-change-hook' instead via
'post-command-hook'.
* lisp/frame.el (frame-size-changed-p): Change nomenclature
in let bindings.
* lisp/net/rcirc.el (rcirc-window-configuration-change)
(rcirc-window-configuration-change-1): Call latter directly
from 'window-configuration-change-hook' instead via
'post-command-hook'.
* lisp/window.el (window-pixel-width-before-size-change)
(window-pixel-height-before-size-change): Defalias.
(window--resize-mini-window, window-resize)
(adjust-window-trailing-edge, delete-window)
(delete-other-windows, balance-windows): Don't run
'window-configuration-change-hook' any more from here.
(split-window): Don't run 'window-configuration-change-hook'
from here. 'run-window-scroll-functions' from here.
(window--adjust-process-windows): Run from
'window-configuration-change-hook' only.
* src/frame.c (old_selected_frame): New Lisp variable.
(make_frame): Initialize frame's change_stamp slot.
(Fold_selected_frame): New function.
* src/frame.h (struct frame): New slots old_selected_window,
window_change, change_stamp and number_of_windows.
(fset_old_selected_window): New inlined function.
(FRAME_WINDOW_CHANGE, FRAME_OLD_SELECTED_WINDOW): New macros.
* src/window.c (old_selected_window): New Lisp variable.
(wset_old_buffer): New inlined function.
(Fframe_old_selected_window, Fold_selected_window)
(Fwindow_old_buffer): New functions.
(Fwindow_old_pixel_width, Fwindow_old_pixel_height): Rename
from Fwindow_pixel_width_before_size_change and
Fwindow_pixel_height_before_size_change. Update doc-strings.
(Fwindow_old_body_pixel_width, Fwindow_old_body_pixel_height):
New functions.
(Fdelete_other_windows_internal): Set frame's window_change
slot instead of running 'window-configuration-change-hook'.
(Frun_window_configuration_change_hook): In doc-string tell
that this function is no more needed.
(Frun_window_scroll_functions): Amend doc-string. Run with
window's buffer current.
(window_sub_list, window_change_record_windows)
(window_change_record_frame, window_change_record)
(run_window_change_functions_1, run_window_change_functions):
New functions.
(set_window_buffer): Set frame's window_change slot instead of
running 'window-configuration-change-hook'.
(make_window): Don't initialize pixel_width_before_size_change
and pixel_height_before_size_change slots.
(window_resize_apply, Fdelete_window_internal): Set frame's
window_change slot.
(Fsplit_window_internal): Set frame's window_change slot.
Don't run 'window-scroll-functions' from here.
* src/window.h (struct window): New slots old_buffer,
change_stamp, old_pixel_width (renamed from
pixel_width_before_size_change), old_pixel_height (renamed
from pixel_height_before_size_change), old_body_pixel_width
and old_body_pixel_height.
* src/xdisp.c (init_iterator): Set frame's window_change slot
when the body height or width changes.
(prepare_menu_bars): Don't run_window_size_change_functions.
(redisplay_internal): Don't run_window_size_change_functions,
run_window_change_functions instead.
2019-01-11 09:02:47 +00:00
|
|
|
|
(or (/= (window-old-pixel-width root) (window-pixel-width root))
|
|
|
|
|
(/= (+ (window-old-pixel-height root) mini-old-height)
|
2017-04-11 10:37:26 +00:00
|
|
|
|
(+ (window-pixel-height root) mini-height)))))
|
1992-07-15 00:32:19 +00:00
|
|
|
|
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
;;;; Frame/display capabilities.
|
Implemented display ids for multiple emacsclients on the same tty. Plus assorted bugfixes.
* lisp/frame.el (make-frame-on-display): Update doc.
(make-frame): Handle display-id parameter. Update doc.
(frames-on-display-list): Update for display ids.
(framep-on-display): Ditto.
(suspend-frame): Use display-name, not frame-tty-name.
(selected-display): New function.
* lisp/server.el (server-delete-client): Use delete-display, not delete-tty.
(server-tty-live-p, server-handle-delete-tty): Removed.
(server-handle-delete-frame): Delete tty clients, if needed.
(server-process-filter): Set the display parameter, and use it when appropriate.
(server-handle-suspend-tty): Use the display parameter.
(server-start, server-unload-hook): Removed obsolete delete-tty hook.
* lisp/talk.el (talk): Always use talk-add-display.
(talk-add-tty-frame, talk-handle-delete-tty): Removed.
(talk-handle-delete-frame): New function.
(talk-add-display): Open a new frame only if parameter was not a frame.
* src/dispextern.h (get_display, Fdisplay_tty_type): New prototypes.
(Fframe_tty_type): Removed.
* src/dispnew.c (init_display): Use Fdisplay_tty_type, not Fframe_tty_type.
* src/frame.c (Qdisplay_id, Qdisplay_live_p): New symbols.
(make_terminal_frame): Get display as a parameter.
(Fmake_terminal_frame): Get/create display here; pass it to
make_terminal_frame.
(Fframe_display): New function.
(Fdelete_frame): Stop if the hook deleted the frame.
(syms_of_frame): Register new stuff.
* src/frame.h (Qdisplay_id, Qdisplay_live_p, make_terminal_frame):
Updated prototypes.
* src/keyboard.c (interrupt_signal): Updated comment.
* src/term.c (Vdelete_tty_after_functions): Removed variable.
(Qframe_tty_name, Qframe_tty_type): Removed.
(next_display_id): New var.
(tty_ring_bell): Don't do anything on suspended frames.
(Ftty_display_color_p, Ftty_display_color_cells): Doc update.
(get_display): New function.
(get_tty_display): Use it.
(get_named_tty_display): Ignore suspended displays.
(Fframe_tty_name): Renamed to Fdisplay_name. Handle all kinds of
displays.
(Fframe_tty_type): Renamed to Fdisplay_tty_type.
(init_initial_display): Set display name.
(term_init): Allow more displays on the same device. Set display name.
(Fdelete_tty): Removed.
(delete_tty): Don't run hooks.
(create_display): Set display id.
(delete_display): Free display name.
(Fdelete_display, Fdisplay_live_p, Fdisplay_list): New functions.
(Fsuspend_tty): Call hook with display id. Doc update.
(Fresume_tty): Refuse to resume when there is already an active display
on the same device. Call hook with display id. Doc update.
(syms_of_term): Reflect above changes.
* src/termhooks.h (struct display): Added `id' and `name' members.
(DISPLAY_ACTIVE_P): New macro.
* src/xfns.c (check_x_display_info): Handle display ids.
(Fx_create_frame): Try to get display from `display-id' parameter.
* src/xterm.c (x_term_init): Set display name.
(x_delete_display): Handle the case when `font_table' is NULL.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-207
2004-07-04 04:48:55 +00:00
|
|
|
|
|
2019-04-06 07:16:16 +00:00
|
|
|
|
;; These functions should make the features they test explicit in
|
|
|
|
|
;; their names, so that when capabilities or the corresponding Emacs
|
|
|
|
|
;; features change, it will be easy to find all the tests for such
|
|
|
|
|
;; capabilities by a simple text search. See more about the history
|
|
|
|
|
;; and the intent of these functions in
|
2020-10-24 18:22:33 +00:00
|
|
|
|
;; https://lists.gnu.org/archive/html/bug-gnu-emacs/2019-04/msg00004.html
|
2019-04-06 07:16:16 +00:00
|
|
|
|
;; or in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=35058#17.
|
|
|
|
|
|
2007-11-22 01:05:55 +00:00
|
|
|
|
(declare-function msdos-mouse-p "dosfns.c")
|
|
|
|
|
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(defun display-mouse-p (&optional display)
|
|
|
|
|
"Return non-nil if DISPLAY has a mouse available.
|
|
|
|
|
DISPLAY can be a display name, a frame, or nil (meaning the selected
|
|
|
|
|
frame's display)."
|
|
|
|
|
(let ((frame-type (framep-on-display display)))
|
|
|
|
|
(cond
|
|
|
|
|
((eq frame-type 'pc)
|
|
|
|
|
(msdos-mouse-p))
|
2012-09-17 11:55:02 +00:00
|
|
|
|
((eq frame-type 'w32)
|
2004-08-22 16:54:33 +00:00
|
|
|
|
(with-no-warnings
|
|
|
|
|
(> w32-num-mouse-buttons 0)))
|
Add support for the Haiku operating system and its window system
* .gitignore: Add binaries specific to Haiku.
* Makefie.in (HAVE_BE_APP): New variable.
(install-arch-dep): Install Emacs and Emacs.pdmp when
using Haiku.
* configure.ac: Detect and configure for Haiku and
various related configurations.
(be-app, be-freetype, be-cairo): New options.
(HAVE_BE_APP, HAIKU_OBJ, HAIKU_CXX_OBJ)
(HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(HAIKU, HAVE_TINY_SPEED_T): New define.
(emacs_config_features): Add BE_APP.
* doc/emacs/Makefile.in (EMACSSOURCES): Add Haiku
appendix.
* doc/emacs/emacs.texi: Add Haiku appendix to menus and
include it.
* doc/emacs/haiku.texi: New Haiku appendix.
* doc/lispref/display.texi (Defining Faces, Window Systems):
Explain meaning of `haiku' as a window system identifier.
(haiku-use-system-tooltips): Explain meaning of system
tooltips on
Haiku.
* doc/lispref/frames.texi (Multiple Terminals): Explain
meaning of haiku as a display type.
(Frame Layout): Clarify section for Haiku frames.
(Size Parameters): Explain limitations of fullwidth and
fullheight on Haiku.
(Management Parameters): Explain limitations of
inhibiting double buffering on builds with Cairo,
and the inability of frames with no-accept-focus to
receive keyboard input on Haiku.
(Font and Color Parameters): Explain the different font
backends available on Haiku.
(Raising and Lowering): Explain that lowering and
restacking frames doesn't work on Haiku.
(Child Frames): Explain oddities of child frame
visibility on Haiku.
* doc/lispref/os.texi (System Environment): Explain
meaning of haiku.
* etc/MACHINES: Add appropriate notices for Haiku.
* etc/NEWS: Document changes.
* etc/PROBLEMS: Document font spacing bug on Haiku.
* lib-src/Makefile.in: Build be-resources binary on
Haiku.
(CXX, CXXFLAGS, NON_CXX_FLAGS, ALL_CXXFLAGS)
(HAVE_BE_APP, HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(DONT_INSTALL): Add be-resources binary if on Haiku.
(be-resources): New target.
* lib-src/be_resources: Add helper binary for setting
resources on the Emacs application.
* lib-src/emacsclient.c (decode_options): Set
alt_display to "be" on Haiku.
* lisp/cus-edit.el (custom-button, custom-button-mouse)
(custom-button-unraised, custom-button-pressed): Update
face definitions for Haiku.
* lisp/cus-start.el: Add haiku-debug-on-fatal-error and
haiku-use-system-tooltips.
* lisp/faces.el (face-valid-attribute-values): Clarify
attribute comment for Haiku.
(tool-bar): Add appropriate toolbar color for Haiku.
* lisp/frame.el (haiku-frame-geometry)
(haiku-mouse-absolute-pixel-position)
(haiku-set-mouse-absolute-pixel-position)
(haiku-frame-edges)
(haiku-frame-list-z-order): New function declarations.
(frame-geometry, frame-edges)
(mouse-absolute-pixel-position)
(set-mouse-absolute-pixel-position)
(frame-list-z-order): Call appropriate window system
functions on Haiku.
(display-mouse-p, display-graphic-p)
(display-images-p, display-pixel-height)
(display-pixel-width, display-mm-height)
(display-mm-width, display-backing-store)
(display-save-under, display-planes)
(display-color-cells, display-visual-class): Update type
tests for Haiku.
* lisp/international/mule-cmds.el
(set-coding-system-map): Also
prevent set-terminal-coding-system from appearing in the menu
bar on Haiku.
* lisp/loadup.el: Load Haiku-specific files when built
with Haiku, and don't rename newly built Emacs on Haiku as BFS
doesn't support hard links.
* lisp/menu-bar.el (menu-bar-open): Add for Haiku.
* lisp/mwheel.el (mouse-wheel-down-event): Expect
wheel-up on Haiku.
(mouse-wheel-up-event): Expect wheel-down on Haiku.
(mouse-wheel-left-event): Expect wheel-left on Haiku.
(mouse-wheel-right-event): Expect wheel-right on Haiku.
* lisp/net/browse-url.el
(browse-url--browser-defcustom-type):
Add option for WebPositive.
(browse-url-webpositive-program): New variable.
(browse-url-default-program): Search for WebPositive.
(browse-url-webpositive): New function.
* lisp/net/eww.el (eww-form-submit, eww-form-file)
(eww-form-checkbox, eww-form-select): Define faces
appropriately for Haiku.
* lisp/term/haiku-win.el: New file.
* lisp/tooltip.el (menu-or-popup-active-p): New function
declaration.
(tooltip-show-help): Don't use tooltips on Haiku when a
menu is active.
* lisp/version.el (haiku-get-version-string): New
function declaration.
(emacs-version): Add Haiku version string if
appropriate.
* src/Makefile.in: Also produce binary named "Emacs"
with Haiku resources set.
(CXX, HAIKU_OBJ, HAIKU_CXX_OBJ, HAIKU_LIBS)
(HAIKU_CFLAGS, HAVE_BE_APP, NON_CXX_FLAGS)
(ALL_CXX_FLAGS): New variables.
(.SUFFIXES): Add .cc.
(.cc.o): New target.
(base_obj): Add Haiku C objects.
(doc_obj, obj): Split objects that should scanned for
documentation into doc_obj.
(SOME_MACHINE_OBJECTS): Add appropriate Haiku C objects.
(all): Depend on Emacs and Emacs.pdmp on Haiku.
(LIBES): Add Haiku libraries.
(gl-stamp)
($(etc)/DOC): Scan doc_obj instead of obj
(temacs$(EXEEXT): Use C++ linker on Haiku.
(ctagsfiles3): New variable.
(TAGS): Scan C++ files.
* src/alloc.c (garbage_collect): Mark Haiku display.
* src/dispextern.h (HAVE_NATIVE_TRANSFORMS): Also enable
on Haiku.
(struct image): Add fields for Haiku transforms.
(RGB_PIXEL_COLOR): Define to unsigned long on Haiku as
well.
(sit_for): Also check USABLE_SIGPOLL.
(init_display_interactive): Set initial window system to
Haiku on Haiku builds.
* src/emacs.c (main): Define Haiku syms and init haiku
clipboard.
(shut_down_emacs): Quit BApplication on Haiku and
trigger debug
on aborts if haiku_debug_on_fatal_error.
(Vsystem_type): Update docstring.
* src/fileio.c (next-read-file-uses-dialog-p): Enable on
Haiku.
* src/filelock.c (WTMP_FILE): Only define if BOOT_TIME
is also defined.
* src/floatfns.c (double_integer_scale): Work around
Haiku libroot brain damage.
* src/font.c (syms_of_font): Define appropriate font
driver symbols for Haiku builds with various options.
* src/font.h: Also enable ftcrfont on Haiku builds with
Cairo.
(font_data_structures_may_be_ill_formed): Also enable on
Haiku builds that have Cairo.
* src/frame.c (Fframep): Update doc-string for Haiku
builds and return haiku if appropriate.
(syms_of_frame): New symbol `haiku'.
* src/frame.h (struct frame): Add output data for Haiku.
(FRAME_HAIKU_P): New macro.
(FRAME_WINDOW_P): Test for Haiku frames as well.
* src/ftcrfont.c (RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG): New macros.
(ftcrfont_draw): Add haiku specific code for Haiku
builds with Cairo.
* src/ftfont.c (ftfont_open): Set face.
(ftfont_has_char, ftfont_text_extents): Work around
crash.
(syms_of_ftfont): New symbol `mono'.
* src/ftfont.h (struct font_info): Enable Cairo-specific
fields for Cairo builds on Haiku.
* src/haiku_draw_support.cc:
* src/haiku_font_support.cc:
* src/haiku_io.c:
* src/haiku_select.cc:
* src/haiku_support.cc:
* src/haiku_support.h:
* src/haikufns.c:
* src/haikufont.c:
* src/haikugui.h:
* src/haikuimage.c:
* src/haikumenu.c:
* src/haikuselect.c:
* src/haikuselect.h:
* src/haikuterm.c:
* src/haikuterm.h: Add new files for Haiku windowing
support.
* src/haiku.c: Add new files for Haiku operating system
support.
* src/image.c: Implement image transforms and native XPM
support
on Haiku.
(GET_PIXEL, PUT_PIXEL, NO_PIXMAP)
(PIX_MASK_RETAIN, PIX_MASK_DRAW)
(RGB_TO_ULONG, RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG, RED16_FROM_ULONG, GREEN16_FROM_ULONG)
(BLUE16_FROM_ULONG): Define to appropriate values on
Haiku.
(image_create_bitmap_from_data): Add Haiku support.
(image_create_bitmap_from_file): Add TODO on Haiku.
(free_bitmap_record): Free bitmap on Haiku.
(image_size_in_bytes): Implement for Haiku bitmaps.
(image_set_transform): Implement on Haiku.
(image_create_x_image_and_pixmap_1): Implement on Haiku,
24-bit or 1-bit only.
(image_destroy_x_image, image_get_x_image): Use correct
img and pixmap values on Haiku.
(lookup_rgb_color): Use correct macro on Haiku.
(image_to_emacs_colors): Implement on Haiku.
(image_disable_image): Disable on Haiku.
(image_can_use_native_api): Test for translator presence
on Haiku.
(native_image_load): Use translator on Haiku.
(imagemagick_load_image): Add Haiku-specific quirks.
(Fimage_transforms_p): Allow rotate90 on Haiku.
(image_types): Enable native XPM support on Haiku.
(syms_of_image): Enable XPM images on Haiku.
* src/keyboard.c (kbd_buffer_get_event)
(handle_async_input, handle_input_available_signal)
(handle_user_signal, Fset_input_interrupt_mode)
(init_keyboard): Check for USABLE_SIGPOLL along with
USABLE_SIGIO.
* src/lisp.h (pD): Work around broken Haiku headers.
(HAVE_EXT_MENU_BAR): Define on Haiku.
(handle_input_available_signal): Enable if we just have
SIGPOLL as well.
* src/menu.c (have_boxes): Return true on Haiku.
(single_menu_item): Enable toolkit menus on Haiku.
(find_and_call_menu_selection): Also enable on Haiku.
* src/process.c (keyboard_bit_set): Enable with only
usable SIGPOLL.
(wait_reading_process_output): Test for SIGPOLL as well
as SIGIO availability.
* src/sound.c (sound_perror, vox_open)
(vox_configure, vox_close): Enable for usable SIGPOLL as
well.
* src/sysdep.c (sys_subshell): Enable for usable SIGPOLL.
(reset_sigio): Make conditional on F_SETOWN.
(request_sigio, unrequest_sigio)
(emacs_sigaction_init): Also handle SIGPOLLs.
(init_sys_modes): Disable TCXONC usage on Haiku, as it
doesn't have any ttys other than pseudo ttys, which don't
support C-s/C-q flow control, and causes compiler warnings.
(speeds): Disable high speeds if HAVE_TINY_SPEED_T.
* src/termhooks.h (enum output_method): Add output_haiku.
(struct terminal): Add Haiku display info.
(TERMINAL_FONT_CACHE): Enable for Haiku.
* src/terminal.c (Fterminal_live_p): Return `haiku' if
appropriate.
* src/verbose.mk.in (AM_V_CXX, AM_V_CXXLD): New logging
variables.
* src/xdisp.c (redisplay_internal)
(note_mouse_highlight): Return on Haiku if a popup is activated.
(display_menu_bar): Return on Haiku if frame is a Haiku
frame.
* src/xfaces.c (GCGraphicsExposures): Enable correctly on Haiku.
(x_create_gc): Enable dummy GC code on Haiku.
* src/xfns.c (x-server-version, x-file-dialog): Add
Haiku specifics to doc strings.
* src/xterm.c (syms_of_xterm): Add Haiku information to
doc string.
2021-11-20 13:30:08 +00:00
|
|
|
|
((memq frame-type '(x ns haiku))
|
|
|
|
|
t) ;; We assume X, NeXTstep and Haiku *always* have a pointing device
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(t
|
2000-02-20 12:34:49 +00:00
|
|
|
|
(or (and (featurep 'xt-mouse)
|
|
|
|
|
xterm-mouse-mode)
|
|
|
|
|
;; t-mouse is distributed with the GPM package. It doesn't have
|
|
|
|
|
;; a toggle.
|
2013-10-02 18:44:40 +00:00
|
|
|
|
(featurep 't-mouse)
|
|
|
|
|
;; No way to check whether a w32 console has a mouse, assume
|
|
|
|
|
;; it always does.
|
|
|
|
|
(boundp 'w32-use-full-screen-buffer))))))
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
|
|
|
|
|
(defun display-popup-menus-p (&optional display)
|
|
|
|
|
"Return non-nil if popup menus are supported on DISPLAY.
|
|
|
|
|
DISPLAY can be a display name, a frame, or nil (meaning the selected
|
|
|
|
|
frame's display).
|
|
|
|
|
Support for popup menus requires that the mouse be available."
|
2013-10-02 18:44:40 +00:00
|
|
|
|
(display-mouse-p display))
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
|
|
|
|
|
(defun display-graphic-p (&optional display)
|
|
|
|
|
"Return non-nil if DISPLAY is a graphic display.
|
|
|
|
|
Graphical displays are those which are capable of displaying several
|
|
|
|
|
frames and several different fonts at once. This is true for displays
|
|
|
|
|
that use a window system such as X, and false for text-only terminals.
|
|
|
|
|
DISPLAY can be a display name, a frame, or nil (meaning the selected
|
|
|
|
|
frame's display)."
|
Add support for the Haiku operating system and its window system
* .gitignore: Add binaries specific to Haiku.
* Makefie.in (HAVE_BE_APP): New variable.
(install-arch-dep): Install Emacs and Emacs.pdmp when
using Haiku.
* configure.ac: Detect and configure for Haiku and
various related configurations.
(be-app, be-freetype, be-cairo): New options.
(HAVE_BE_APP, HAIKU_OBJ, HAIKU_CXX_OBJ)
(HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(HAIKU, HAVE_TINY_SPEED_T): New define.
(emacs_config_features): Add BE_APP.
* doc/emacs/Makefile.in (EMACSSOURCES): Add Haiku
appendix.
* doc/emacs/emacs.texi: Add Haiku appendix to menus and
include it.
* doc/emacs/haiku.texi: New Haiku appendix.
* doc/lispref/display.texi (Defining Faces, Window Systems):
Explain meaning of `haiku' as a window system identifier.
(haiku-use-system-tooltips): Explain meaning of system
tooltips on
Haiku.
* doc/lispref/frames.texi (Multiple Terminals): Explain
meaning of haiku as a display type.
(Frame Layout): Clarify section for Haiku frames.
(Size Parameters): Explain limitations of fullwidth and
fullheight on Haiku.
(Management Parameters): Explain limitations of
inhibiting double buffering on builds with Cairo,
and the inability of frames with no-accept-focus to
receive keyboard input on Haiku.
(Font and Color Parameters): Explain the different font
backends available on Haiku.
(Raising and Lowering): Explain that lowering and
restacking frames doesn't work on Haiku.
(Child Frames): Explain oddities of child frame
visibility on Haiku.
* doc/lispref/os.texi (System Environment): Explain
meaning of haiku.
* etc/MACHINES: Add appropriate notices for Haiku.
* etc/NEWS: Document changes.
* etc/PROBLEMS: Document font spacing bug on Haiku.
* lib-src/Makefile.in: Build be-resources binary on
Haiku.
(CXX, CXXFLAGS, NON_CXX_FLAGS, ALL_CXXFLAGS)
(HAVE_BE_APP, HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(DONT_INSTALL): Add be-resources binary if on Haiku.
(be-resources): New target.
* lib-src/be_resources: Add helper binary for setting
resources on the Emacs application.
* lib-src/emacsclient.c (decode_options): Set
alt_display to "be" on Haiku.
* lisp/cus-edit.el (custom-button, custom-button-mouse)
(custom-button-unraised, custom-button-pressed): Update
face definitions for Haiku.
* lisp/cus-start.el: Add haiku-debug-on-fatal-error and
haiku-use-system-tooltips.
* lisp/faces.el (face-valid-attribute-values): Clarify
attribute comment for Haiku.
(tool-bar): Add appropriate toolbar color for Haiku.
* lisp/frame.el (haiku-frame-geometry)
(haiku-mouse-absolute-pixel-position)
(haiku-set-mouse-absolute-pixel-position)
(haiku-frame-edges)
(haiku-frame-list-z-order): New function declarations.
(frame-geometry, frame-edges)
(mouse-absolute-pixel-position)
(set-mouse-absolute-pixel-position)
(frame-list-z-order): Call appropriate window system
functions on Haiku.
(display-mouse-p, display-graphic-p)
(display-images-p, display-pixel-height)
(display-pixel-width, display-mm-height)
(display-mm-width, display-backing-store)
(display-save-under, display-planes)
(display-color-cells, display-visual-class): Update type
tests for Haiku.
* lisp/international/mule-cmds.el
(set-coding-system-map): Also
prevent set-terminal-coding-system from appearing in the menu
bar on Haiku.
* lisp/loadup.el: Load Haiku-specific files when built
with Haiku, and don't rename newly built Emacs on Haiku as BFS
doesn't support hard links.
* lisp/menu-bar.el (menu-bar-open): Add for Haiku.
* lisp/mwheel.el (mouse-wheel-down-event): Expect
wheel-up on Haiku.
(mouse-wheel-up-event): Expect wheel-down on Haiku.
(mouse-wheel-left-event): Expect wheel-left on Haiku.
(mouse-wheel-right-event): Expect wheel-right on Haiku.
* lisp/net/browse-url.el
(browse-url--browser-defcustom-type):
Add option for WebPositive.
(browse-url-webpositive-program): New variable.
(browse-url-default-program): Search for WebPositive.
(browse-url-webpositive): New function.
* lisp/net/eww.el (eww-form-submit, eww-form-file)
(eww-form-checkbox, eww-form-select): Define faces
appropriately for Haiku.
* lisp/term/haiku-win.el: New file.
* lisp/tooltip.el (menu-or-popup-active-p): New function
declaration.
(tooltip-show-help): Don't use tooltips on Haiku when a
menu is active.
* lisp/version.el (haiku-get-version-string): New
function declaration.
(emacs-version): Add Haiku version string if
appropriate.
* src/Makefile.in: Also produce binary named "Emacs"
with Haiku resources set.
(CXX, HAIKU_OBJ, HAIKU_CXX_OBJ, HAIKU_LIBS)
(HAIKU_CFLAGS, HAVE_BE_APP, NON_CXX_FLAGS)
(ALL_CXX_FLAGS): New variables.
(.SUFFIXES): Add .cc.
(.cc.o): New target.
(base_obj): Add Haiku C objects.
(doc_obj, obj): Split objects that should scanned for
documentation into doc_obj.
(SOME_MACHINE_OBJECTS): Add appropriate Haiku C objects.
(all): Depend on Emacs and Emacs.pdmp on Haiku.
(LIBES): Add Haiku libraries.
(gl-stamp)
($(etc)/DOC): Scan doc_obj instead of obj
(temacs$(EXEEXT): Use C++ linker on Haiku.
(ctagsfiles3): New variable.
(TAGS): Scan C++ files.
* src/alloc.c (garbage_collect): Mark Haiku display.
* src/dispextern.h (HAVE_NATIVE_TRANSFORMS): Also enable
on Haiku.
(struct image): Add fields for Haiku transforms.
(RGB_PIXEL_COLOR): Define to unsigned long on Haiku as
well.
(sit_for): Also check USABLE_SIGPOLL.
(init_display_interactive): Set initial window system to
Haiku on Haiku builds.
* src/emacs.c (main): Define Haiku syms and init haiku
clipboard.
(shut_down_emacs): Quit BApplication on Haiku and
trigger debug
on aborts if haiku_debug_on_fatal_error.
(Vsystem_type): Update docstring.
* src/fileio.c (next-read-file-uses-dialog-p): Enable on
Haiku.
* src/filelock.c (WTMP_FILE): Only define if BOOT_TIME
is also defined.
* src/floatfns.c (double_integer_scale): Work around
Haiku libroot brain damage.
* src/font.c (syms_of_font): Define appropriate font
driver symbols for Haiku builds with various options.
* src/font.h: Also enable ftcrfont on Haiku builds with
Cairo.
(font_data_structures_may_be_ill_formed): Also enable on
Haiku builds that have Cairo.
* src/frame.c (Fframep): Update doc-string for Haiku
builds and return haiku if appropriate.
(syms_of_frame): New symbol `haiku'.
* src/frame.h (struct frame): Add output data for Haiku.
(FRAME_HAIKU_P): New macro.
(FRAME_WINDOW_P): Test for Haiku frames as well.
* src/ftcrfont.c (RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG): New macros.
(ftcrfont_draw): Add haiku specific code for Haiku
builds with Cairo.
* src/ftfont.c (ftfont_open): Set face.
(ftfont_has_char, ftfont_text_extents): Work around
crash.
(syms_of_ftfont): New symbol `mono'.
* src/ftfont.h (struct font_info): Enable Cairo-specific
fields for Cairo builds on Haiku.
* src/haiku_draw_support.cc:
* src/haiku_font_support.cc:
* src/haiku_io.c:
* src/haiku_select.cc:
* src/haiku_support.cc:
* src/haiku_support.h:
* src/haikufns.c:
* src/haikufont.c:
* src/haikugui.h:
* src/haikuimage.c:
* src/haikumenu.c:
* src/haikuselect.c:
* src/haikuselect.h:
* src/haikuterm.c:
* src/haikuterm.h: Add new files for Haiku windowing
support.
* src/haiku.c: Add new files for Haiku operating system
support.
* src/image.c: Implement image transforms and native XPM
support
on Haiku.
(GET_PIXEL, PUT_PIXEL, NO_PIXMAP)
(PIX_MASK_RETAIN, PIX_MASK_DRAW)
(RGB_TO_ULONG, RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG, RED16_FROM_ULONG, GREEN16_FROM_ULONG)
(BLUE16_FROM_ULONG): Define to appropriate values on
Haiku.
(image_create_bitmap_from_data): Add Haiku support.
(image_create_bitmap_from_file): Add TODO on Haiku.
(free_bitmap_record): Free bitmap on Haiku.
(image_size_in_bytes): Implement for Haiku bitmaps.
(image_set_transform): Implement on Haiku.
(image_create_x_image_and_pixmap_1): Implement on Haiku,
24-bit or 1-bit only.
(image_destroy_x_image, image_get_x_image): Use correct
img and pixmap values on Haiku.
(lookup_rgb_color): Use correct macro on Haiku.
(image_to_emacs_colors): Implement on Haiku.
(image_disable_image): Disable on Haiku.
(image_can_use_native_api): Test for translator presence
on Haiku.
(native_image_load): Use translator on Haiku.
(imagemagick_load_image): Add Haiku-specific quirks.
(Fimage_transforms_p): Allow rotate90 on Haiku.
(image_types): Enable native XPM support on Haiku.
(syms_of_image): Enable XPM images on Haiku.
* src/keyboard.c (kbd_buffer_get_event)
(handle_async_input, handle_input_available_signal)
(handle_user_signal, Fset_input_interrupt_mode)
(init_keyboard): Check for USABLE_SIGPOLL along with
USABLE_SIGIO.
* src/lisp.h (pD): Work around broken Haiku headers.
(HAVE_EXT_MENU_BAR): Define on Haiku.
(handle_input_available_signal): Enable if we just have
SIGPOLL as well.
* src/menu.c (have_boxes): Return true on Haiku.
(single_menu_item): Enable toolkit menus on Haiku.
(find_and_call_menu_selection): Also enable on Haiku.
* src/process.c (keyboard_bit_set): Enable with only
usable SIGPOLL.
(wait_reading_process_output): Test for SIGPOLL as well
as SIGIO availability.
* src/sound.c (sound_perror, vox_open)
(vox_configure, vox_close): Enable for usable SIGPOLL as
well.
* src/sysdep.c (sys_subshell): Enable for usable SIGPOLL.
(reset_sigio): Make conditional on F_SETOWN.
(request_sigio, unrequest_sigio)
(emacs_sigaction_init): Also handle SIGPOLLs.
(init_sys_modes): Disable TCXONC usage on Haiku, as it
doesn't have any ttys other than pseudo ttys, which don't
support C-s/C-q flow control, and causes compiler warnings.
(speeds): Disable high speeds if HAVE_TINY_SPEED_T.
* src/termhooks.h (enum output_method): Add output_haiku.
(struct terminal): Add Haiku display info.
(TERMINAL_FONT_CACHE): Enable for Haiku.
* src/terminal.c (Fterminal_live_p): Return `haiku' if
appropriate.
* src/verbose.mk.in (AM_V_CXX, AM_V_CXXLD): New logging
variables.
* src/xdisp.c (redisplay_internal)
(note_mouse_highlight): Return on Haiku if a popup is activated.
(display_menu_bar): Return on Haiku if frame is a Haiku
frame.
* src/xfaces.c (GCGraphicsExposures): Enable correctly on Haiku.
(x_create_gc): Enable dummy GC code on Haiku.
* src/xfns.c (x-server-version, x-file-dialog): Add
Haiku specifics to doc strings.
* src/xterm.c (syms_of_xterm): Add Haiku information to
doc string.
2021-11-20 13:30:08 +00:00
|
|
|
|
(not (null (memq (framep-on-display display) '(x w32 ns haiku)))))
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
|
2001-07-17 12:58:19 +00:00
|
|
|
|
(defun display-images-p (&optional display)
|
|
|
|
|
"Return non-nil if DISPLAY can display images.
|
|
|
|
|
|
|
|
|
|
DISPLAY can be a display name, a frame, or nil (meaning the selected
|
|
|
|
|
frame's display)."
|
|
|
|
|
(and (display-graphic-p display)
|
|
|
|
|
(fboundp 'image-mask-p)
|
2002-03-20 21:26:51 +00:00
|
|
|
|
(fboundp 'image-size)))
|
2001-07-17 12:58:19 +00:00
|
|
|
|
|
2021-04-12 16:32:07 +00:00
|
|
|
|
(defalias 'display-blink-cursor-p #'display-graphic-p)
|
|
|
|
|
(defalias 'display-multi-frame-p #'display-graphic-p)
|
|
|
|
|
(defalias 'display-multi-font-p #'display-graphic-p)
|
2000-06-13 13:15:30 +00:00
|
|
|
|
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(defun display-selections-p (&optional display)
|
|
|
|
|
"Return non-nil if DISPLAY supports selections.
|
|
|
|
|
A selection is a way to transfer text or other data between programs
|
2010-09-02 10:17:02 +00:00
|
|
|
|
via special system buffers called `selection' or `clipboard'.
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
DISPLAY can be a display name, a frame, or nil (meaning the selected
|
|
|
|
|
frame's display)."
|
|
|
|
|
(let ((frame-type (framep-on-display display)))
|
|
|
|
|
(cond
|
|
|
|
|
((eq frame-type 'pc)
|
2014-08-07 09:55:09 +00:00
|
|
|
|
;; MS-DOS frames support selections when Emacs runs inside
|
|
|
|
|
;; a Windows DOS Box.
|
2004-08-22 16:54:33 +00:00
|
|
|
|
(with-no-warnings
|
|
|
|
|
(not (null dos-windows-version))))
|
2008-07-27 18:24:48 +00:00
|
|
|
|
((memq frame-type '(x w32 ns))
|
2014-03-01 01:32:42 +00:00
|
|
|
|
t)
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(t
|
|
|
|
|
nil))))
|
|
|
|
|
|
2019-04-03 20:03:28 +00:00
|
|
|
|
(defun display-symbol-keys-p (&optional display)
|
|
|
|
|
"Return non-nil if DISPLAY supports symbol names as keys.
|
|
|
|
|
This means that, for example, DISPLAY can differentiate between
|
|
|
|
|
the keybinding RET and [return]."
|
|
|
|
|
(let ((frame-type (framep-on-display display)))
|
|
|
|
|
(or (memq frame-type '(x w32 ns pc))
|
|
|
|
|
;; MS-DOS and MS-Windows terminals have built-in support for
|
|
|
|
|
;; function (symbol) keys
|
|
|
|
|
(memq system-type '(ms-dos windows-nt)))))
|
|
|
|
|
|
2008-06-12 03:56:20 +00:00
|
|
|
|
(declare-function x-display-screens "xfns.c" (&optional terminal))
|
|
|
|
|
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(defun display-screens (&optional display)
|
2013-10-22 08:07:51 +00:00
|
|
|
|
"Return the number of screens associated with DISPLAY.
|
2014-10-08 10:16:45 +00:00
|
|
|
|
DISPLAY should be either a frame or a display name (a string).
|
2013-10-22 08:07:51 +00:00
|
|
|
|
If DISPLAY is omitted or nil, it defaults to the selected frame's display."
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(let ((frame-type (framep-on-display display)))
|
|
|
|
|
(cond
|
Add support for the Haiku operating system and its window system
* .gitignore: Add binaries specific to Haiku.
* Makefie.in (HAVE_BE_APP): New variable.
(install-arch-dep): Install Emacs and Emacs.pdmp when
using Haiku.
* configure.ac: Detect and configure for Haiku and
various related configurations.
(be-app, be-freetype, be-cairo): New options.
(HAVE_BE_APP, HAIKU_OBJ, HAIKU_CXX_OBJ)
(HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(HAIKU, HAVE_TINY_SPEED_T): New define.
(emacs_config_features): Add BE_APP.
* doc/emacs/Makefile.in (EMACSSOURCES): Add Haiku
appendix.
* doc/emacs/emacs.texi: Add Haiku appendix to menus and
include it.
* doc/emacs/haiku.texi: New Haiku appendix.
* doc/lispref/display.texi (Defining Faces, Window Systems):
Explain meaning of `haiku' as a window system identifier.
(haiku-use-system-tooltips): Explain meaning of system
tooltips on
Haiku.
* doc/lispref/frames.texi (Multiple Terminals): Explain
meaning of haiku as a display type.
(Frame Layout): Clarify section for Haiku frames.
(Size Parameters): Explain limitations of fullwidth and
fullheight on Haiku.
(Management Parameters): Explain limitations of
inhibiting double buffering on builds with Cairo,
and the inability of frames with no-accept-focus to
receive keyboard input on Haiku.
(Font and Color Parameters): Explain the different font
backends available on Haiku.
(Raising and Lowering): Explain that lowering and
restacking frames doesn't work on Haiku.
(Child Frames): Explain oddities of child frame
visibility on Haiku.
* doc/lispref/os.texi (System Environment): Explain
meaning of haiku.
* etc/MACHINES: Add appropriate notices for Haiku.
* etc/NEWS: Document changes.
* etc/PROBLEMS: Document font spacing bug on Haiku.
* lib-src/Makefile.in: Build be-resources binary on
Haiku.
(CXX, CXXFLAGS, NON_CXX_FLAGS, ALL_CXXFLAGS)
(HAVE_BE_APP, HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(DONT_INSTALL): Add be-resources binary if on Haiku.
(be-resources): New target.
* lib-src/be_resources: Add helper binary for setting
resources on the Emacs application.
* lib-src/emacsclient.c (decode_options): Set
alt_display to "be" on Haiku.
* lisp/cus-edit.el (custom-button, custom-button-mouse)
(custom-button-unraised, custom-button-pressed): Update
face definitions for Haiku.
* lisp/cus-start.el: Add haiku-debug-on-fatal-error and
haiku-use-system-tooltips.
* lisp/faces.el (face-valid-attribute-values): Clarify
attribute comment for Haiku.
(tool-bar): Add appropriate toolbar color for Haiku.
* lisp/frame.el (haiku-frame-geometry)
(haiku-mouse-absolute-pixel-position)
(haiku-set-mouse-absolute-pixel-position)
(haiku-frame-edges)
(haiku-frame-list-z-order): New function declarations.
(frame-geometry, frame-edges)
(mouse-absolute-pixel-position)
(set-mouse-absolute-pixel-position)
(frame-list-z-order): Call appropriate window system
functions on Haiku.
(display-mouse-p, display-graphic-p)
(display-images-p, display-pixel-height)
(display-pixel-width, display-mm-height)
(display-mm-width, display-backing-store)
(display-save-under, display-planes)
(display-color-cells, display-visual-class): Update type
tests for Haiku.
* lisp/international/mule-cmds.el
(set-coding-system-map): Also
prevent set-terminal-coding-system from appearing in the menu
bar on Haiku.
* lisp/loadup.el: Load Haiku-specific files when built
with Haiku, and don't rename newly built Emacs on Haiku as BFS
doesn't support hard links.
* lisp/menu-bar.el (menu-bar-open): Add for Haiku.
* lisp/mwheel.el (mouse-wheel-down-event): Expect
wheel-up on Haiku.
(mouse-wheel-up-event): Expect wheel-down on Haiku.
(mouse-wheel-left-event): Expect wheel-left on Haiku.
(mouse-wheel-right-event): Expect wheel-right on Haiku.
* lisp/net/browse-url.el
(browse-url--browser-defcustom-type):
Add option for WebPositive.
(browse-url-webpositive-program): New variable.
(browse-url-default-program): Search for WebPositive.
(browse-url-webpositive): New function.
* lisp/net/eww.el (eww-form-submit, eww-form-file)
(eww-form-checkbox, eww-form-select): Define faces
appropriately for Haiku.
* lisp/term/haiku-win.el: New file.
* lisp/tooltip.el (menu-or-popup-active-p): New function
declaration.
(tooltip-show-help): Don't use tooltips on Haiku when a
menu is active.
* lisp/version.el (haiku-get-version-string): New
function declaration.
(emacs-version): Add Haiku version string if
appropriate.
* src/Makefile.in: Also produce binary named "Emacs"
with Haiku resources set.
(CXX, HAIKU_OBJ, HAIKU_CXX_OBJ, HAIKU_LIBS)
(HAIKU_CFLAGS, HAVE_BE_APP, NON_CXX_FLAGS)
(ALL_CXX_FLAGS): New variables.
(.SUFFIXES): Add .cc.
(.cc.o): New target.
(base_obj): Add Haiku C objects.
(doc_obj, obj): Split objects that should scanned for
documentation into doc_obj.
(SOME_MACHINE_OBJECTS): Add appropriate Haiku C objects.
(all): Depend on Emacs and Emacs.pdmp on Haiku.
(LIBES): Add Haiku libraries.
(gl-stamp)
($(etc)/DOC): Scan doc_obj instead of obj
(temacs$(EXEEXT): Use C++ linker on Haiku.
(ctagsfiles3): New variable.
(TAGS): Scan C++ files.
* src/alloc.c (garbage_collect): Mark Haiku display.
* src/dispextern.h (HAVE_NATIVE_TRANSFORMS): Also enable
on Haiku.
(struct image): Add fields for Haiku transforms.
(RGB_PIXEL_COLOR): Define to unsigned long on Haiku as
well.
(sit_for): Also check USABLE_SIGPOLL.
(init_display_interactive): Set initial window system to
Haiku on Haiku builds.
* src/emacs.c (main): Define Haiku syms and init haiku
clipboard.
(shut_down_emacs): Quit BApplication on Haiku and
trigger debug
on aborts if haiku_debug_on_fatal_error.
(Vsystem_type): Update docstring.
* src/fileio.c (next-read-file-uses-dialog-p): Enable on
Haiku.
* src/filelock.c (WTMP_FILE): Only define if BOOT_TIME
is also defined.
* src/floatfns.c (double_integer_scale): Work around
Haiku libroot brain damage.
* src/font.c (syms_of_font): Define appropriate font
driver symbols for Haiku builds with various options.
* src/font.h: Also enable ftcrfont on Haiku builds with
Cairo.
(font_data_structures_may_be_ill_formed): Also enable on
Haiku builds that have Cairo.
* src/frame.c (Fframep): Update doc-string for Haiku
builds and return haiku if appropriate.
(syms_of_frame): New symbol `haiku'.
* src/frame.h (struct frame): Add output data for Haiku.
(FRAME_HAIKU_P): New macro.
(FRAME_WINDOW_P): Test for Haiku frames as well.
* src/ftcrfont.c (RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG): New macros.
(ftcrfont_draw): Add haiku specific code for Haiku
builds with Cairo.
* src/ftfont.c (ftfont_open): Set face.
(ftfont_has_char, ftfont_text_extents): Work around
crash.
(syms_of_ftfont): New symbol `mono'.
* src/ftfont.h (struct font_info): Enable Cairo-specific
fields for Cairo builds on Haiku.
* src/haiku_draw_support.cc:
* src/haiku_font_support.cc:
* src/haiku_io.c:
* src/haiku_select.cc:
* src/haiku_support.cc:
* src/haiku_support.h:
* src/haikufns.c:
* src/haikufont.c:
* src/haikugui.h:
* src/haikuimage.c:
* src/haikumenu.c:
* src/haikuselect.c:
* src/haikuselect.h:
* src/haikuterm.c:
* src/haikuterm.h: Add new files for Haiku windowing
support.
* src/haiku.c: Add new files for Haiku operating system
support.
* src/image.c: Implement image transforms and native XPM
support
on Haiku.
(GET_PIXEL, PUT_PIXEL, NO_PIXMAP)
(PIX_MASK_RETAIN, PIX_MASK_DRAW)
(RGB_TO_ULONG, RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG, RED16_FROM_ULONG, GREEN16_FROM_ULONG)
(BLUE16_FROM_ULONG): Define to appropriate values on
Haiku.
(image_create_bitmap_from_data): Add Haiku support.
(image_create_bitmap_from_file): Add TODO on Haiku.
(free_bitmap_record): Free bitmap on Haiku.
(image_size_in_bytes): Implement for Haiku bitmaps.
(image_set_transform): Implement on Haiku.
(image_create_x_image_and_pixmap_1): Implement on Haiku,
24-bit or 1-bit only.
(image_destroy_x_image, image_get_x_image): Use correct
img and pixmap values on Haiku.
(lookup_rgb_color): Use correct macro on Haiku.
(image_to_emacs_colors): Implement on Haiku.
(image_disable_image): Disable on Haiku.
(image_can_use_native_api): Test for translator presence
on Haiku.
(native_image_load): Use translator on Haiku.
(imagemagick_load_image): Add Haiku-specific quirks.
(Fimage_transforms_p): Allow rotate90 on Haiku.
(image_types): Enable native XPM support on Haiku.
(syms_of_image): Enable XPM images on Haiku.
* src/keyboard.c (kbd_buffer_get_event)
(handle_async_input, handle_input_available_signal)
(handle_user_signal, Fset_input_interrupt_mode)
(init_keyboard): Check for USABLE_SIGPOLL along with
USABLE_SIGIO.
* src/lisp.h (pD): Work around broken Haiku headers.
(HAVE_EXT_MENU_BAR): Define on Haiku.
(handle_input_available_signal): Enable if we just have
SIGPOLL as well.
* src/menu.c (have_boxes): Return true on Haiku.
(single_menu_item): Enable toolkit menus on Haiku.
(find_and_call_menu_selection): Also enable on Haiku.
* src/process.c (keyboard_bit_set): Enable with only
usable SIGPOLL.
(wait_reading_process_output): Test for SIGPOLL as well
as SIGIO availability.
* src/sound.c (sound_perror, vox_open)
(vox_configure, vox_close): Enable for usable SIGPOLL as
well.
* src/sysdep.c (sys_subshell): Enable for usable SIGPOLL.
(reset_sigio): Make conditional on F_SETOWN.
(request_sigio, unrequest_sigio)
(emacs_sigaction_init): Also handle SIGPOLLs.
(init_sys_modes): Disable TCXONC usage on Haiku, as it
doesn't have any ttys other than pseudo ttys, which don't
support C-s/C-q flow control, and causes compiler warnings.
(speeds): Disable high speeds if HAVE_TINY_SPEED_T.
* src/termhooks.h (enum output_method): Add output_haiku.
(struct terminal): Add Haiku display info.
(TERMINAL_FONT_CACHE): Enable for Haiku.
* src/terminal.c (Fterminal_live_p): Return `haiku' if
appropriate.
* src/verbose.mk.in (AM_V_CXX, AM_V_CXXLD): New logging
variables.
* src/xdisp.c (redisplay_internal)
(note_mouse_highlight): Return on Haiku if a popup is activated.
(display_menu_bar): Return on Haiku if frame is a Haiku
frame.
* src/xfaces.c (GCGraphicsExposures): Enable correctly on Haiku.
(x_create_gc): Enable dummy GC code on Haiku.
* src/xfns.c (x-server-version, x-file-dialog): Add
Haiku specifics to doc strings.
* src/xterm.c (syms_of_xterm): Add Haiku information to
doc string.
2021-11-20 13:30:08 +00:00
|
|
|
|
((memq frame-type '(x w32 ns haiku))
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(x-display-screens display))
|
2005-10-21 08:27:14 +00:00
|
|
|
|
(t
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
1))))
|
|
|
|
|
|
2008-06-12 03:56:20 +00:00
|
|
|
|
(declare-function x-display-pixel-height "xfns.c" (&optional terminal))
|
|
|
|
|
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(defun display-pixel-height (&optional display)
|
|
|
|
|
"Return the height of DISPLAY's screen in pixels.
|
2014-10-08 10:16:45 +00:00
|
|
|
|
DISPLAY can be a display name or a frame.
|
2014-03-03 01:00:27 +00:00
|
|
|
|
If DISPLAY is omitted or nil, it defaults to the selected frame's display.
|
|
|
|
|
|
2013-07-04 10:25:54 +00:00
|
|
|
|
For character terminals, each character counts as a single pixel.
|
2014-03-03 01:00:27 +00:00
|
|
|
|
|
2013-07-04 10:25:54 +00:00
|
|
|
|
For graphical terminals, note that on \"multi-monitor\" setups this
|
|
|
|
|
refers to the pixel height for all physical monitors associated
|
|
|
|
|
with DISPLAY. To get information for each physical monitor, use
|
2014-03-03 01:00:27 +00:00
|
|
|
|
`display-monitor-attributes-list'."
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(let ((frame-type (framep-on-display display)))
|
|
|
|
|
(cond
|
Add support for the Haiku operating system and its window system
* .gitignore: Add binaries specific to Haiku.
* Makefie.in (HAVE_BE_APP): New variable.
(install-arch-dep): Install Emacs and Emacs.pdmp when
using Haiku.
* configure.ac: Detect and configure for Haiku and
various related configurations.
(be-app, be-freetype, be-cairo): New options.
(HAVE_BE_APP, HAIKU_OBJ, HAIKU_CXX_OBJ)
(HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(HAIKU, HAVE_TINY_SPEED_T): New define.
(emacs_config_features): Add BE_APP.
* doc/emacs/Makefile.in (EMACSSOURCES): Add Haiku
appendix.
* doc/emacs/emacs.texi: Add Haiku appendix to menus and
include it.
* doc/emacs/haiku.texi: New Haiku appendix.
* doc/lispref/display.texi (Defining Faces, Window Systems):
Explain meaning of `haiku' as a window system identifier.
(haiku-use-system-tooltips): Explain meaning of system
tooltips on
Haiku.
* doc/lispref/frames.texi (Multiple Terminals): Explain
meaning of haiku as a display type.
(Frame Layout): Clarify section for Haiku frames.
(Size Parameters): Explain limitations of fullwidth and
fullheight on Haiku.
(Management Parameters): Explain limitations of
inhibiting double buffering on builds with Cairo,
and the inability of frames with no-accept-focus to
receive keyboard input on Haiku.
(Font and Color Parameters): Explain the different font
backends available on Haiku.
(Raising and Lowering): Explain that lowering and
restacking frames doesn't work on Haiku.
(Child Frames): Explain oddities of child frame
visibility on Haiku.
* doc/lispref/os.texi (System Environment): Explain
meaning of haiku.
* etc/MACHINES: Add appropriate notices for Haiku.
* etc/NEWS: Document changes.
* etc/PROBLEMS: Document font spacing bug on Haiku.
* lib-src/Makefile.in: Build be-resources binary on
Haiku.
(CXX, CXXFLAGS, NON_CXX_FLAGS, ALL_CXXFLAGS)
(HAVE_BE_APP, HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(DONT_INSTALL): Add be-resources binary if on Haiku.
(be-resources): New target.
* lib-src/be_resources: Add helper binary for setting
resources on the Emacs application.
* lib-src/emacsclient.c (decode_options): Set
alt_display to "be" on Haiku.
* lisp/cus-edit.el (custom-button, custom-button-mouse)
(custom-button-unraised, custom-button-pressed): Update
face definitions for Haiku.
* lisp/cus-start.el: Add haiku-debug-on-fatal-error and
haiku-use-system-tooltips.
* lisp/faces.el (face-valid-attribute-values): Clarify
attribute comment for Haiku.
(tool-bar): Add appropriate toolbar color for Haiku.
* lisp/frame.el (haiku-frame-geometry)
(haiku-mouse-absolute-pixel-position)
(haiku-set-mouse-absolute-pixel-position)
(haiku-frame-edges)
(haiku-frame-list-z-order): New function declarations.
(frame-geometry, frame-edges)
(mouse-absolute-pixel-position)
(set-mouse-absolute-pixel-position)
(frame-list-z-order): Call appropriate window system
functions on Haiku.
(display-mouse-p, display-graphic-p)
(display-images-p, display-pixel-height)
(display-pixel-width, display-mm-height)
(display-mm-width, display-backing-store)
(display-save-under, display-planes)
(display-color-cells, display-visual-class): Update type
tests for Haiku.
* lisp/international/mule-cmds.el
(set-coding-system-map): Also
prevent set-terminal-coding-system from appearing in the menu
bar on Haiku.
* lisp/loadup.el: Load Haiku-specific files when built
with Haiku, and don't rename newly built Emacs on Haiku as BFS
doesn't support hard links.
* lisp/menu-bar.el (menu-bar-open): Add for Haiku.
* lisp/mwheel.el (mouse-wheel-down-event): Expect
wheel-up on Haiku.
(mouse-wheel-up-event): Expect wheel-down on Haiku.
(mouse-wheel-left-event): Expect wheel-left on Haiku.
(mouse-wheel-right-event): Expect wheel-right on Haiku.
* lisp/net/browse-url.el
(browse-url--browser-defcustom-type):
Add option for WebPositive.
(browse-url-webpositive-program): New variable.
(browse-url-default-program): Search for WebPositive.
(browse-url-webpositive): New function.
* lisp/net/eww.el (eww-form-submit, eww-form-file)
(eww-form-checkbox, eww-form-select): Define faces
appropriately for Haiku.
* lisp/term/haiku-win.el: New file.
* lisp/tooltip.el (menu-or-popup-active-p): New function
declaration.
(tooltip-show-help): Don't use tooltips on Haiku when a
menu is active.
* lisp/version.el (haiku-get-version-string): New
function declaration.
(emacs-version): Add Haiku version string if
appropriate.
* src/Makefile.in: Also produce binary named "Emacs"
with Haiku resources set.
(CXX, HAIKU_OBJ, HAIKU_CXX_OBJ, HAIKU_LIBS)
(HAIKU_CFLAGS, HAVE_BE_APP, NON_CXX_FLAGS)
(ALL_CXX_FLAGS): New variables.
(.SUFFIXES): Add .cc.
(.cc.o): New target.
(base_obj): Add Haiku C objects.
(doc_obj, obj): Split objects that should scanned for
documentation into doc_obj.
(SOME_MACHINE_OBJECTS): Add appropriate Haiku C objects.
(all): Depend on Emacs and Emacs.pdmp on Haiku.
(LIBES): Add Haiku libraries.
(gl-stamp)
($(etc)/DOC): Scan doc_obj instead of obj
(temacs$(EXEEXT): Use C++ linker on Haiku.
(ctagsfiles3): New variable.
(TAGS): Scan C++ files.
* src/alloc.c (garbage_collect): Mark Haiku display.
* src/dispextern.h (HAVE_NATIVE_TRANSFORMS): Also enable
on Haiku.
(struct image): Add fields for Haiku transforms.
(RGB_PIXEL_COLOR): Define to unsigned long on Haiku as
well.
(sit_for): Also check USABLE_SIGPOLL.
(init_display_interactive): Set initial window system to
Haiku on Haiku builds.
* src/emacs.c (main): Define Haiku syms and init haiku
clipboard.
(shut_down_emacs): Quit BApplication on Haiku and
trigger debug
on aborts if haiku_debug_on_fatal_error.
(Vsystem_type): Update docstring.
* src/fileio.c (next-read-file-uses-dialog-p): Enable on
Haiku.
* src/filelock.c (WTMP_FILE): Only define if BOOT_TIME
is also defined.
* src/floatfns.c (double_integer_scale): Work around
Haiku libroot brain damage.
* src/font.c (syms_of_font): Define appropriate font
driver symbols for Haiku builds with various options.
* src/font.h: Also enable ftcrfont on Haiku builds with
Cairo.
(font_data_structures_may_be_ill_formed): Also enable on
Haiku builds that have Cairo.
* src/frame.c (Fframep): Update doc-string for Haiku
builds and return haiku if appropriate.
(syms_of_frame): New symbol `haiku'.
* src/frame.h (struct frame): Add output data for Haiku.
(FRAME_HAIKU_P): New macro.
(FRAME_WINDOW_P): Test for Haiku frames as well.
* src/ftcrfont.c (RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG): New macros.
(ftcrfont_draw): Add haiku specific code for Haiku
builds with Cairo.
* src/ftfont.c (ftfont_open): Set face.
(ftfont_has_char, ftfont_text_extents): Work around
crash.
(syms_of_ftfont): New symbol `mono'.
* src/ftfont.h (struct font_info): Enable Cairo-specific
fields for Cairo builds on Haiku.
* src/haiku_draw_support.cc:
* src/haiku_font_support.cc:
* src/haiku_io.c:
* src/haiku_select.cc:
* src/haiku_support.cc:
* src/haiku_support.h:
* src/haikufns.c:
* src/haikufont.c:
* src/haikugui.h:
* src/haikuimage.c:
* src/haikumenu.c:
* src/haikuselect.c:
* src/haikuselect.h:
* src/haikuterm.c:
* src/haikuterm.h: Add new files for Haiku windowing
support.
* src/haiku.c: Add new files for Haiku operating system
support.
* src/image.c: Implement image transforms and native XPM
support
on Haiku.
(GET_PIXEL, PUT_PIXEL, NO_PIXMAP)
(PIX_MASK_RETAIN, PIX_MASK_DRAW)
(RGB_TO_ULONG, RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG, RED16_FROM_ULONG, GREEN16_FROM_ULONG)
(BLUE16_FROM_ULONG): Define to appropriate values on
Haiku.
(image_create_bitmap_from_data): Add Haiku support.
(image_create_bitmap_from_file): Add TODO on Haiku.
(free_bitmap_record): Free bitmap on Haiku.
(image_size_in_bytes): Implement for Haiku bitmaps.
(image_set_transform): Implement on Haiku.
(image_create_x_image_and_pixmap_1): Implement on Haiku,
24-bit or 1-bit only.
(image_destroy_x_image, image_get_x_image): Use correct
img and pixmap values on Haiku.
(lookup_rgb_color): Use correct macro on Haiku.
(image_to_emacs_colors): Implement on Haiku.
(image_disable_image): Disable on Haiku.
(image_can_use_native_api): Test for translator presence
on Haiku.
(native_image_load): Use translator on Haiku.
(imagemagick_load_image): Add Haiku-specific quirks.
(Fimage_transforms_p): Allow rotate90 on Haiku.
(image_types): Enable native XPM support on Haiku.
(syms_of_image): Enable XPM images on Haiku.
* src/keyboard.c (kbd_buffer_get_event)
(handle_async_input, handle_input_available_signal)
(handle_user_signal, Fset_input_interrupt_mode)
(init_keyboard): Check for USABLE_SIGPOLL along with
USABLE_SIGIO.
* src/lisp.h (pD): Work around broken Haiku headers.
(HAVE_EXT_MENU_BAR): Define on Haiku.
(handle_input_available_signal): Enable if we just have
SIGPOLL as well.
* src/menu.c (have_boxes): Return true on Haiku.
(single_menu_item): Enable toolkit menus on Haiku.
(find_and_call_menu_selection): Also enable on Haiku.
* src/process.c (keyboard_bit_set): Enable with only
usable SIGPOLL.
(wait_reading_process_output): Test for SIGPOLL as well
as SIGIO availability.
* src/sound.c (sound_perror, vox_open)
(vox_configure, vox_close): Enable for usable SIGPOLL as
well.
* src/sysdep.c (sys_subshell): Enable for usable SIGPOLL.
(reset_sigio): Make conditional on F_SETOWN.
(request_sigio, unrequest_sigio)
(emacs_sigaction_init): Also handle SIGPOLLs.
(init_sys_modes): Disable TCXONC usage on Haiku, as it
doesn't have any ttys other than pseudo ttys, which don't
support C-s/C-q flow control, and causes compiler warnings.
(speeds): Disable high speeds if HAVE_TINY_SPEED_T.
* src/termhooks.h (enum output_method): Add output_haiku.
(struct terminal): Add Haiku display info.
(TERMINAL_FONT_CACHE): Enable for Haiku.
* src/terminal.c (Fterminal_live_p): Return `haiku' if
appropriate.
* src/verbose.mk.in (AM_V_CXX, AM_V_CXXLD): New logging
variables.
* src/xdisp.c (redisplay_internal)
(note_mouse_highlight): Return on Haiku if a popup is activated.
(display_menu_bar): Return on Haiku if frame is a Haiku
frame.
* src/xfaces.c (GCGraphicsExposures): Enable correctly on Haiku.
(x_create_gc): Enable dummy GC code on Haiku.
* src/xfns.c (x-server-version, x-file-dialog): Add
Haiku specifics to doc strings.
* src/xterm.c (syms_of_xterm): Add Haiku information to
doc string.
2021-11-20 13:30:08 +00:00
|
|
|
|
((memq frame-type '(x w32 ns haiku))
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(x-display-pixel-height display))
|
|
|
|
|
(t
|
|
|
|
|
(frame-height (if (framep display) display (selected-frame)))))))
|
|
|
|
|
|
2008-06-12 03:56:20 +00:00
|
|
|
|
(declare-function x-display-pixel-width "xfns.c" (&optional terminal))
|
|
|
|
|
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(defun display-pixel-width (&optional display)
|
|
|
|
|
"Return the width of DISPLAY's screen in pixels.
|
2014-10-08 10:16:45 +00:00
|
|
|
|
DISPLAY can be a display name or a frame.
|
2014-03-03 01:00:27 +00:00
|
|
|
|
If DISPLAY is omitted or nil, it defaults to the selected frame's display.
|
|
|
|
|
|
2013-07-04 10:25:54 +00:00
|
|
|
|
For character terminals, each character counts as a single pixel.
|
2014-03-03 01:00:27 +00:00
|
|
|
|
|
2013-07-04 10:25:54 +00:00
|
|
|
|
For graphical terminals, note that on \"multi-monitor\" setups this
|
|
|
|
|
refers to the pixel width for all physical monitors associated
|
|
|
|
|
with DISPLAY. To get information for each physical monitor, use
|
2014-03-03 01:00:27 +00:00
|
|
|
|
`display-monitor-attributes-list'."
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(let ((frame-type (framep-on-display display)))
|
|
|
|
|
(cond
|
Add support for the Haiku operating system and its window system
* .gitignore: Add binaries specific to Haiku.
* Makefie.in (HAVE_BE_APP): New variable.
(install-arch-dep): Install Emacs and Emacs.pdmp when
using Haiku.
* configure.ac: Detect and configure for Haiku and
various related configurations.
(be-app, be-freetype, be-cairo): New options.
(HAVE_BE_APP, HAIKU_OBJ, HAIKU_CXX_OBJ)
(HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(HAIKU, HAVE_TINY_SPEED_T): New define.
(emacs_config_features): Add BE_APP.
* doc/emacs/Makefile.in (EMACSSOURCES): Add Haiku
appendix.
* doc/emacs/emacs.texi: Add Haiku appendix to menus and
include it.
* doc/emacs/haiku.texi: New Haiku appendix.
* doc/lispref/display.texi (Defining Faces, Window Systems):
Explain meaning of `haiku' as a window system identifier.
(haiku-use-system-tooltips): Explain meaning of system
tooltips on
Haiku.
* doc/lispref/frames.texi (Multiple Terminals): Explain
meaning of haiku as a display type.
(Frame Layout): Clarify section for Haiku frames.
(Size Parameters): Explain limitations of fullwidth and
fullheight on Haiku.
(Management Parameters): Explain limitations of
inhibiting double buffering on builds with Cairo,
and the inability of frames with no-accept-focus to
receive keyboard input on Haiku.
(Font and Color Parameters): Explain the different font
backends available on Haiku.
(Raising and Lowering): Explain that lowering and
restacking frames doesn't work on Haiku.
(Child Frames): Explain oddities of child frame
visibility on Haiku.
* doc/lispref/os.texi (System Environment): Explain
meaning of haiku.
* etc/MACHINES: Add appropriate notices for Haiku.
* etc/NEWS: Document changes.
* etc/PROBLEMS: Document font spacing bug on Haiku.
* lib-src/Makefile.in: Build be-resources binary on
Haiku.
(CXX, CXXFLAGS, NON_CXX_FLAGS, ALL_CXXFLAGS)
(HAVE_BE_APP, HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(DONT_INSTALL): Add be-resources binary if on Haiku.
(be-resources): New target.
* lib-src/be_resources: Add helper binary for setting
resources on the Emacs application.
* lib-src/emacsclient.c (decode_options): Set
alt_display to "be" on Haiku.
* lisp/cus-edit.el (custom-button, custom-button-mouse)
(custom-button-unraised, custom-button-pressed): Update
face definitions for Haiku.
* lisp/cus-start.el: Add haiku-debug-on-fatal-error and
haiku-use-system-tooltips.
* lisp/faces.el (face-valid-attribute-values): Clarify
attribute comment for Haiku.
(tool-bar): Add appropriate toolbar color for Haiku.
* lisp/frame.el (haiku-frame-geometry)
(haiku-mouse-absolute-pixel-position)
(haiku-set-mouse-absolute-pixel-position)
(haiku-frame-edges)
(haiku-frame-list-z-order): New function declarations.
(frame-geometry, frame-edges)
(mouse-absolute-pixel-position)
(set-mouse-absolute-pixel-position)
(frame-list-z-order): Call appropriate window system
functions on Haiku.
(display-mouse-p, display-graphic-p)
(display-images-p, display-pixel-height)
(display-pixel-width, display-mm-height)
(display-mm-width, display-backing-store)
(display-save-under, display-planes)
(display-color-cells, display-visual-class): Update type
tests for Haiku.
* lisp/international/mule-cmds.el
(set-coding-system-map): Also
prevent set-terminal-coding-system from appearing in the menu
bar on Haiku.
* lisp/loadup.el: Load Haiku-specific files when built
with Haiku, and don't rename newly built Emacs on Haiku as BFS
doesn't support hard links.
* lisp/menu-bar.el (menu-bar-open): Add for Haiku.
* lisp/mwheel.el (mouse-wheel-down-event): Expect
wheel-up on Haiku.
(mouse-wheel-up-event): Expect wheel-down on Haiku.
(mouse-wheel-left-event): Expect wheel-left on Haiku.
(mouse-wheel-right-event): Expect wheel-right on Haiku.
* lisp/net/browse-url.el
(browse-url--browser-defcustom-type):
Add option for WebPositive.
(browse-url-webpositive-program): New variable.
(browse-url-default-program): Search for WebPositive.
(browse-url-webpositive): New function.
* lisp/net/eww.el (eww-form-submit, eww-form-file)
(eww-form-checkbox, eww-form-select): Define faces
appropriately for Haiku.
* lisp/term/haiku-win.el: New file.
* lisp/tooltip.el (menu-or-popup-active-p): New function
declaration.
(tooltip-show-help): Don't use tooltips on Haiku when a
menu is active.
* lisp/version.el (haiku-get-version-string): New
function declaration.
(emacs-version): Add Haiku version string if
appropriate.
* src/Makefile.in: Also produce binary named "Emacs"
with Haiku resources set.
(CXX, HAIKU_OBJ, HAIKU_CXX_OBJ, HAIKU_LIBS)
(HAIKU_CFLAGS, HAVE_BE_APP, NON_CXX_FLAGS)
(ALL_CXX_FLAGS): New variables.
(.SUFFIXES): Add .cc.
(.cc.o): New target.
(base_obj): Add Haiku C objects.
(doc_obj, obj): Split objects that should scanned for
documentation into doc_obj.
(SOME_MACHINE_OBJECTS): Add appropriate Haiku C objects.
(all): Depend on Emacs and Emacs.pdmp on Haiku.
(LIBES): Add Haiku libraries.
(gl-stamp)
($(etc)/DOC): Scan doc_obj instead of obj
(temacs$(EXEEXT): Use C++ linker on Haiku.
(ctagsfiles3): New variable.
(TAGS): Scan C++ files.
* src/alloc.c (garbage_collect): Mark Haiku display.
* src/dispextern.h (HAVE_NATIVE_TRANSFORMS): Also enable
on Haiku.
(struct image): Add fields for Haiku transforms.
(RGB_PIXEL_COLOR): Define to unsigned long on Haiku as
well.
(sit_for): Also check USABLE_SIGPOLL.
(init_display_interactive): Set initial window system to
Haiku on Haiku builds.
* src/emacs.c (main): Define Haiku syms and init haiku
clipboard.
(shut_down_emacs): Quit BApplication on Haiku and
trigger debug
on aborts if haiku_debug_on_fatal_error.
(Vsystem_type): Update docstring.
* src/fileio.c (next-read-file-uses-dialog-p): Enable on
Haiku.
* src/filelock.c (WTMP_FILE): Only define if BOOT_TIME
is also defined.
* src/floatfns.c (double_integer_scale): Work around
Haiku libroot brain damage.
* src/font.c (syms_of_font): Define appropriate font
driver symbols for Haiku builds with various options.
* src/font.h: Also enable ftcrfont on Haiku builds with
Cairo.
(font_data_structures_may_be_ill_formed): Also enable on
Haiku builds that have Cairo.
* src/frame.c (Fframep): Update doc-string for Haiku
builds and return haiku if appropriate.
(syms_of_frame): New symbol `haiku'.
* src/frame.h (struct frame): Add output data for Haiku.
(FRAME_HAIKU_P): New macro.
(FRAME_WINDOW_P): Test for Haiku frames as well.
* src/ftcrfont.c (RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG): New macros.
(ftcrfont_draw): Add haiku specific code for Haiku
builds with Cairo.
* src/ftfont.c (ftfont_open): Set face.
(ftfont_has_char, ftfont_text_extents): Work around
crash.
(syms_of_ftfont): New symbol `mono'.
* src/ftfont.h (struct font_info): Enable Cairo-specific
fields for Cairo builds on Haiku.
* src/haiku_draw_support.cc:
* src/haiku_font_support.cc:
* src/haiku_io.c:
* src/haiku_select.cc:
* src/haiku_support.cc:
* src/haiku_support.h:
* src/haikufns.c:
* src/haikufont.c:
* src/haikugui.h:
* src/haikuimage.c:
* src/haikumenu.c:
* src/haikuselect.c:
* src/haikuselect.h:
* src/haikuterm.c:
* src/haikuterm.h: Add new files for Haiku windowing
support.
* src/haiku.c: Add new files for Haiku operating system
support.
* src/image.c: Implement image transforms and native XPM
support
on Haiku.
(GET_PIXEL, PUT_PIXEL, NO_PIXMAP)
(PIX_MASK_RETAIN, PIX_MASK_DRAW)
(RGB_TO_ULONG, RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG, RED16_FROM_ULONG, GREEN16_FROM_ULONG)
(BLUE16_FROM_ULONG): Define to appropriate values on
Haiku.
(image_create_bitmap_from_data): Add Haiku support.
(image_create_bitmap_from_file): Add TODO on Haiku.
(free_bitmap_record): Free bitmap on Haiku.
(image_size_in_bytes): Implement for Haiku bitmaps.
(image_set_transform): Implement on Haiku.
(image_create_x_image_and_pixmap_1): Implement on Haiku,
24-bit or 1-bit only.
(image_destroy_x_image, image_get_x_image): Use correct
img and pixmap values on Haiku.
(lookup_rgb_color): Use correct macro on Haiku.
(image_to_emacs_colors): Implement on Haiku.
(image_disable_image): Disable on Haiku.
(image_can_use_native_api): Test for translator presence
on Haiku.
(native_image_load): Use translator on Haiku.
(imagemagick_load_image): Add Haiku-specific quirks.
(Fimage_transforms_p): Allow rotate90 on Haiku.
(image_types): Enable native XPM support on Haiku.
(syms_of_image): Enable XPM images on Haiku.
* src/keyboard.c (kbd_buffer_get_event)
(handle_async_input, handle_input_available_signal)
(handle_user_signal, Fset_input_interrupt_mode)
(init_keyboard): Check for USABLE_SIGPOLL along with
USABLE_SIGIO.
* src/lisp.h (pD): Work around broken Haiku headers.
(HAVE_EXT_MENU_BAR): Define on Haiku.
(handle_input_available_signal): Enable if we just have
SIGPOLL as well.
* src/menu.c (have_boxes): Return true on Haiku.
(single_menu_item): Enable toolkit menus on Haiku.
(find_and_call_menu_selection): Also enable on Haiku.
* src/process.c (keyboard_bit_set): Enable with only
usable SIGPOLL.
(wait_reading_process_output): Test for SIGPOLL as well
as SIGIO availability.
* src/sound.c (sound_perror, vox_open)
(vox_configure, vox_close): Enable for usable SIGPOLL as
well.
* src/sysdep.c (sys_subshell): Enable for usable SIGPOLL.
(reset_sigio): Make conditional on F_SETOWN.
(request_sigio, unrequest_sigio)
(emacs_sigaction_init): Also handle SIGPOLLs.
(init_sys_modes): Disable TCXONC usage on Haiku, as it
doesn't have any ttys other than pseudo ttys, which don't
support C-s/C-q flow control, and causes compiler warnings.
(speeds): Disable high speeds if HAVE_TINY_SPEED_T.
* src/termhooks.h (enum output_method): Add output_haiku.
(struct terminal): Add Haiku display info.
(TERMINAL_FONT_CACHE): Enable for Haiku.
* src/terminal.c (Fterminal_live_p): Return `haiku' if
appropriate.
* src/verbose.mk.in (AM_V_CXX, AM_V_CXXLD): New logging
variables.
* src/xdisp.c (redisplay_internal)
(note_mouse_highlight): Return on Haiku if a popup is activated.
(display_menu_bar): Return on Haiku if frame is a Haiku
frame.
* src/xfaces.c (GCGraphicsExposures): Enable correctly on Haiku.
(x_create_gc): Enable dummy GC code on Haiku.
* src/xfns.c (x-server-version, x-file-dialog): Add
Haiku specifics to doc strings.
* src/xterm.c (syms_of_xterm): Add Haiku information to
doc string.
2021-11-20 13:30:08 +00:00
|
|
|
|
((memq frame-type '(x w32 ns haiku))
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(x-display-pixel-width display))
|
|
|
|
|
(t
|
|
|
|
|
(frame-width (if (framep display) display (selected-frame)))))))
|
|
|
|
|
|
2006-09-06 11:51:57 +00:00
|
|
|
|
(defcustom display-mm-dimensions-alist nil
|
|
|
|
|
"Alist for specifying screen dimensions in millimeters.
|
2014-03-03 01:00:27 +00:00
|
|
|
|
The functions `display-mm-height' and `display-mm-width' consult
|
|
|
|
|
this list before asking the system.
|
2006-09-06 11:51:57 +00:00
|
|
|
|
|
2014-03-03 01:00:27 +00:00
|
|
|
|
Each element has the form (DISPLAY . (WIDTH . HEIGHT)), e.g.
|
|
|
|
|
\(\":0.0\" . (287 . 215)).
|
2006-09-06 11:51:57 +00:00
|
|
|
|
|
2014-03-03 01:00:27 +00:00
|
|
|
|
If `display' is t, it specifies dimensions for all graphical displays
|
|
|
|
|
not explicitly specified."
|
2006-09-06 11:51:57 +00:00
|
|
|
|
:version "22.1"
|
|
|
|
|
:type '(alist :key-type (choice (string :tag "Display name")
|
|
|
|
|
(const :tag "Default" t))
|
|
|
|
|
:value-type (cons :tag "Dimensions"
|
|
|
|
|
(integer :tag "Width")
|
|
|
|
|
(integer :tag "Height")))
|
|
|
|
|
:group 'frames)
|
|
|
|
|
|
2008-06-12 03:56:20 +00:00
|
|
|
|
(declare-function x-display-mm-height "xfns.c" (&optional terminal))
|
|
|
|
|
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(defun display-mm-height (&optional display)
|
|
|
|
|
"Return the height of DISPLAY's screen in millimeters.
|
2014-03-03 01:00:27 +00:00
|
|
|
|
If the information is unavailable, this function returns nil.
|
2014-10-08 10:16:45 +00:00
|
|
|
|
DISPLAY can be a display name or a frame.
|
2014-03-03 01:00:27 +00:00
|
|
|
|
If DISPLAY is omitted or nil, it defaults to the selected frame's display.
|
|
|
|
|
|
|
|
|
|
You can override what the system thinks the result should be by
|
|
|
|
|
adding an entry to `display-mm-dimensions-alist'.
|
|
|
|
|
|
2013-07-04 10:25:54 +00:00
|
|
|
|
For graphical terminals, note that on \"multi-monitor\" setups this
|
|
|
|
|
refers to the height in millimeters for all physical monitors
|
|
|
|
|
associated with DISPLAY. To get information for each physical
|
2014-03-03 01:00:27 +00:00
|
|
|
|
monitor, use `display-monitor-attributes-list'."
|
Add support for the Haiku operating system and its window system
* .gitignore: Add binaries specific to Haiku.
* Makefie.in (HAVE_BE_APP): New variable.
(install-arch-dep): Install Emacs and Emacs.pdmp when
using Haiku.
* configure.ac: Detect and configure for Haiku and
various related configurations.
(be-app, be-freetype, be-cairo): New options.
(HAVE_BE_APP, HAIKU_OBJ, HAIKU_CXX_OBJ)
(HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(HAIKU, HAVE_TINY_SPEED_T): New define.
(emacs_config_features): Add BE_APP.
* doc/emacs/Makefile.in (EMACSSOURCES): Add Haiku
appendix.
* doc/emacs/emacs.texi: Add Haiku appendix to menus and
include it.
* doc/emacs/haiku.texi: New Haiku appendix.
* doc/lispref/display.texi (Defining Faces, Window Systems):
Explain meaning of `haiku' as a window system identifier.
(haiku-use-system-tooltips): Explain meaning of system
tooltips on
Haiku.
* doc/lispref/frames.texi (Multiple Terminals): Explain
meaning of haiku as a display type.
(Frame Layout): Clarify section for Haiku frames.
(Size Parameters): Explain limitations of fullwidth and
fullheight on Haiku.
(Management Parameters): Explain limitations of
inhibiting double buffering on builds with Cairo,
and the inability of frames with no-accept-focus to
receive keyboard input on Haiku.
(Font and Color Parameters): Explain the different font
backends available on Haiku.
(Raising and Lowering): Explain that lowering and
restacking frames doesn't work on Haiku.
(Child Frames): Explain oddities of child frame
visibility on Haiku.
* doc/lispref/os.texi (System Environment): Explain
meaning of haiku.
* etc/MACHINES: Add appropriate notices for Haiku.
* etc/NEWS: Document changes.
* etc/PROBLEMS: Document font spacing bug on Haiku.
* lib-src/Makefile.in: Build be-resources binary on
Haiku.
(CXX, CXXFLAGS, NON_CXX_FLAGS, ALL_CXXFLAGS)
(HAVE_BE_APP, HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(DONT_INSTALL): Add be-resources binary if on Haiku.
(be-resources): New target.
* lib-src/be_resources: Add helper binary for setting
resources on the Emacs application.
* lib-src/emacsclient.c (decode_options): Set
alt_display to "be" on Haiku.
* lisp/cus-edit.el (custom-button, custom-button-mouse)
(custom-button-unraised, custom-button-pressed): Update
face definitions for Haiku.
* lisp/cus-start.el: Add haiku-debug-on-fatal-error and
haiku-use-system-tooltips.
* lisp/faces.el (face-valid-attribute-values): Clarify
attribute comment for Haiku.
(tool-bar): Add appropriate toolbar color for Haiku.
* lisp/frame.el (haiku-frame-geometry)
(haiku-mouse-absolute-pixel-position)
(haiku-set-mouse-absolute-pixel-position)
(haiku-frame-edges)
(haiku-frame-list-z-order): New function declarations.
(frame-geometry, frame-edges)
(mouse-absolute-pixel-position)
(set-mouse-absolute-pixel-position)
(frame-list-z-order): Call appropriate window system
functions on Haiku.
(display-mouse-p, display-graphic-p)
(display-images-p, display-pixel-height)
(display-pixel-width, display-mm-height)
(display-mm-width, display-backing-store)
(display-save-under, display-planes)
(display-color-cells, display-visual-class): Update type
tests for Haiku.
* lisp/international/mule-cmds.el
(set-coding-system-map): Also
prevent set-terminal-coding-system from appearing in the menu
bar on Haiku.
* lisp/loadup.el: Load Haiku-specific files when built
with Haiku, and don't rename newly built Emacs on Haiku as BFS
doesn't support hard links.
* lisp/menu-bar.el (menu-bar-open): Add for Haiku.
* lisp/mwheel.el (mouse-wheel-down-event): Expect
wheel-up on Haiku.
(mouse-wheel-up-event): Expect wheel-down on Haiku.
(mouse-wheel-left-event): Expect wheel-left on Haiku.
(mouse-wheel-right-event): Expect wheel-right on Haiku.
* lisp/net/browse-url.el
(browse-url--browser-defcustom-type):
Add option for WebPositive.
(browse-url-webpositive-program): New variable.
(browse-url-default-program): Search for WebPositive.
(browse-url-webpositive): New function.
* lisp/net/eww.el (eww-form-submit, eww-form-file)
(eww-form-checkbox, eww-form-select): Define faces
appropriately for Haiku.
* lisp/term/haiku-win.el: New file.
* lisp/tooltip.el (menu-or-popup-active-p): New function
declaration.
(tooltip-show-help): Don't use tooltips on Haiku when a
menu is active.
* lisp/version.el (haiku-get-version-string): New
function declaration.
(emacs-version): Add Haiku version string if
appropriate.
* src/Makefile.in: Also produce binary named "Emacs"
with Haiku resources set.
(CXX, HAIKU_OBJ, HAIKU_CXX_OBJ, HAIKU_LIBS)
(HAIKU_CFLAGS, HAVE_BE_APP, NON_CXX_FLAGS)
(ALL_CXX_FLAGS): New variables.
(.SUFFIXES): Add .cc.
(.cc.o): New target.
(base_obj): Add Haiku C objects.
(doc_obj, obj): Split objects that should scanned for
documentation into doc_obj.
(SOME_MACHINE_OBJECTS): Add appropriate Haiku C objects.
(all): Depend on Emacs and Emacs.pdmp on Haiku.
(LIBES): Add Haiku libraries.
(gl-stamp)
($(etc)/DOC): Scan doc_obj instead of obj
(temacs$(EXEEXT): Use C++ linker on Haiku.
(ctagsfiles3): New variable.
(TAGS): Scan C++ files.
* src/alloc.c (garbage_collect): Mark Haiku display.
* src/dispextern.h (HAVE_NATIVE_TRANSFORMS): Also enable
on Haiku.
(struct image): Add fields for Haiku transforms.
(RGB_PIXEL_COLOR): Define to unsigned long on Haiku as
well.
(sit_for): Also check USABLE_SIGPOLL.
(init_display_interactive): Set initial window system to
Haiku on Haiku builds.
* src/emacs.c (main): Define Haiku syms and init haiku
clipboard.
(shut_down_emacs): Quit BApplication on Haiku and
trigger debug
on aborts if haiku_debug_on_fatal_error.
(Vsystem_type): Update docstring.
* src/fileio.c (next-read-file-uses-dialog-p): Enable on
Haiku.
* src/filelock.c (WTMP_FILE): Only define if BOOT_TIME
is also defined.
* src/floatfns.c (double_integer_scale): Work around
Haiku libroot brain damage.
* src/font.c (syms_of_font): Define appropriate font
driver symbols for Haiku builds with various options.
* src/font.h: Also enable ftcrfont on Haiku builds with
Cairo.
(font_data_structures_may_be_ill_formed): Also enable on
Haiku builds that have Cairo.
* src/frame.c (Fframep): Update doc-string for Haiku
builds and return haiku if appropriate.
(syms_of_frame): New symbol `haiku'.
* src/frame.h (struct frame): Add output data for Haiku.
(FRAME_HAIKU_P): New macro.
(FRAME_WINDOW_P): Test for Haiku frames as well.
* src/ftcrfont.c (RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG): New macros.
(ftcrfont_draw): Add haiku specific code for Haiku
builds with Cairo.
* src/ftfont.c (ftfont_open): Set face.
(ftfont_has_char, ftfont_text_extents): Work around
crash.
(syms_of_ftfont): New symbol `mono'.
* src/ftfont.h (struct font_info): Enable Cairo-specific
fields for Cairo builds on Haiku.
* src/haiku_draw_support.cc:
* src/haiku_font_support.cc:
* src/haiku_io.c:
* src/haiku_select.cc:
* src/haiku_support.cc:
* src/haiku_support.h:
* src/haikufns.c:
* src/haikufont.c:
* src/haikugui.h:
* src/haikuimage.c:
* src/haikumenu.c:
* src/haikuselect.c:
* src/haikuselect.h:
* src/haikuterm.c:
* src/haikuterm.h: Add new files for Haiku windowing
support.
* src/haiku.c: Add new files for Haiku operating system
support.
* src/image.c: Implement image transforms and native XPM
support
on Haiku.
(GET_PIXEL, PUT_PIXEL, NO_PIXMAP)
(PIX_MASK_RETAIN, PIX_MASK_DRAW)
(RGB_TO_ULONG, RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG, RED16_FROM_ULONG, GREEN16_FROM_ULONG)
(BLUE16_FROM_ULONG): Define to appropriate values on
Haiku.
(image_create_bitmap_from_data): Add Haiku support.
(image_create_bitmap_from_file): Add TODO on Haiku.
(free_bitmap_record): Free bitmap on Haiku.
(image_size_in_bytes): Implement for Haiku bitmaps.
(image_set_transform): Implement on Haiku.
(image_create_x_image_and_pixmap_1): Implement on Haiku,
24-bit or 1-bit only.
(image_destroy_x_image, image_get_x_image): Use correct
img and pixmap values on Haiku.
(lookup_rgb_color): Use correct macro on Haiku.
(image_to_emacs_colors): Implement on Haiku.
(image_disable_image): Disable on Haiku.
(image_can_use_native_api): Test for translator presence
on Haiku.
(native_image_load): Use translator on Haiku.
(imagemagick_load_image): Add Haiku-specific quirks.
(Fimage_transforms_p): Allow rotate90 on Haiku.
(image_types): Enable native XPM support on Haiku.
(syms_of_image): Enable XPM images on Haiku.
* src/keyboard.c (kbd_buffer_get_event)
(handle_async_input, handle_input_available_signal)
(handle_user_signal, Fset_input_interrupt_mode)
(init_keyboard): Check for USABLE_SIGPOLL along with
USABLE_SIGIO.
* src/lisp.h (pD): Work around broken Haiku headers.
(HAVE_EXT_MENU_BAR): Define on Haiku.
(handle_input_available_signal): Enable if we just have
SIGPOLL as well.
* src/menu.c (have_boxes): Return true on Haiku.
(single_menu_item): Enable toolkit menus on Haiku.
(find_and_call_menu_selection): Also enable on Haiku.
* src/process.c (keyboard_bit_set): Enable with only
usable SIGPOLL.
(wait_reading_process_output): Test for SIGPOLL as well
as SIGIO availability.
* src/sound.c (sound_perror, vox_open)
(vox_configure, vox_close): Enable for usable SIGPOLL as
well.
* src/sysdep.c (sys_subshell): Enable for usable SIGPOLL.
(reset_sigio): Make conditional on F_SETOWN.
(request_sigio, unrequest_sigio)
(emacs_sigaction_init): Also handle SIGPOLLs.
(init_sys_modes): Disable TCXONC usage on Haiku, as it
doesn't have any ttys other than pseudo ttys, which don't
support C-s/C-q flow control, and causes compiler warnings.
(speeds): Disable high speeds if HAVE_TINY_SPEED_T.
* src/termhooks.h (enum output_method): Add output_haiku.
(struct terminal): Add Haiku display info.
(TERMINAL_FONT_CACHE): Enable for Haiku.
* src/terminal.c (Fterminal_live_p): Return `haiku' if
appropriate.
* src/verbose.mk.in (AM_V_CXX, AM_V_CXXLD): New logging
variables.
* src/xdisp.c (redisplay_internal)
(note_mouse_highlight): Return on Haiku if a popup is activated.
(display_menu_bar): Return on Haiku if frame is a Haiku
frame.
* src/xfaces.c (GCGraphicsExposures): Enable correctly on Haiku.
(x_create_gc): Enable dummy GC code on Haiku.
* src/xfns.c (x-server-version, x-file-dialog): Add
Haiku specifics to doc strings.
* src/xterm.c (syms_of_xterm): Add Haiku information to
doc string.
2021-11-20 13:30:08 +00:00
|
|
|
|
(and (memq (framep-on-display display) '(x w32 ns haiku))
|
2006-09-06 11:51:57 +00:00
|
|
|
|
(or (cddr (assoc (or display (frame-parameter nil 'display))
|
|
|
|
|
display-mm-dimensions-alist))
|
|
|
|
|
(cddr (assoc t display-mm-dimensions-alist))
|
|
|
|
|
(x-display-mm-height display))))
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
|
2008-06-12 03:56:20 +00:00
|
|
|
|
(declare-function x-display-mm-width "xfns.c" (&optional terminal))
|
|
|
|
|
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(defun display-mm-width (&optional display)
|
|
|
|
|
"Return the width of DISPLAY's screen in millimeters.
|
2014-03-03 01:00:27 +00:00
|
|
|
|
If the information is unavailable, this function returns nil.
|
2014-10-08 10:16:45 +00:00
|
|
|
|
DISPLAY can be a display name or a frame.
|
2014-03-03 01:00:27 +00:00
|
|
|
|
If DISPLAY is omitted or nil, it defaults to the selected frame's display.
|
|
|
|
|
|
|
|
|
|
You can override what the system thinks the result should be by
|
|
|
|
|
adding an entry to `display-mm-dimensions-alist'.
|
|
|
|
|
|
2013-07-04 10:25:54 +00:00
|
|
|
|
For graphical terminals, note that on \"multi-monitor\" setups this
|
|
|
|
|
refers to the width in millimeters for all physical monitors
|
|
|
|
|
associated with DISPLAY. To get information for each physical
|
2014-03-03 01:00:27 +00:00
|
|
|
|
monitor, use `display-monitor-attributes-list'."
|
Add support for the Haiku operating system and its window system
* .gitignore: Add binaries specific to Haiku.
* Makefie.in (HAVE_BE_APP): New variable.
(install-arch-dep): Install Emacs and Emacs.pdmp when
using Haiku.
* configure.ac: Detect and configure for Haiku and
various related configurations.
(be-app, be-freetype, be-cairo): New options.
(HAVE_BE_APP, HAIKU_OBJ, HAIKU_CXX_OBJ)
(HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(HAIKU, HAVE_TINY_SPEED_T): New define.
(emacs_config_features): Add BE_APP.
* doc/emacs/Makefile.in (EMACSSOURCES): Add Haiku
appendix.
* doc/emacs/emacs.texi: Add Haiku appendix to menus and
include it.
* doc/emacs/haiku.texi: New Haiku appendix.
* doc/lispref/display.texi (Defining Faces, Window Systems):
Explain meaning of `haiku' as a window system identifier.
(haiku-use-system-tooltips): Explain meaning of system
tooltips on
Haiku.
* doc/lispref/frames.texi (Multiple Terminals): Explain
meaning of haiku as a display type.
(Frame Layout): Clarify section for Haiku frames.
(Size Parameters): Explain limitations of fullwidth and
fullheight on Haiku.
(Management Parameters): Explain limitations of
inhibiting double buffering on builds with Cairo,
and the inability of frames with no-accept-focus to
receive keyboard input on Haiku.
(Font and Color Parameters): Explain the different font
backends available on Haiku.
(Raising and Lowering): Explain that lowering and
restacking frames doesn't work on Haiku.
(Child Frames): Explain oddities of child frame
visibility on Haiku.
* doc/lispref/os.texi (System Environment): Explain
meaning of haiku.
* etc/MACHINES: Add appropriate notices for Haiku.
* etc/NEWS: Document changes.
* etc/PROBLEMS: Document font spacing bug on Haiku.
* lib-src/Makefile.in: Build be-resources binary on
Haiku.
(CXX, CXXFLAGS, NON_CXX_FLAGS, ALL_CXXFLAGS)
(HAVE_BE_APP, HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(DONT_INSTALL): Add be-resources binary if on Haiku.
(be-resources): New target.
* lib-src/be_resources: Add helper binary for setting
resources on the Emacs application.
* lib-src/emacsclient.c (decode_options): Set
alt_display to "be" on Haiku.
* lisp/cus-edit.el (custom-button, custom-button-mouse)
(custom-button-unraised, custom-button-pressed): Update
face definitions for Haiku.
* lisp/cus-start.el: Add haiku-debug-on-fatal-error and
haiku-use-system-tooltips.
* lisp/faces.el (face-valid-attribute-values): Clarify
attribute comment for Haiku.
(tool-bar): Add appropriate toolbar color for Haiku.
* lisp/frame.el (haiku-frame-geometry)
(haiku-mouse-absolute-pixel-position)
(haiku-set-mouse-absolute-pixel-position)
(haiku-frame-edges)
(haiku-frame-list-z-order): New function declarations.
(frame-geometry, frame-edges)
(mouse-absolute-pixel-position)
(set-mouse-absolute-pixel-position)
(frame-list-z-order): Call appropriate window system
functions on Haiku.
(display-mouse-p, display-graphic-p)
(display-images-p, display-pixel-height)
(display-pixel-width, display-mm-height)
(display-mm-width, display-backing-store)
(display-save-under, display-planes)
(display-color-cells, display-visual-class): Update type
tests for Haiku.
* lisp/international/mule-cmds.el
(set-coding-system-map): Also
prevent set-terminal-coding-system from appearing in the menu
bar on Haiku.
* lisp/loadup.el: Load Haiku-specific files when built
with Haiku, and don't rename newly built Emacs on Haiku as BFS
doesn't support hard links.
* lisp/menu-bar.el (menu-bar-open): Add for Haiku.
* lisp/mwheel.el (mouse-wheel-down-event): Expect
wheel-up on Haiku.
(mouse-wheel-up-event): Expect wheel-down on Haiku.
(mouse-wheel-left-event): Expect wheel-left on Haiku.
(mouse-wheel-right-event): Expect wheel-right on Haiku.
* lisp/net/browse-url.el
(browse-url--browser-defcustom-type):
Add option for WebPositive.
(browse-url-webpositive-program): New variable.
(browse-url-default-program): Search for WebPositive.
(browse-url-webpositive): New function.
* lisp/net/eww.el (eww-form-submit, eww-form-file)
(eww-form-checkbox, eww-form-select): Define faces
appropriately for Haiku.
* lisp/term/haiku-win.el: New file.
* lisp/tooltip.el (menu-or-popup-active-p): New function
declaration.
(tooltip-show-help): Don't use tooltips on Haiku when a
menu is active.
* lisp/version.el (haiku-get-version-string): New
function declaration.
(emacs-version): Add Haiku version string if
appropriate.
* src/Makefile.in: Also produce binary named "Emacs"
with Haiku resources set.
(CXX, HAIKU_OBJ, HAIKU_CXX_OBJ, HAIKU_LIBS)
(HAIKU_CFLAGS, HAVE_BE_APP, NON_CXX_FLAGS)
(ALL_CXX_FLAGS): New variables.
(.SUFFIXES): Add .cc.
(.cc.o): New target.
(base_obj): Add Haiku C objects.
(doc_obj, obj): Split objects that should scanned for
documentation into doc_obj.
(SOME_MACHINE_OBJECTS): Add appropriate Haiku C objects.
(all): Depend on Emacs and Emacs.pdmp on Haiku.
(LIBES): Add Haiku libraries.
(gl-stamp)
($(etc)/DOC): Scan doc_obj instead of obj
(temacs$(EXEEXT): Use C++ linker on Haiku.
(ctagsfiles3): New variable.
(TAGS): Scan C++ files.
* src/alloc.c (garbage_collect): Mark Haiku display.
* src/dispextern.h (HAVE_NATIVE_TRANSFORMS): Also enable
on Haiku.
(struct image): Add fields for Haiku transforms.
(RGB_PIXEL_COLOR): Define to unsigned long on Haiku as
well.
(sit_for): Also check USABLE_SIGPOLL.
(init_display_interactive): Set initial window system to
Haiku on Haiku builds.
* src/emacs.c (main): Define Haiku syms and init haiku
clipboard.
(shut_down_emacs): Quit BApplication on Haiku and
trigger debug
on aborts if haiku_debug_on_fatal_error.
(Vsystem_type): Update docstring.
* src/fileio.c (next-read-file-uses-dialog-p): Enable on
Haiku.
* src/filelock.c (WTMP_FILE): Only define if BOOT_TIME
is also defined.
* src/floatfns.c (double_integer_scale): Work around
Haiku libroot brain damage.
* src/font.c (syms_of_font): Define appropriate font
driver symbols for Haiku builds with various options.
* src/font.h: Also enable ftcrfont on Haiku builds with
Cairo.
(font_data_structures_may_be_ill_formed): Also enable on
Haiku builds that have Cairo.
* src/frame.c (Fframep): Update doc-string for Haiku
builds and return haiku if appropriate.
(syms_of_frame): New symbol `haiku'.
* src/frame.h (struct frame): Add output data for Haiku.
(FRAME_HAIKU_P): New macro.
(FRAME_WINDOW_P): Test for Haiku frames as well.
* src/ftcrfont.c (RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG): New macros.
(ftcrfont_draw): Add haiku specific code for Haiku
builds with Cairo.
* src/ftfont.c (ftfont_open): Set face.
(ftfont_has_char, ftfont_text_extents): Work around
crash.
(syms_of_ftfont): New symbol `mono'.
* src/ftfont.h (struct font_info): Enable Cairo-specific
fields for Cairo builds on Haiku.
* src/haiku_draw_support.cc:
* src/haiku_font_support.cc:
* src/haiku_io.c:
* src/haiku_select.cc:
* src/haiku_support.cc:
* src/haiku_support.h:
* src/haikufns.c:
* src/haikufont.c:
* src/haikugui.h:
* src/haikuimage.c:
* src/haikumenu.c:
* src/haikuselect.c:
* src/haikuselect.h:
* src/haikuterm.c:
* src/haikuterm.h: Add new files for Haiku windowing
support.
* src/haiku.c: Add new files for Haiku operating system
support.
* src/image.c: Implement image transforms and native XPM
support
on Haiku.
(GET_PIXEL, PUT_PIXEL, NO_PIXMAP)
(PIX_MASK_RETAIN, PIX_MASK_DRAW)
(RGB_TO_ULONG, RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG, RED16_FROM_ULONG, GREEN16_FROM_ULONG)
(BLUE16_FROM_ULONG): Define to appropriate values on
Haiku.
(image_create_bitmap_from_data): Add Haiku support.
(image_create_bitmap_from_file): Add TODO on Haiku.
(free_bitmap_record): Free bitmap on Haiku.
(image_size_in_bytes): Implement for Haiku bitmaps.
(image_set_transform): Implement on Haiku.
(image_create_x_image_and_pixmap_1): Implement on Haiku,
24-bit or 1-bit only.
(image_destroy_x_image, image_get_x_image): Use correct
img and pixmap values on Haiku.
(lookup_rgb_color): Use correct macro on Haiku.
(image_to_emacs_colors): Implement on Haiku.
(image_disable_image): Disable on Haiku.
(image_can_use_native_api): Test for translator presence
on Haiku.
(native_image_load): Use translator on Haiku.
(imagemagick_load_image): Add Haiku-specific quirks.
(Fimage_transforms_p): Allow rotate90 on Haiku.
(image_types): Enable native XPM support on Haiku.
(syms_of_image): Enable XPM images on Haiku.
* src/keyboard.c (kbd_buffer_get_event)
(handle_async_input, handle_input_available_signal)
(handle_user_signal, Fset_input_interrupt_mode)
(init_keyboard): Check for USABLE_SIGPOLL along with
USABLE_SIGIO.
* src/lisp.h (pD): Work around broken Haiku headers.
(HAVE_EXT_MENU_BAR): Define on Haiku.
(handle_input_available_signal): Enable if we just have
SIGPOLL as well.
* src/menu.c (have_boxes): Return true on Haiku.
(single_menu_item): Enable toolkit menus on Haiku.
(find_and_call_menu_selection): Also enable on Haiku.
* src/process.c (keyboard_bit_set): Enable with only
usable SIGPOLL.
(wait_reading_process_output): Test for SIGPOLL as well
as SIGIO availability.
* src/sound.c (sound_perror, vox_open)
(vox_configure, vox_close): Enable for usable SIGPOLL as
well.
* src/sysdep.c (sys_subshell): Enable for usable SIGPOLL.
(reset_sigio): Make conditional on F_SETOWN.
(request_sigio, unrequest_sigio)
(emacs_sigaction_init): Also handle SIGPOLLs.
(init_sys_modes): Disable TCXONC usage on Haiku, as it
doesn't have any ttys other than pseudo ttys, which don't
support C-s/C-q flow control, and causes compiler warnings.
(speeds): Disable high speeds if HAVE_TINY_SPEED_T.
* src/termhooks.h (enum output_method): Add output_haiku.
(struct terminal): Add Haiku display info.
(TERMINAL_FONT_CACHE): Enable for Haiku.
* src/terminal.c (Fterminal_live_p): Return `haiku' if
appropriate.
* src/verbose.mk.in (AM_V_CXX, AM_V_CXXLD): New logging
variables.
* src/xdisp.c (redisplay_internal)
(note_mouse_highlight): Return on Haiku if a popup is activated.
(display_menu_bar): Return on Haiku if frame is a Haiku
frame.
* src/xfaces.c (GCGraphicsExposures): Enable correctly on Haiku.
(x_create_gc): Enable dummy GC code on Haiku.
* src/xfns.c (x-server-version, x-file-dialog): Add
Haiku specifics to doc strings.
* src/xterm.c (syms_of_xterm): Add Haiku information to
doc string.
2021-11-20 13:30:08 +00:00
|
|
|
|
(and (memq (framep-on-display display) '(x w32 ns haiku))
|
2006-09-06 11:51:57 +00:00
|
|
|
|
(or (cadr (assoc (or display (frame-parameter nil 'display))
|
|
|
|
|
display-mm-dimensions-alist))
|
|
|
|
|
(cadr (assoc t display-mm-dimensions-alist))
|
|
|
|
|
(x-display-mm-width display))))
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
|
2008-06-12 03:56:20 +00:00
|
|
|
|
(declare-function x-display-backing-store "xfns.c" (&optional terminal))
|
|
|
|
|
|
2013-08-13 02:45:12 +00:00
|
|
|
|
;; In NS port, the return value may be `buffered', `retained', or
|
|
|
|
|
;; `non-retained'. See src/nsfns.m.
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(defun display-backing-store (&optional display)
|
|
|
|
|
"Return the backing store capability of DISPLAY's screen.
|
|
|
|
|
The value may be `always', `when-mapped', `not-useful', or nil if
|
2013-10-22 08:07:51 +00:00
|
|
|
|
the question is inapplicable to a certain kind of display.
|
2014-10-08 10:16:45 +00:00
|
|
|
|
DISPLAY can be a display name or a frame.
|
2013-10-22 08:07:51 +00:00
|
|
|
|
If DISPLAY is omitted or nil, it defaults to the selected frame's display."
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(let ((frame-type (framep-on-display display)))
|
|
|
|
|
(cond
|
Add support for the Haiku operating system and its window system
* .gitignore: Add binaries specific to Haiku.
* Makefie.in (HAVE_BE_APP): New variable.
(install-arch-dep): Install Emacs and Emacs.pdmp when
using Haiku.
* configure.ac: Detect and configure for Haiku and
various related configurations.
(be-app, be-freetype, be-cairo): New options.
(HAVE_BE_APP, HAIKU_OBJ, HAIKU_CXX_OBJ)
(HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(HAIKU, HAVE_TINY_SPEED_T): New define.
(emacs_config_features): Add BE_APP.
* doc/emacs/Makefile.in (EMACSSOURCES): Add Haiku
appendix.
* doc/emacs/emacs.texi: Add Haiku appendix to menus and
include it.
* doc/emacs/haiku.texi: New Haiku appendix.
* doc/lispref/display.texi (Defining Faces, Window Systems):
Explain meaning of `haiku' as a window system identifier.
(haiku-use-system-tooltips): Explain meaning of system
tooltips on
Haiku.
* doc/lispref/frames.texi (Multiple Terminals): Explain
meaning of haiku as a display type.
(Frame Layout): Clarify section for Haiku frames.
(Size Parameters): Explain limitations of fullwidth and
fullheight on Haiku.
(Management Parameters): Explain limitations of
inhibiting double buffering on builds with Cairo,
and the inability of frames with no-accept-focus to
receive keyboard input on Haiku.
(Font and Color Parameters): Explain the different font
backends available on Haiku.
(Raising and Lowering): Explain that lowering and
restacking frames doesn't work on Haiku.
(Child Frames): Explain oddities of child frame
visibility on Haiku.
* doc/lispref/os.texi (System Environment): Explain
meaning of haiku.
* etc/MACHINES: Add appropriate notices for Haiku.
* etc/NEWS: Document changes.
* etc/PROBLEMS: Document font spacing bug on Haiku.
* lib-src/Makefile.in: Build be-resources binary on
Haiku.
(CXX, CXXFLAGS, NON_CXX_FLAGS, ALL_CXXFLAGS)
(HAVE_BE_APP, HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(DONT_INSTALL): Add be-resources binary if on Haiku.
(be-resources): New target.
* lib-src/be_resources: Add helper binary for setting
resources on the Emacs application.
* lib-src/emacsclient.c (decode_options): Set
alt_display to "be" on Haiku.
* lisp/cus-edit.el (custom-button, custom-button-mouse)
(custom-button-unraised, custom-button-pressed): Update
face definitions for Haiku.
* lisp/cus-start.el: Add haiku-debug-on-fatal-error and
haiku-use-system-tooltips.
* lisp/faces.el (face-valid-attribute-values): Clarify
attribute comment for Haiku.
(tool-bar): Add appropriate toolbar color for Haiku.
* lisp/frame.el (haiku-frame-geometry)
(haiku-mouse-absolute-pixel-position)
(haiku-set-mouse-absolute-pixel-position)
(haiku-frame-edges)
(haiku-frame-list-z-order): New function declarations.
(frame-geometry, frame-edges)
(mouse-absolute-pixel-position)
(set-mouse-absolute-pixel-position)
(frame-list-z-order): Call appropriate window system
functions on Haiku.
(display-mouse-p, display-graphic-p)
(display-images-p, display-pixel-height)
(display-pixel-width, display-mm-height)
(display-mm-width, display-backing-store)
(display-save-under, display-planes)
(display-color-cells, display-visual-class): Update type
tests for Haiku.
* lisp/international/mule-cmds.el
(set-coding-system-map): Also
prevent set-terminal-coding-system from appearing in the menu
bar on Haiku.
* lisp/loadup.el: Load Haiku-specific files when built
with Haiku, and don't rename newly built Emacs on Haiku as BFS
doesn't support hard links.
* lisp/menu-bar.el (menu-bar-open): Add for Haiku.
* lisp/mwheel.el (mouse-wheel-down-event): Expect
wheel-up on Haiku.
(mouse-wheel-up-event): Expect wheel-down on Haiku.
(mouse-wheel-left-event): Expect wheel-left on Haiku.
(mouse-wheel-right-event): Expect wheel-right on Haiku.
* lisp/net/browse-url.el
(browse-url--browser-defcustom-type):
Add option for WebPositive.
(browse-url-webpositive-program): New variable.
(browse-url-default-program): Search for WebPositive.
(browse-url-webpositive): New function.
* lisp/net/eww.el (eww-form-submit, eww-form-file)
(eww-form-checkbox, eww-form-select): Define faces
appropriately for Haiku.
* lisp/term/haiku-win.el: New file.
* lisp/tooltip.el (menu-or-popup-active-p): New function
declaration.
(tooltip-show-help): Don't use tooltips on Haiku when a
menu is active.
* lisp/version.el (haiku-get-version-string): New
function declaration.
(emacs-version): Add Haiku version string if
appropriate.
* src/Makefile.in: Also produce binary named "Emacs"
with Haiku resources set.
(CXX, HAIKU_OBJ, HAIKU_CXX_OBJ, HAIKU_LIBS)
(HAIKU_CFLAGS, HAVE_BE_APP, NON_CXX_FLAGS)
(ALL_CXX_FLAGS): New variables.
(.SUFFIXES): Add .cc.
(.cc.o): New target.
(base_obj): Add Haiku C objects.
(doc_obj, obj): Split objects that should scanned for
documentation into doc_obj.
(SOME_MACHINE_OBJECTS): Add appropriate Haiku C objects.
(all): Depend on Emacs and Emacs.pdmp on Haiku.
(LIBES): Add Haiku libraries.
(gl-stamp)
($(etc)/DOC): Scan doc_obj instead of obj
(temacs$(EXEEXT): Use C++ linker on Haiku.
(ctagsfiles3): New variable.
(TAGS): Scan C++ files.
* src/alloc.c (garbage_collect): Mark Haiku display.
* src/dispextern.h (HAVE_NATIVE_TRANSFORMS): Also enable
on Haiku.
(struct image): Add fields for Haiku transforms.
(RGB_PIXEL_COLOR): Define to unsigned long on Haiku as
well.
(sit_for): Also check USABLE_SIGPOLL.
(init_display_interactive): Set initial window system to
Haiku on Haiku builds.
* src/emacs.c (main): Define Haiku syms and init haiku
clipboard.
(shut_down_emacs): Quit BApplication on Haiku and
trigger debug
on aborts if haiku_debug_on_fatal_error.
(Vsystem_type): Update docstring.
* src/fileio.c (next-read-file-uses-dialog-p): Enable on
Haiku.
* src/filelock.c (WTMP_FILE): Only define if BOOT_TIME
is also defined.
* src/floatfns.c (double_integer_scale): Work around
Haiku libroot brain damage.
* src/font.c (syms_of_font): Define appropriate font
driver symbols for Haiku builds with various options.
* src/font.h: Also enable ftcrfont on Haiku builds with
Cairo.
(font_data_structures_may_be_ill_formed): Also enable on
Haiku builds that have Cairo.
* src/frame.c (Fframep): Update doc-string for Haiku
builds and return haiku if appropriate.
(syms_of_frame): New symbol `haiku'.
* src/frame.h (struct frame): Add output data for Haiku.
(FRAME_HAIKU_P): New macro.
(FRAME_WINDOW_P): Test for Haiku frames as well.
* src/ftcrfont.c (RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG): New macros.
(ftcrfont_draw): Add haiku specific code for Haiku
builds with Cairo.
* src/ftfont.c (ftfont_open): Set face.
(ftfont_has_char, ftfont_text_extents): Work around
crash.
(syms_of_ftfont): New symbol `mono'.
* src/ftfont.h (struct font_info): Enable Cairo-specific
fields for Cairo builds on Haiku.
* src/haiku_draw_support.cc:
* src/haiku_font_support.cc:
* src/haiku_io.c:
* src/haiku_select.cc:
* src/haiku_support.cc:
* src/haiku_support.h:
* src/haikufns.c:
* src/haikufont.c:
* src/haikugui.h:
* src/haikuimage.c:
* src/haikumenu.c:
* src/haikuselect.c:
* src/haikuselect.h:
* src/haikuterm.c:
* src/haikuterm.h: Add new files for Haiku windowing
support.
* src/haiku.c: Add new files for Haiku operating system
support.
* src/image.c: Implement image transforms and native XPM
support
on Haiku.
(GET_PIXEL, PUT_PIXEL, NO_PIXMAP)
(PIX_MASK_RETAIN, PIX_MASK_DRAW)
(RGB_TO_ULONG, RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG, RED16_FROM_ULONG, GREEN16_FROM_ULONG)
(BLUE16_FROM_ULONG): Define to appropriate values on
Haiku.
(image_create_bitmap_from_data): Add Haiku support.
(image_create_bitmap_from_file): Add TODO on Haiku.
(free_bitmap_record): Free bitmap on Haiku.
(image_size_in_bytes): Implement for Haiku bitmaps.
(image_set_transform): Implement on Haiku.
(image_create_x_image_and_pixmap_1): Implement on Haiku,
24-bit or 1-bit only.
(image_destroy_x_image, image_get_x_image): Use correct
img and pixmap values on Haiku.
(lookup_rgb_color): Use correct macro on Haiku.
(image_to_emacs_colors): Implement on Haiku.
(image_disable_image): Disable on Haiku.
(image_can_use_native_api): Test for translator presence
on Haiku.
(native_image_load): Use translator on Haiku.
(imagemagick_load_image): Add Haiku-specific quirks.
(Fimage_transforms_p): Allow rotate90 on Haiku.
(image_types): Enable native XPM support on Haiku.
(syms_of_image): Enable XPM images on Haiku.
* src/keyboard.c (kbd_buffer_get_event)
(handle_async_input, handle_input_available_signal)
(handle_user_signal, Fset_input_interrupt_mode)
(init_keyboard): Check for USABLE_SIGPOLL along with
USABLE_SIGIO.
* src/lisp.h (pD): Work around broken Haiku headers.
(HAVE_EXT_MENU_BAR): Define on Haiku.
(handle_input_available_signal): Enable if we just have
SIGPOLL as well.
* src/menu.c (have_boxes): Return true on Haiku.
(single_menu_item): Enable toolkit menus on Haiku.
(find_and_call_menu_selection): Also enable on Haiku.
* src/process.c (keyboard_bit_set): Enable with only
usable SIGPOLL.
(wait_reading_process_output): Test for SIGPOLL as well
as SIGIO availability.
* src/sound.c (sound_perror, vox_open)
(vox_configure, vox_close): Enable for usable SIGPOLL as
well.
* src/sysdep.c (sys_subshell): Enable for usable SIGPOLL.
(reset_sigio): Make conditional on F_SETOWN.
(request_sigio, unrequest_sigio)
(emacs_sigaction_init): Also handle SIGPOLLs.
(init_sys_modes): Disable TCXONC usage on Haiku, as it
doesn't have any ttys other than pseudo ttys, which don't
support C-s/C-q flow control, and causes compiler warnings.
(speeds): Disable high speeds if HAVE_TINY_SPEED_T.
* src/termhooks.h (enum output_method): Add output_haiku.
(struct terminal): Add Haiku display info.
(TERMINAL_FONT_CACHE): Enable for Haiku.
* src/terminal.c (Fterminal_live_p): Return `haiku' if
appropriate.
* src/verbose.mk.in (AM_V_CXX, AM_V_CXXLD): New logging
variables.
* src/xdisp.c (redisplay_internal)
(note_mouse_highlight): Return on Haiku if a popup is activated.
(display_menu_bar): Return on Haiku if frame is a Haiku
frame.
* src/xfaces.c (GCGraphicsExposures): Enable correctly on Haiku.
(x_create_gc): Enable dummy GC code on Haiku.
* src/xfns.c (x-server-version, x-file-dialog): Add
Haiku specifics to doc strings.
* src/xterm.c (syms_of_xterm): Add Haiku information to
doc string.
2021-11-20 13:30:08 +00:00
|
|
|
|
((memq frame-type '(x w32 ns haiku))
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(x-display-backing-store display))
|
|
|
|
|
(t
|
|
|
|
|
'not-useful))))
|
|
|
|
|
|
2008-06-12 03:56:20 +00:00
|
|
|
|
(declare-function x-display-save-under "xfns.c" (&optional terminal))
|
|
|
|
|
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(defun display-save-under (&optional display)
|
2013-10-22 08:07:51 +00:00
|
|
|
|
"Return non-nil if DISPLAY's screen supports the SaveUnder feature.
|
2014-10-08 10:16:45 +00:00
|
|
|
|
DISPLAY can be a display name or a frame.
|
2013-10-22 08:07:51 +00:00
|
|
|
|
If DISPLAY is omitted or nil, it defaults to the selected frame's display."
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(let ((frame-type (framep-on-display display)))
|
|
|
|
|
(cond
|
Add support for the Haiku operating system and its window system
* .gitignore: Add binaries specific to Haiku.
* Makefie.in (HAVE_BE_APP): New variable.
(install-arch-dep): Install Emacs and Emacs.pdmp when
using Haiku.
* configure.ac: Detect and configure for Haiku and
various related configurations.
(be-app, be-freetype, be-cairo): New options.
(HAVE_BE_APP, HAIKU_OBJ, HAIKU_CXX_OBJ)
(HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(HAIKU, HAVE_TINY_SPEED_T): New define.
(emacs_config_features): Add BE_APP.
* doc/emacs/Makefile.in (EMACSSOURCES): Add Haiku
appendix.
* doc/emacs/emacs.texi: Add Haiku appendix to menus and
include it.
* doc/emacs/haiku.texi: New Haiku appendix.
* doc/lispref/display.texi (Defining Faces, Window Systems):
Explain meaning of `haiku' as a window system identifier.
(haiku-use-system-tooltips): Explain meaning of system
tooltips on
Haiku.
* doc/lispref/frames.texi (Multiple Terminals): Explain
meaning of haiku as a display type.
(Frame Layout): Clarify section for Haiku frames.
(Size Parameters): Explain limitations of fullwidth and
fullheight on Haiku.
(Management Parameters): Explain limitations of
inhibiting double buffering on builds with Cairo,
and the inability of frames with no-accept-focus to
receive keyboard input on Haiku.
(Font and Color Parameters): Explain the different font
backends available on Haiku.
(Raising and Lowering): Explain that lowering and
restacking frames doesn't work on Haiku.
(Child Frames): Explain oddities of child frame
visibility on Haiku.
* doc/lispref/os.texi (System Environment): Explain
meaning of haiku.
* etc/MACHINES: Add appropriate notices for Haiku.
* etc/NEWS: Document changes.
* etc/PROBLEMS: Document font spacing bug on Haiku.
* lib-src/Makefile.in: Build be-resources binary on
Haiku.
(CXX, CXXFLAGS, NON_CXX_FLAGS, ALL_CXXFLAGS)
(HAVE_BE_APP, HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(DONT_INSTALL): Add be-resources binary if on Haiku.
(be-resources): New target.
* lib-src/be_resources: Add helper binary for setting
resources on the Emacs application.
* lib-src/emacsclient.c (decode_options): Set
alt_display to "be" on Haiku.
* lisp/cus-edit.el (custom-button, custom-button-mouse)
(custom-button-unraised, custom-button-pressed): Update
face definitions for Haiku.
* lisp/cus-start.el: Add haiku-debug-on-fatal-error and
haiku-use-system-tooltips.
* lisp/faces.el (face-valid-attribute-values): Clarify
attribute comment for Haiku.
(tool-bar): Add appropriate toolbar color for Haiku.
* lisp/frame.el (haiku-frame-geometry)
(haiku-mouse-absolute-pixel-position)
(haiku-set-mouse-absolute-pixel-position)
(haiku-frame-edges)
(haiku-frame-list-z-order): New function declarations.
(frame-geometry, frame-edges)
(mouse-absolute-pixel-position)
(set-mouse-absolute-pixel-position)
(frame-list-z-order): Call appropriate window system
functions on Haiku.
(display-mouse-p, display-graphic-p)
(display-images-p, display-pixel-height)
(display-pixel-width, display-mm-height)
(display-mm-width, display-backing-store)
(display-save-under, display-planes)
(display-color-cells, display-visual-class): Update type
tests for Haiku.
* lisp/international/mule-cmds.el
(set-coding-system-map): Also
prevent set-terminal-coding-system from appearing in the menu
bar on Haiku.
* lisp/loadup.el: Load Haiku-specific files when built
with Haiku, and don't rename newly built Emacs on Haiku as BFS
doesn't support hard links.
* lisp/menu-bar.el (menu-bar-open): Add for Haiku.
* lisp/mwheel.el (mouse-wheel-down-event): Expect
wheel-up on Haiku.
(mouse-wheel-up-event): Expect wheel-down on Haiku.
(mouse-wheel-left-event): Expect wheel-left on Haiku.
(mouse-wheel-right-event): Expect wheel-right on Haiku.
* lisp/net/browse-url.el
(browse-url--browser-defcustom-type):
Add option for WebPositive.
(browse-url-webpositive-program): New variable.
(browse-url-default-program): Search for WebPositive.
(browse-url-webpositive): New function.
* lisp/net/eww.el (eww-form-submit, eww-form-file)
(eww-form-checkbox, eww-form-select): Define faces
appropriately for Haiku.
* lisp/term/haiku-win.el: New file.
* lisp/tooltip.el (menu-or-popup-active-p): New function
declaration.
(tooltip-show-help): Don't use tooltips on Haiku when a
menu is active.
* lisp/version.el (haiku-get-version-string): New
function declaration.
(emacs-version): Add Haiku version string if
appropriate.
* src/Makefile.in: Also produce binary named "Emacs"
with Haiku resources set.
(CXX, HAIKU_OBJ, HAIKU_CXX_OBJ, HAIKU_LIBS)
(HAIKU_CFLAGS, HAVE_BE_APP, NON_CXX_FLAGS)
(ALL_CXX_FLAGS): New variables.
(.SUFFIXES): Add .cc.
(.cc.o): New target.
(base_obj): Add Haiku C objects.
(doc_obj, obj): Split objects that should scanned for
documentation into doc_obj.
(SOME_MACHINE_OBJECTS): Add appropriate Haiku C objects.
(all): Depend on Emacs and Emacs.pdmp on Haiku.
(LIBES): Add Haiku libraries.
(gl-stamp)
($(etc)/DOC): Scan doc_obj instead of obj
(temacs$(EXEEXT): Use C++ linker on Haiku.
(ctagsfiles3): New variable.
(TAGS): Scan C++ files.
* src/alloc.c (garbage_collect): Mark Haiku display.
* src/dispextern.h (HAVE_NATIVE_TRANSFORMS): Also enable
on Haiku.
(struct image): Add fields for Haiku transforms.
(RGB_PIXEL_COLOR): Define to unsigned long on Haiku as
well.
(sit_for): Also check USABLE_SIGPOLL.
(init_display_interactive): Set initial window system to
Haiku on Haiku builds.
* src/emacs.c (main): Define Haiku syms and init haiku
clipboard.
(shut_down_emacs): Quit BApplication on Haiku and
trigger debug
on aborts if haiku_debug_on_fatal_error.
(Vsystem_type): Update docstring.
* src/fileio.c (next-read-file-uses-dialog-p): Enable on
Haiku.
* src/filelock.c (WTMP_FILE): Only define if BOOT_TIME
is also defined.
* src/floatfns.c (double_integer_scale): Work around
Haiku libroot brain damage.
* src/font.c (syms_of_font): Define appropriate font
driver symbols for Haiku builds with various options.
* src/font.h: Also enable ftcrfont on Haiku builds with
Cairo.
(font_data_structures_may_be_ill_formed): Also enable on
Haiku builds that have Cairo.
* src/frame.c (Fframep): Update doc-string for Haiku
builds and return haiku if appropriate.
(syms_of_frame): New symbol `haiku'.
* src/frame.h (struct frame): Add output data for Haiku.
(FRAME_HAIKU_P): New macro.
(FRAME_WINDOW_P): Test for Haiku frames as well.
* src/ftcrfont.c (RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG): New macros.
(ftcrfont_draw): Add haiku specific code for Haiku
builds with Cairo.
* src/ftfont.c (ftfont_open): Set face.
(ftfont_has_char, ftfont_text_extents): Work around
crash.
(syms_of_ftfont): New symbol `mono'.
* src/ftfont.h (struct font_info): Enable Cairo-specific
fields for Cairo builds on Haiku.
* src/haiku_draw_support.cc:
* src/haiku_font_support.cc:
* src/haiku_io.c:
* src/haiku_select.cc:
* src/haiku_support.cc:
* src/haiku_support.h:
* src/haikufns.c:
* src/haikufont.c:
* src/haikugui.h:
* src/haikuimage.c:
* src/haikumenu.c:
* src/haikuselect.c:
* src/haikuselect.h:
* src/haikuterm.c:
* src/haikuterm.h: Add new files for Haiku windowing
support.
* src/haiku.c: Add new files for Haiku operating system
support.
* src/image.c: Implement image transforms and native XPM
support
on Haiku.
(GET_PIXEL, PUT_PIXEL, NO_PIXMAP)
(PIX_MASK_RETAIN, PIX_MASK_DRAW)
(RGB_TO_ULONG, RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG, RED16_FROM_ULONG, GREEN16_FROM_ULONG)
(BLUE16_FROM_ULONG): Define to appropriate values on
Haiku.
(image_create_bitmap_from_data): Add Haiku support.
(image_create_bitmap_from_file): Add TODO on Haiku.
(free_bitmap_record): Free bitmap on Haiku.
(image_size_in_bytes): Implement for Haiku bitmaps.
(image_set_transform): Implement on Haiku.
(image_create_x_image_and_pixmap_1): Implement on Haiku,
24-bit or 1-bit only.
(image_destroy_x_image, image_get_x_image): Use correct
img and pixmap values on Haiku.
(lookup_rgb_color): Use correct macro on Haiku.
(image_to_emacs_colors): Implement on Haiku.
(image_disable_image): Disable on Haiku.
(image_can_use_native_api): Test for translator presence
on Haiku.
(native_image_load): Use translator on Haiku.
(imagemagick_load_image): Add Haiku-specific quirks.
(Fimage_transforms_p): Allow rotate90 on Haiku.
(image_types): Enable native XPM support on Haiku.
(syms_of_image): Enable XPM images on Haiku.
* src/keyboard.c (kbd_buffer_get_event)
(handle_async_input, handle_input_available_signal)
(handle_user_signal, Fset_input_interrupt_mode)
(init_keyboard): Check for USABLE_SIGPOLL along with
USABLE_SIGIO.
* src/lisp.h (pD): Work around broken Haiku headers.
(HAVE_EXT_MENU_BAR): Define on Haiku.
(handle_input_available_signal): Enable if we just have
SIGPOLL as well.
* src/menu.c (have_boxes): Return true on Haiku.
(single_menu_item): Enable toolkit menus on Haiku.
(find_and_call_menu_selection): Also enable on Haiku.
* src/process.c (keyboard_bit_set): Enable with only
usable SIGPOLL.
(wait_reading_process_output): Test for SIGPOLL as well
as SIGIO availability.
* src/sound.c (sound_perror, vox_open)
(vox_configure, vox_close): Enable for usable SIGPOLL as
well.
* src/sysdep.c (sys_subshell): Enable for usable SIGPOLL.
(reset_sigio): Make conditional on F_SETOWN.
(request_sigio, unrequest_sigio)
(emacs_sigaction_init): Also handle SIGPOLLs.
(init_sys_modes): Disable TCXONC usage on Haiku, as it
doesn't have any ttys other than pseudo ttys, which don't
support C-s/C-q flow control, and causes compiler warnings.
(speeds): Disable high speeds if HAVE_TINY_SPEED_T.
* src/termhooks.h (enum output_method): Add output_haiku.
(struct terminal): Add Haiku display info.
(TERMINAL_FONT_CACHE): Enable for Haiku.
* src/terminal.c (Fterminal_live_p): Return `haiku' if
appropriate.
* src/verbose.mk.in (AM_V_CXX, AM_V_CXXLD): New logging
variables.
* src/xdisp.c (redisplay_internal)
(note_mouse_highlight): Return on Haiku if a popup is activated.
(display_menu_bar): Return on Haiku if frame is a Haiku
frame.
* src/xfaces.c (GCGraphicsExposures): Enable correctly on Haiku.
(x_create_gc): Enable dummy GC code on Haiku.
* src/xfns.c (x-server-version, x-file-dialog): Add
Haiku specifics to doc strings.
* src/xterm.c (syms_of_xterm): Add Haiku information to
doc string.
2021-11-20 13:30:08 +00:00
|
|
|
|
((memq frame-type '(x w32 ns haiku))
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(x-display-save-under display))
|
|
|
|
|
(t
|
|
|
|
|
'not-useful))))
|
|
|
|
|
|
2008-06-12 03:56:20 +00:00
|
|
|
|
(declare-function x-display-planes "xfns.c" (&optional terminal))
|
|
|
|
|
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(defun display-planes (&optional display)
|
2013-10-22 08:07:51 +00:00
|
|
|
|
"Return the number of planes supported by DISPLAY.
|
2014-10-08 10:16:45 +00:00
|
|
|
|
DISPLAY can be a display name or a frame.
|
2013-10-22 08:07:51 +00:00
|
|
|
|
If DISPLAY is omitted or nil, it defaults to the selected frame's display."
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(let ((frame-type (framep-on-display display)))
|
|
|
|
|
(cond
|
Add support for the Haiku operating system and its window system
* .gitignore: Add binaries specific to Haiku.
* Makefie.in (HAVE_BE_APP): New variable.
(install-arch-dep): Install Emacs and Emacs.pdmp when
using Haiku.
* configure.ac: Detect and configure for Haiku and
various related configurations.
(be-app, be-freetype, be-cairo): New options.
(HAVE_BE_APP, HAIKU_OBJ, HAIKU_CXX_OBJ)
(HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(HAIKU, HAVE_TINY_SPEED_T): New define.
(emacs_config_features): Add BE_APP.
* doc/emacs/Makefile.in (EMACSSOURCES): Add Haiku
appendix.
* doc/emacs/emacs.texi: Add Haiku appendix to menus and
include it.
* doc/emacs/haiku.texi: New Haiku appendix.
* doc/lispref/display.texi (Defining Faces, Window Systems):
Explain meaning of `haiku' as a window system identifier.
(haiku-use-system-tooltips): Explain meaning of system
tooltips on
Haiku.
* doc/lispref/frames.texi (Multiple Terminals): Explain
meaning of haiku as a display type.
(Frame Layout): Clarify section for Haiku frames.
(Size Parameters): Explain limitations of fullwidth and
fullheight on Haiku.
(Management Parameters): Explain limitations of
inhibiting double buffering on builds with Cairo,
and the inability of frames with no-accept-focus to
receive keyboard input on Haiku.
(Font and Color Parameters): Explain the different font
backends available on Haiku.
(Raising and Lowering): Explain that lowering and
restacking frames doesn't work on Haiku.
(Child Frames): Explain oddities of child frame
visibility on Haiku.
* doc/lispref/os.texi (System Environment): Explain
meaning of haiku.
* etc/MACHINES: Add appropriate notices for Haiku.
* etc/NEWS: Document changes.
* etc/PROBLEMS: Document font spacing bug on Haiku.
* lib-src/Makefile.in: Build be-resources binary on
Haiku.
(CXX, CXXFLAGS, NON_CXX_FLAGS, ALL_CXXFLAGS)
(HAVE_BE_APP, HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(DONT_INSTALL): Add be-resources binary if on Haiku.
(be-resources): New target.
* lib-src/be_resources: Add helper binary for setting
resources on the Emacs application.
* lib-src/emacsclient.c (decode_options): Set
alt_display to "be" on Haiku.
* lisp/cus-edit.el (custom-button, custom-button-mouse)
(custom-button-unraised, custom-button-pressed): Update
face definitions for Haiku.
* lisp/cus-start.el: Add haiku-debug-on-fatal-error and
haiku-use-system-tooltips.
* lisp/faces.el (face-valid-attribute-values): Clarify
attribute comment for Haiku.
(tool-bar): Add appropriate toolbar color for Haiku.
* lisp/frame.el (haiku-frame-geometry)
(haiku-mouse-absolute-pixel-position)
(haiku-set-mouse-absolute-pixel-position)
(haiku-frame-edges)
(haiku-frame-list-z-order): New function declarations.
(frame-geometry, frame-edges)
(mouse-absolute-pixel-position)
(set-mouse-absolute-pixel-position)
(frame-list-z-order): Call appropriate window system
functions on Haiku.
(display-mouse-p, display-graphic-p)
(display-images-p, display-pixel-height)
(display-pixel-width, display-mm-height)
(display-mm-width, display-backing-store)
(display-save-under, display-planes)
(display-color-cells, display-visual-class): Update type
tests for Haiku.
* lisp/international/mule-cmds.el
(set-coding-system-map): Also
prevent set-terminal-coding-system from appearing in the menu
bar on Haiku.
* lisp/loadup.el: Load Haiku-specific files when built
with Haiku, and don't rename newly built Emacs on Haiku as BFS
doesn't support hard links.
* lisp/menu-bar.el (menu-bar-open): Add for Haiku.
* lisp/mwheel.el (mouse-wheel-down-event): Expect
wheel-up on Haiku.
(mouse-wheel-up-event): Expect wheel-down on Haiku.
(mouse-wheel-left-event): Expect wheel-left on Haiku.
(mouse-wheel-right-event): Expect wheel-right on Haiku.
* lisp/net/browse-url.el
(browse-url--browser-defcustom-type):
Add option for WebPositive.
(browse-url-webpositive-program): New variable.
(browse-url-default-program): Search for WebPositive.
(browse-url-webpositive): New function.
* lisp/net/eww.el (eww-form-submit, eww-form-file)
(eww-form-checkbox, eww-form-select): Define faces
appropriately for Haiku.
* lisp/term/haiku-win.el: New file.
* lisp/tooltip.el (menu-or-popup-active-p): New function
declaration.
(tooltip-show-help): Don't use tooltips on Haiku when a
menu is active.
* lisp/version.el (haiku-get-version-string): New
function declaration.
(emacs-version): Add Haiku version string if
appropriate.
* src/Makefile.in: Also produce binary named "Emacs"
with Haiku resources set.
(CXX, HAIKU_OBJ, HAIKU_CXX_OBJ, HAIKU_LIBS)
(HAIKU_CFLAGS, HAVE_BE_APP, NON_CXX_FLAGS)
(ALL_CXX_FLAGS): New variables.
(.SUFFIXES): Add .cc.
(.cc.o): New target.
(base_obj): Add Haiku C objects.
(doc_obj, obj): Split objects that should scanned for
documentation into doc_obj.
(SOME_MACHINE_OBJECTS): Add appropriate Haiku C objects.
(all): Depend on Emacs and Emacs.pdmp on Haiku.
(LIBES): Add Haiku libraries.
(gl-stamp)
($(etc)/DOC): Scan doc_obj instead of obj
(temacs$(EXEEXT): Use C++ linker on Haiku.
(ctagsfiles3): New variable.
(TAGS): Scan C++ files.
* src/alloc.c (garbage_collect): Mark Haiku display.
* src/dispextern.h (HAVE_NATIVE_TRANSFORMS): Also enable
on Haiku.
(struct image): Add fields for Haiku transforms.
(RGB_PIXEL_COLOR): Define to unsigned long on Haiku as
well.
(sit_for): Also check USABLE_SIGPOLL.
(init_display_interactive): Set initial window system to
Haiku on Haiku builds.
* src/emacs.c (main): Define Haiku syms and init haiku
clipboard.
(shut_down_emacs): Quit BApplication on Haiku and
trigger debug
on aborts if haiku_debug_on_fatal_error.
(Vsystem_type): Update docstring.
* src/fileio.c (next-read-file-uses-dialog-p): Enable on
Haiku.
* src/filelock.c (WTMP_FILE): Only define if BOOT_TIME
is also defined.
* src/floatfns.c (double_integer_scale): Work around
Haiku libroot brain damage.
* src/font.c (syms_of_font): Define appropriate font
driver symbols for Haiku builds with various options.
* src/font.h: Also enable ftcrfont on Haiku builds with
Cairo.
(font_data_structures_may_be_ill_formed): Also enable on
Haiku builds that have Cairo.
* src/frame.c (Fframep): Update doc-string for Haiku
builds and return haiku if appropriate.
(syms_of_frame): New symbol `haiku'.
* src/frame.h (struct frame): Add output data for Haiku.
(FRAME_HAIKU_P): New macro.
(FRAME_WINDOW_P): Test for Haiku frames as well.
* src/ftcrfont.c (RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG): New macros.
(ftcrfont_draw): Add haiku specific code for Haiku
builds with Cairo.
* src/ftfont.c (ftfont_open): Set face.
(ftfont_has_char, ftfont_text_extents): Work around
crash.
(syms_of_ftfont): New symbol `mono'.
* src/ftfont.h (struct font_info): Enable Cairo-specific
fields for Cairo builds on Haiku.
* src/haiku_draw_support.cc:
* src/haiku_font_support.cc:
* src/haiku_io.c:
* src/haiku_select.cc:
* src/haiku_support.cc:
* src/haiku_support.h:
* src/haikufns.c:
* src/haikufont.c:
* src/haikugui.h:
* src/haikuimage.c:
* src/haikumenu.c:
* src/haikuselect.c:
* src/haikuselect.h:
* src/haikuterm.c:
* src/haikuterm.h: Add new files for Haiku windowing
support.
* src/haiku.c: Add new files for Haiku operating system
support.
* src/image.c: Implement image transforms and native XPM
support
on Haiku.
(GET_PIXEL, PUT_PIXEL, NO_PIXMAP)
(PIX_MASK_RETAIN, PIX_MASK_DRAW)
(RGB_TO_ULONG, RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG, RED16_FROM_ULONG, GREEN16_FROM_ULONG)
(BLUE16_FROM_ULONG): Define to appropriate values on
Haiku.
(image_create_bitmap_from_data): Add Haiku support.
(image_create_bitmap_from_file): Add TODO on Haiku.
(free_bitmap_record): Free bitmap on Haiku.
(image_size_in_bytes): Implement for Haiku bitmaps.
(image_set_transform): Implement on Haiku.
(image_create_x_image_and_pixmap_1): Implement on Haiku,
24-bit or 1-bit only.
(image_destroy_x_image, image_get_x_image): Use correct
img and pixmap values on Haiku.
(lookup_rgb_color): Use correct macro on Haiku.
(image_to_emacs_colors): Implement on Haiku.
(image_disable_image): Disable on Haiku.
(image_can_use_native_api): Test for translator presence
on Haiku.
(native_image_load): Use translator on Haiku.
(imagemagick_load_image): Add Haiku-specific quirks.
(Fimage_transforms_p): Allow rotate90 on Haiku.
(image_types): Enable native XPM support on Haiku.
(syms_of_image): Enable XPM images on Haiku.
* src/keyboard.c (kbd_buffer_get_event)
(handle_async_input, handle_input_available_signal)
(handle_user_signal, Fset_input_interrupt_mode)
(init_keyboard): Check for USABLE_SIGPOLL along with
USABLE_SIGIO.
* src/lisp.h (pD): Work around broken Haiku headers.
(HAVE_EXT_MENU_BAR): Define on Haiku.
(handle_input_available_signal): Enable if we just have
SIGPOLL as well.
* src/menu.c (have_boxes): Return true on Haiku.
(single_menu_item): Enable toolkit menus on Haiku.
(find_and_call_menu_selection): Also enable on Haiku.
* src/process.c (keyboard_bit_set): Enable with only
usable SIGPOLL.
(wait_reading_process_output): Test for SIGPOLL as well
as SIGIO availability.
* src/sound.c (sound_perror, vox_open)
(vox_configure, vox_close): Enable for usable SIGPOLL as
well.
* src/sysdep.c (sys_subshell): Enable for usable SIGPOLL.
(reset_sigio): Make conditional on F_SETOWN.
(request_sigio, unrequest_sigio)
(emacs_sigaction_init): Also handle SIGPOLLs.
(init_sys_modes): Disable TCXONC usage on Haiku, as it
doesn't have any ttys other than pseudo ttys, which don't
support C-s/C-q flow control, and causes compiler warnings.
(speeds): Disable high speeds if HAVE_TINY_SPEED_T.
* src/termhooks.h (enum output_method): Add output_haiku.
(struct terminal): Add Haiku display info.
(TERMINAL_FONT_CACHE): Enable for Haiku.
* src/terminal.c (Fterminal_live_p): Return `haiku' if
appropriate.
* src/verbose.mk.in (AM_V_CXX, AM_V_CXXLD): New logging
variables.
* src/xdisp.c (redisplay_internal)
(note_mouse_highlight): Return on Haiku if a popup is activated.
(display_menu_bar): Return on Haiku if frame is a Haiku
frame.
* src/xfaces.c (GCGraphicsExposures): Enable correctly on Haiku.
(x_create_gc): Enable dummy GC code on Haiku.
* src/xfns.c (x-server-version, x-file-dialog): Add
Haiku specifics to doc strings.
* src/xterm.c (syms_of_xterm): Add Haiku information to
doc string.
2021-11-20 13:30:08 +00:00
|
|
|
|
((memq frame-type '(x w32 ns haiku))
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(x-display-planes display))
|
|
|
|
|
((eq frame-type 'pc)
|
|
|
|
|
4)
|
|
|
|
|
(t
|
2019-04-02 17:14:18 +00:00
|
|
|
|
(logb (length (tty-color-alist)))))))
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
|
2008-06-12 03:56:20 +00:00
|
|
|
|
(declare-function x-display-color-cells "xfns.c" (&optional terminal))
|
|
|
|
|
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(defun display-color-cells (&optional display)
|
2013-10-22 08:07:51 +00:00
|
|
|
|
"Return the number of color cells supported by DISPLAY.
|
2014-10-08 10:16:45 +00:00
|
|
|
|
DISPLAY can be a display name or a frame.
|
2013-10-22 08:07:51 +00:00
|
|
|
|
If DISPLAY is omitted or nil, it defaults to the selected frame's display."
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(let ((frame-type (framep-on-display display)))
|
|
|
|
|
(cond
|
Add support for the Haiku operating system and its window system
* .gitignore: Add binaries specific to Haiku.
* Makefie.in (HAVE_BE_APP): New variable.
(install-arch-dep): Install Emacs and Emacs.pdmp when
using Haiku.
* configure.ac: Detect and configure for Haiku and
various related configurations.
(be-app, be-freetype, be-cairo): New options.
(HAVE_BE_APP, HAIKU_OBJ, HAIKU_CXX_OBJ)
(HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(HAIKU, HAVE_TINY_SPEED_T): New define.
(emacs_config_features): Add BE_APP.
* doc/emacs/Makefile.in (EMACSSOURCES): Add Haiku
appendix.
* doc/emacs/emacs.texi: Add Haiku appendix to menus and
include it.
* doc/emacs/haiku.texi: New Haiku appendix.
* doc/lispref/display.texi (Defining Faces, Window Systems):
Explain meaning of `haiku' as a window system identifier.
(haiku-use-system-tooltips): Explain meaning of system
tooltips on
Haiku.
* doc/lispref/frames.texi (Multiple Terminals): Explain
meaning of haiku as a display type.
(Frame Layout): Clarify section for Haiku frames.
(Size Parameters): Explain limitations of fullwidth and
fullheight on Haiku.
(Management Parameters): Explain limitations of
inhibiting double buffering on builds with Cairo,
and the inability of frames with no-accept-focus to
receive keyboard input on Haiku.
(Font and Color Parameters): Explain the different font
backends available on Haiku.
(Raising and Lowering): Explain that lowering and
restacking frames doesn't work on Haiku.
(Child Frames): Explain oddities of child frame
visibility on Haiku.
* doc/lispref/os.texi (System Environment): Explain
meaning of haiku.
* etc/MACHINES: Add appropriate notices for Haiku.
* etc/NEWS: Document changes.
* etc/PROBLEMS: Document font spacing bug on Haiku.
* lib-src/Makefile.in: Build be-resources binary on
Haiku.
(CXX, CXXFLAGS, NON_CXX_FLAGS, ALL_CXXFLAGS)
(HAVE_BE_APP, HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(DONT_INSTALL): Add be-resources binary if on Haiku.
(be-resources): New target.
* lib-src/be_resources: Add helper binary for setting
resources on the Emacs application.
* lib-src/emacsclient.c (decode_options): Set
alt_display to "be" on Haiku.
* lisp/cus-edit.el (custom-button, custom-button-mouse)
(custom-button-unraised, custom-button-pressed): Update
face definitions for Haiku.
* lisp/cus-start.el: Add haiku-debug-on-fatal-error and
haiku-use-system-tooltips.
* lisp/faces.el (face-valid-attribute-values): Clarify
attribute comment for Haiku.
(tool-bar): Add appropriate toolbar color for Haiku.
* lisp/frame.el (haiku-frame-geometry)
(haiku-mouse-absolute-pixel-position)
(haiku-set-mouse-absolute-pixel-position)
(haiku-frame-edges)
(haiku-frame-list-z-order): New function declarations.
(frame-geometry, frame-edges)
(mouse-absolute-pixel-position)
(set-mouse-absolute-pixel-position)
(frame-list-z-order): Call appropriate window system
functions on Haiku.
(display-mouse-p, display-graphic-p)
(display-images-p, display-pixel-height)
(display-pixel-width, display-mm-height)
(display-mm-width, display-backing-store)
(display-save-under, display-planes)
(display-color-cells, display-visual-class): Update type
tests for Haiku.
* lisp/international/mule-cmds.el
(set-coding-system-map): Also
prevent set-terminal-coding-system from appearing in the menu
bar on Haiku.
* lisp/loadup.el: Load Haiku-specific files when built
with Haiku, and don't rename newly built Emacs on Haiku as BFS
doesn't support hard links.
* lisp/menu-bar.el (menu-bar-open): Add for Haiku.
* lisp/mwheel.el (mouse-wheel-down-event): Expect
wheel-up on Haiku.
(mouse-wheel-up-event): Expect wheel-down on Haiku.
(mouse-wheel-left-event): Expect wheel-left on Haiku.
(mouse-wheel-right-event): Expect wheel-right on Haiku.
* lisp/net/browse-url.el
(browse-url--browser-defcustom-type):
Add option for WebPositive.
(browse-url-webpositive-program): New variable.
(browse-url-default-program): Search for WebPositive.
(browse-url-webpositive): New function.
* lisp/net/eww.el (eww-form-submit, eww-form-file)
(eww-form-checkbox, eww-form-select): Define faces
appropriately for Haiku.
* lisp/term/haiku-win.el: New file.
* lisp/tooltip.el (menu-or-popup-active-p): New function
declaration.
(tooltip-show-help): Don't use tooltips on Haiku when a
menu is active.
* lisp/version.el (haiku-get-version-string): New
function declaration.
(emacs-version): Add Haiku version string if
appropriate.
* src/Makefile.in: Also produce binary named "Emacs"
with Haiku resources set.
(CXX, HAIKU_OBJ, HAIKU_CXX_OBJ, HAIKU_LIBS)
(HAIKU_CFLAGS, HAVE_BE_APP, NON_CXX_FLAGS)
(ALL_CXX_FLAGS): New variables.
(.SUFFIXES): Add .cc.
(.cc.o): New target.
(base_obj): Add Haiku C objects.
(doc_obj, obj): Split objects that should scanned for
documentation into doc_obj.
(SOME_MACHINE_OBJECTS): Add appropriate Haiku C objects.
(all): Depend on Emacs and Emacs.pdmp on Haiku.
(LIBES): Add Haiku libraries.
(gl-stamp)
($(etc)/DOC): Scan doc_obj instead of obj
(temacs$(EXEEXT): Use C++ linker on Haiku.
(ctagsfiles3): New variable.
(TAGS): Scan C++ files.
* src/alloc.c (garbage_collect): Mark Haiku display.
* src/dispextern.h (HAVE_NATIVE_TRANSFORMS): Also enable
on Haiku.
(struct image): Add fields for Haiku transforms.
(RGB_PIXEL_COLOR): Define to unsigned long on Haiku as
well.
(sit_for): Also check USABLE_SIGPOLL.
(init_display_interactive): Set initial window system to
Haiku on Haiku builds.
* src/emacs.c (main): Define Haiku syms and init haiku
clipboard.
(shut_down_emacs): Quit BApplication on Haiku and
trigger debug
on aborts if haiku_debug_on_fatal_error.
(Vsystem_type): Update docstring.
* src/fileio.c (next-read-file-uses-dialog-p): Enable on
Haiku.
* src/filelock.c (WTMP_FILE): Only define if BOOT_TIME
is also defined.
* src/floatfns.c (double_integer_scale): Work around
Haiku libroot brain damage.
* src/font.c (syms_of_font): Define appropriate font
driver symbols for Haiku builds with various options.
* src/font.h: Also enable ftcrfont on Haiku builds with
Cairo.
(font_data_structures_may_be_ill_formed): Also enable on
Haiku builds that have Cairo.
* src/frame.c (Fframep): Update doc-string for Haiku
builds and return haiku if appropriate.
(syms_of_frame): New symbol `haiku'.
* src/frame.h (struct frame): Add output data for Haiku.
(FRAME_HAIKU_P): New macro.
(FRAME_WINDOW_P): Test for Haiku frames as well.
* src/ftcrfont.c (RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG): New macros.
(ftcrfont_draw): Add haiku specific code for Haiku
builds with Cairo.
* src/ftfont.c (ftfont_open): Set face.
(ftfont_has_char, ftfont_text_extents): Work around
crash.
(syms_of_ftfont): New symbol `mono'.
* src/ftfont.h (struct font_info): Enable Cairo-specific
fields for Cairo builds on Haiku.
* src/haiku_draw_support.cc:
* src/haiku_font_support.cc:
* src/haiku_io.c:
* src/haiku_select.cc:
* src/haiku_support.cc:
* src/haiku_support.h:
* src/haikufns.c:
* src/haikufont.c:
* src/haikugui.h:
* src/haikuimage.c:
* src/haikumenu.c:
* src/haikuselect.c:
* src/haikuselect.h:
* src/haikuterm.c:
* src/haikuterm.h: Add new files for Haiku windowing
support.
* src/haiku.c: Add new files for Haiku operating system
support.
* src/image.c: Implement image transforms and native XPM
support
on Haiku.
(GET_PIXEL, PUT_PIXEL, NO_PIXMAP)
(PIX_MASK_RETAIN, PIX_MASK_DRAW)
(RGB_TO_ULONG, RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG, RED16_FROM_ULONG, GREEN16_FROM_ULONG)
(BLUE16_FROM_ULONG): Define to appropriate values on
Haiku.
(image_create_bitmap_from_data): Add Haiku support.
(image_create_bitmap_from_file): Add TODO on Haiku.
(free_bitmap_record): Free bitmap on Haiku.
(image_size_in_bytes): Implement for Haiku bitmaps.
(image_set_transform): Implement on Haiku.
(image_create_x_image_and_pixmap_1): Implement on Haiku,
24-bit or 1-bit only.
(image_destroy_x_image, image_get_x_image): Use correct
img and pixmap values on Haiku.
(lookup_rgb_color): Use correct macro on Haiku.
(image_to_emacs_colors): Implement on Haiku.
(image_disable_image): Disable on Haiku.
(image_can_use_native_api): Test for translator presence
on Haiku.
(native_image_load): Use translator on Haiku.
(imagemagick_load_image): Add Haiku-specific quirks.
(Fimage_transforms_p): Allow rotate90 on Haiku.
(image_types): Enable native XPM support on Haiku.
(syms_of_image): Enable XPM images on Haiku.
* src/keyboard.c (kbd_buffer_get_event)
(handle_async_input, handle_input_available_signal)
(handle_user_signal, Fset_input_interrupt_mode)
(init_keyboard): Check for USABLE_SIGPOLL along with
USABLE_SIGIO.
* src/lisp.h (pD): Work around broken Haiku headers.
(HAVE_EXT_MENU_BAR): Define on Haiku.
(handle_input_available_signal): Enable if we just have
SIGPOLL as well.
* src/menu.c (have_boxes): Return true on Haiku.
(single_menu_item): Enable toolkit menus on Haiku.
(find_and_call_menu_selection): Also enable on Haiku.
* src/process.c (keyboard_bit_set): Enable with only
usable SIGPOLL.
(wait_reading_process_output): Test for SIGPOLL as well
as SIGIO availability.
* src/sound.c (sound_perror, vox_open)
(vox_configure, vox_close): Enable for usable SIGPOLL as
well.
* src/sysdep.c (sys_subshell): Enable for usable SIGPOLL.
(reset_sigio): Make conditional on F_SETOWN.
(request_sigio, unrequest_sigio)
(emacs_sigaction_init): Also handle SIGPOLLs.
(init_sys_modes): Disable TCXONC usage on Haiku, as it
doesn't have any ttys other than pseudo ttys, which don't
support C-s/C-q flow control, and causes compiler warnings.
(speeds): Disable high speeds if HAVE_TINY_SPEED_T.
* src/termhooks.h (enum output_method): Add output_haiku.
(struct terminal): Add Haiku display info.
(TERMINAL_FONT_CACHE): Enable for Haiku.
* src/terminal.c (Fterminal_live_p): Return `haiku' if
appropriate.
* src/verbose.mk.in (AM_V_CXX, AM_V_CXXLD): New logging
variables.
* src/xdisp.c (redisplay_internal)
(note_mouse_highlight): Return on Haiku if a popup is activated.
(display_menu_bar): Return on Haiku if frame is a Haiku
frame.
* src/xfaces.c (GCGraphicsExposures): Enable correctly on Haiku.
(x_create_gc): Enable dummy GC code on Haiku.
* src/xfns.c (x-server-version, x-file-dialog): Add
Haiku specifics to doc strings.
* src/xterm.c (syms_of_xterm): Add Haiku information to
doc string.
2021-11-20 13:30:08 +00:00
|
|
|
|
((memq frame-type '(x w32 ns haiku))
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(x-display-color-cells display))
|
|
|
|
|
((eq frame-type 'pc)
|
|
|
|
|
16)
|
|
|
|
|
(t
|
Hookified termcap devices, added bootstrap display device, plus many bugfixes.
lisp/frame.el (display-color-cells): Pass display parameter to tty-display-color-cells.
lisp/term/xterm.el (xterm-register-default-colors): Pass the selected-frame to display-color-cells.
src/dispextern.h (set_terminal_modes, reset_terminal_modes): Removed declarations.
(get_named_tty_display): New prototype.
(tty_clear_end_of_line, term_init): Updated to new prototype.
(initial_term_init): Renamed to init_initial_display.
src/dispnew.c (Fredraw_frame): ifdef-out DOS-specific code. Add display parameter to set_terminal_modes call.
(update_frame): Don't flush the tty of there is no tty.
(init_display): Set up a termcap display on the controlling tty and
change the initial frame to use that. Delete the initial display.
src/frame.c (Fframep): Return t for the initial frame.
(make_initial_frame): New function for creating the initial frame during bootstrap. Use init_initial_display, not initial_term_init.
(make_terminal_frame): Removed special cases for creating the initial frame.
src/frame.h (enum output_method): New entry: output_initial for the bootstrap display.
(FRAME_INITIAL_P): New macro.
(make_initial_frame): New prototype.
src/keyboard.c (interrupt_signal): Exit Emacs on SIGINT from the (frameless) controlling tty, if possible. Explain this in a comment.
(init_keyboard): Added comment about exiting on SIGINT.
(Fset_input_mode): A termcap frame is never the initial frame anymore.
src/sysdep.c (init_sys_modes): Update tty_set_terminal_modes call to the new prototype.
(reset_sys_modes): Comment out tty_clear_end_of_line call; it doesn't work anymore. Update tty_reset_terminal_modes call.
src/termchar.h (struct tty_display_info): Added pointer to the display structure, for reset_sys_modes.
src/termhooks.h (struct display): Added display parameter to set_terminal_modes_hook and reset_terminal_modes_hook.
src/term.c (initial_display): New variable.
(tty_ring_bell, tty_update_end, tty_set_terminal_window, tty_cursor_to)
(tty_raw_cursor_to, tty_clear_to_end, tty_clear_frame, tty_clear_end_of_line)
(tty_write_glyphs, tty_insert_glyphs, tty_delete_glyphs, tty_ins_del_lines): New functions.
(ring_bell, update_end, set_terminal_window, cursor_to, raw_cursor_to)
(clear_to_end, clear_frame, clear_end_of_line, write_glyphs, insert_glyphs)
(delete_glyphs, ins_del_lines): Removed special casing of termcap displays.
(get_tty_display): New function.
(Ftty_display_color_p, Ftty_display_color_cells): Use it.
(get_named_tty_display): Removed static.
(tty_set_terminal_modes, tty_reset_terminal_modes): Changed to use a display parameter
instead of tty_display_info for hook compatibility.
(set_terminal_modes, reset_terminal_modes): Removed.
(initial_term_init): Renamed to init_initial_display. Set up an
output_initial device, not a termcap display.
(delete_initial_display): New function.
(maybe_fatal): New function, for private use of term_init.
(term_init): New parameter for choosing between fatal and simple errors.
Removed incomprehensible special casing for the second initialization of the
controlling tty. Use maybe_fatal for error handling.
Initialize termcap display hooks in the new device.
Initialize the display pointer in the tty_display_info structure.
(delete_tty): Replace order of reset_sys_modes and delete_display.
src/window.c (init_window_once): Call make_initial_frame instead of make_terminal_frame.
src/xfaces.c (realize_default_face, realize_face): Don't abort on the bootstrap display device.
src/xterm.c (XTset_terminal_modes, XTreset_terminal_modes): Added display parameter.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-48
2004-01-09 18:57:53 +00:00
|
|
|
|
(tty-display-color-cells display)))))
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
|
2008-06-12 03:56:20 +00:00
|
|
|
|
(declare-function x-display-visual-class "xfns.c" (&optional terminal))
|
|
|
|
|
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(defun display-visual-class (&optional display)
|
Fix typos in docstrings.
* cus-edit.el (customize-apropos-options, custom-comment)
(custom-comment-tag, custom-face-edit-attribute-tag):
Fix typos in docstrings.
(custom-buffer-done-kill): Remove * from defcustom docstring.
(custom-file): Fix typo in doc of defcustom choice.
* frame.el (display-visual-class): Fix typo in docstring.
(initial-frame-alist, minibuffer-frame-alist, pop-up-frame-alist)
(special-display-frame-alist, show-trailing-whitespace)
(auto-hscroll-mode, blink-cursor-delay, blink-cursor-interval)
(display-hourglass, hourglass-delay, cursor-in-non-selected-windows):
Remove * from defcustom docstrings.
* md4.el (md4-buffer): Fix typo in docstring.
(md4, md4-64): Doc fixes.
(md4-pack-int32): Reflow docstring.
* paths.el (rmail-file-name): Remove * from defcustom docstring.
(prune-directory-list, gnus-nntp-service): Fix typos in docstrings.
* rect.el (open-rectangle): Reflow docstring.
(spaces-string): Fix docstring typo. Use "?\s" instead of "? ".
* select.el (x-get-cut-buffer): Fix typo in docstring.
* timezone.el (timezone-zone-to-minute, timezone-time-from-absolute)
(timezone-time-zone-from-absolute, timezone-leap-year-p):
Fix typos in docstrings.
* emacs-lisp/assoc.el (asort, aelement, aput, aget, amake):
Fix typos in docstrings.
2008-11-01 01:24:33 +00:00
|
|
|
|
"Return the visual class of DISPLAY.
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
The value is one of the symbols `static-gray', `gray-scale',
|
2013-10-22 08:07:51 +00:00
|
|
|
|
`static-color', `pseudo-color', `true-color', or `direct-color'.
|
2014-10-08 10:16:45 +00:00
|
|
|
|
DISPLAY can be a display name or a frame.
|
2013-10-22 08:07:51 +00:00
|
|
|
|
If DISPLAY is omitted or nil, it defaults to the selected frame's display."
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(let ((frame-type (framep-on-display display)))
|
|
|
|
|
(cond
|
Add support for the Haiku operating system and its window system
* .gitignore: Add binaries specific to Haiku.
* Makefie.in (HAVE_BE_APP): New variable.
(install-arch-dep): Install Emacs and Emacs.pdmp when
using Haiku.
* configure.ac: Detect and configure for Haiku and
various related configurations.
(be-app, be-freetype, be-cairo): New options.
(HAVE_BE_APP, HAIKU_OBJ, HAIKU_CXX_OBJ)
(HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(HAIKU, HAVE_TINY_SPEED_T): New define.
(emacs_config_features): Add BE_APP.
* doc/emacs/Makefile.in (EMACSSOURCES): Add Haiku
appendix.
* doc/emacs/emacs.texi: Add Haiku appendix to menus and
include it.
* doc/emacs/haiku.texi: New Haiku appendix.
* doc/lispref/display.texi (Defining Faces, Window Systems):
Explain meaning of `haiku' as a window system identifier.
(haiku-use-system-tooltips): Explain meaning of system
tooltips on
Haiku.
* doc/lispref/frames.texi (Multiple Terminals): Explain
meaning of haiku as a display type.
(Frame Layout): Clarify section for Haiku frames.
(Size Parameters): Explain limitations of fullwidth and
fullheight on Haiku.
(Management Parameters): Explain limitations of
inhibiting double buffering on builds with Cairo,
and the inability of frames with no-accept-focus to
receive keyboard input on Haiku.
(Font and Color Parameters): Explain the different font
backends available on Haiku.
(Raising and Lowering): Explain that lowering and
restacking frames doesn't work on Haiku.
(Child Frames): Explain oddities of child frame
visibility on Haiku.
* doc/lispref/os.texi (System Environment): Explain
meaning of haiku.
* etc/MACHINES: Add appropriate notices for Haiku.
* etc/NEWS: Document changes.
* etc/PROBLEMS: Document font spacing bug on Haiku.
* lib-src/Makefile.in: Build be-resources binary on
Haiku.
(CXX, CXXFLAGS, NON_CXX_FLAGS, ALL_CXXFLAGS)
(HAVE_BE_APP, HAIKU_LIBS, HAIKU_CFLAGS): New variables.
(DONT_INSTALL): Add be-resources binary if on Haiku.
(be-resources): New target.
* lib-src/be_resources: Add helper binary for setting
resources on the Emacs application.
* lib-src/emacsclient.c (decode_options): Set
alt_display to "be" on Haiku.
* lisp/cus-edit.el (custom-button, custom-button-mouse)
(custom-button-unraised, custom-button-pressed): Update
face definitions for Haiku.
* lisp/cus-start.el: Add haiku-debug-on-fatal-error and
haiku-use-system-tooltips.
* lisp/faces.el (face-valid-attribute-values): Clarify
attribute comment for Haiku.
(tool-bar): Add appropriate toolbar color for Haiku.
* lisp/frame.el (haiku-frame-geometry)
(haiku-mouse-absolute-pixel-position)
(haiku-set-mouse-absolute-pixel-position)
(haiku-frame-edges)
(haiku-frame-list-z-order): New function declarations.
(frame-geometry, frame-edges)
(mouse-absolute-pixel-position)
(set-mouse-absolute-pixel-position)
(frame-list-z-order): Call appropriate window system
functions on Haiku.
(display-mouse-p, display-graphic-p)
(display-images-p, display-pixel-height)
(display-pixel-width, display-mm-height)
(display-mm-width, display-backing-store)
(display-save-under, display-planes)
(display-color-cells, display-visual-class): Update type
tests for Haiku.
* lisp/international/mule-cmds.el
(set-coding-system-map): Also
prevent set-terminal-coding-system from appearing in the menu
bar on Haiku.
* lisp/loadup.el: Load Haiku-specific files when built
with Haiku, and don't rename newly built Emacs on Haiku as BFS
doesn't support hard links.
* lisp/menu-bar.el (menu-bar-open): Add for Haiku.
* lisp/mwheel.el (mouse-wheel-down-event): Expect
wheel-up on Haiku.
(mouse-wheel-up-event): Expect wheel-down on Haiku.
(mouse-wheel-left-event): Expect wheel-left on Haiku.
(mouse-wheel-right-event): Expect wheel-right on Haiku.
* lisp/net/browse-url.el
(browse-url--browser-defcustom-type):
Add option for WebPositive.
(browse-url-webpositive-program): New variable.
(browse-url-default-program): Search for WebPositive.
(browse-url-webpositive): New function.
* lisp/net/eww.el (eww-form-submit, eww-form-file)
(eww-form-checkbox, eww-form-select): Define faces
appropriately for Haiku.
* lisp/term/haiku-win.el: New file.
* lisp/tooltip.el (menu-or-popup-active-p): New function
declaration.
(tooltip-show-help): Don't use tooltips on Haiku when a
menu is active.
* lisp/version.el (haiku-get-version-string): New
function declaration.
(emacs-version): Add Haiku version string if
appropriate.
* src/Makefile.in: Also produce binary named "Emacs"
with Haiku resources set.
(CXX, HAIKU_OBJ, HAIKU_CXX_OBJ, HAIKU_LIBS)
(HAIKU_CFLAGS, HAVE_BE_APP, NON_CXX_FLAGS)
(ALL_CXX_FLAGS): New variables.
(.SUFFIXES): Add .cc.
(.cc.o): New target.
(base_obj): Add Haiku C objects.
(doc_obj, obj): Split objects that should scanned for
documentation into doc_obj.
(SOME_MACHINE_OBJECTS): Add appropriate Haiku C objects.
(all): Depend on Emacs and Emacs.pdmp on Haiku.
(LIBES): Add Haiku libraries.
(gl-stamp)
($(etc)/DOC): Scan doc_obj instead of obj
(temacs$(EXEEXT): Use C++ linker on Haiku.
(ctagsfiles3): New variable.
(TAGS): Scan C++ files.
* src/alloc.c (garbage_collect): Mark Haiku display.
* src/dispextern.h (HAVE_NATIVE_TRANSFORMS): Also enable
on Haiku.
(struct image): Add fields for Haiku transforms.
(RGB_PIXEL_COLOR): Define to unsigned long on Haiku as
well.
(sit_for): Also check USABLE_SIGPOLL.
(init_display_interactive): Set initial window system to
Haiku on Haiku builds.
* src/emacs.c (main): Define Haiku syms and init haiku
clipboard.
(shut_down_emacs): Quit BApplication on Haiku and
trigger debug
on aborts if haiku_debug_on_fatal_error.
(Vsystem_type): Update docstring.
* src/fileio.c (next-read-file-uses-dialog-p): Enable on
Haiku.
* src/filelock.c (WTMP_FILE): Only define if BOOT_TIME
is also defined.
* src/floatfns.c (double_integer_scale): Work around
Haiku libroot brain damage.
* src/font.c (syms_of_font): Define appropriate font
driver symbols for Haiku builds with various options.
* src/font.h: Also enable ftcrfont on Haiku builds with
Cairo.
(font_data_structures_may_be_ill_formed): Also enable on
Haiku builds that have Cairo.
* src/frame.c (Fframep): Update doc-string for Haiku
builds and return haiku if appropriate.
(syms_of_frame): New symbol `haiku'.
* src/frame.h (struct frame): Add output data for Haiku.
(FRAME_HAIKU_P): New macro.
(FRAME_WINDOW_P): Test for Haiku frames as well.
* src/ftcrfont.c (RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG): New macros.
(ftcrfont_draw): Add haiku specific code for Haiku
builds with Cairo.
* src/ftfont.c (ftfont_open): Set face.
(ftfont_has_char, ftfont_text_extents): Work around
crash.
(syms_of_ftfont): New symbol `mono'.
* src/ftfont.h (struct font_info): Enable Cairo-specific
fields for Cairo builds on Haiku.
* src/haiku_draw_support.cc:
* src/haiku_font_support.cc:
* src/haiku_io.c:
* src/haiku_select.cc:
* src/haiku_support.cc:
* src/haiku_support.h:
* src/haikufns.c:
* src/haikufont.c:
* src/haikugui.h:
* src/haikuimage.c:
* src/haikumenu.c:
* src/haikuselect.c:
* src/haikuselect.h:
* src/haikuterm.c:
* src/haikuterm.h: Add new files for Haiku windowing
support.
* src/haiku.c: Add new files for Haiku operating system
support.
* src/image.c: Implement image transforms and native XPM
support
on Haiku.
(GET_PIXEL, PUT_PIXEL, NO_PIXMAP)
(PIX_MASK_RETAIN, PIX_MASK_DRAW)
(RGB_TO_ULONG, RED_FROM_ULONG, GREEN_FROM_ULONG)
(BLUE_FROM_ULONG, RED16_FROM_ULONG, GREEN16_FROM_ULONG)
(BLUE16_FROM_ULONG): Define to appropriate values on
Haiku.
(image_create_bitmap_from_data): Add Haiku support.
(image_create_bitmap_from_file): Add TODO on Haiku.
(free_bitmap_record): Free bitmap on Haiku.
(image_size_in_bytes): Implement for Haiku bitmaps.
(image_set_transform): Implement on Haiku.
(image_create_x_image_and_pixmap_1): Implement on Haiku,
24-bit or 1-bit only.
(image_destroy_x_image, image_get_x_image): Use correct
img and pixmap values on Haiku.
(lookup_rgb_color): Use correct macro on Haiku.
(image_to_emacs_colors): Implement on Haiku.
(image_disable_image): Disable on Haiku.
(image_can_use_native_api): Test for translator presence
on Haiku.
(native_image_load): Use translator on Haiku.
(imagemagick_load_image): Add Haiku-specific quirks.
(Fimage_transforms_p): Allow rotate90 on Haiku.
(image_types): Enable native XPM support on Haiku.
(syms_of_image): Enable XPM images on Haiku.
* src/keyboard.c (kbd_buffer_get_event)
(handle_async_input, handle_input_available_signal)
(handle_user_signal, Fset_input_interrupt_mode)
(init_keyboard): Check for USABLE_SIGPOLL along with
USABLE_SIGIO.
* src/lisp.h (pD): Work around broken Haiku headers.
(HAVE_EXT_MENU_BAR): Define on Haiku.
(handle_input_available_signal): Enable if we just have
SIGPOLL as well.
* src/menu.c (have_boxes): Return true on Haiku.
(single_menu_item): Enable toolkit menus on Haiku.
(find_and_call_menu_selection): Also enable on Haiku.
* src/process.c (keyboard_bit_set): Enable with only
usable SIGPOLL.
(wait_reading_process_output): Test for SIGPOLL as well
as SIGIO availability.
* src/sound.c (sound_perror, vox_open)
(vox_configure, vox_close): Enable for usable SIGPOLL as
well.
* src/sysdep.c (sys_subshell): Enable for usable SIGPOLL.
(reset_sigio): Make conditional on F_SETOWN.
(request_sigio, unrequest_sigio)
(emacs_sigaction_init): Also handle SIGPOLLs.
(init_sys_modes): Disable TCXONC usage on Haiku, as it
doesn't have any ttys other than pseudo ttys, which don't
support C-s/C-q flow control, and causes compiler warnings.
(speeds): Disable high speeds if HAVE_TINY_SPEED_T.
* src/termhooks.h (enum output_method): Add output_haiku.
(struct terminal): Add Haiku display info.
(TERMINAL_FONT_CACHE): Enable for Haiku.
* src/terminal.c (Fterminal_live_p): Return `haiku' if
appropriate.
* src/verbose.mk.in (AM_V_CXX, AM_V_CXXLD): New logging
variables.
* src/xdisp.c (redisplay_internal)
(note_mouse_highlight): Return on Haiku if a popup is activated.
(display_menu_bar): Return on Haiku if frame is a Haiku
frame.
* src/xfaces.c (GCGraphicsExposures): Enable correctly on Haiku.
(x_create_gc): Enable dummy GC code on Haiku.
* src/xfns.c (x-server-version, x-file-dialog): Add
Haiku specifics to doc strings.
* src/xterm.c (syms_of_xterm): Add Haiku information to
doc string.
2021-11-20 13:30:08 +00:00
|
|
|
|
((memq frame-type '(x w32 ns haiku))
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
(x-display-visual-class display))
|
|
|
|
|
((and (memq frame-type '(pc t))
|
|
|
|
|
(tty-display-color-p display))
|
|
|
|
|
'static-color)
|
|
|
|
|
(t
|
|
|
|
|
'static-gray))))
|
|
|
|
|
|
2013-05-07 01:12:22 +00:00
|
|
|
|
(declare-function x-display-monitor-attributes-list "xfns.c"
|
|
|
|
|
(&optional terminal))
|
2013-07-04 10:25:54 +00:00
|
|
|
|
(declare-function w32-display-monitor-attributes-list "w32fns.c"
|
|
|
|
|
(&optional display))
|
2013-05-11 02:27:28 +00:00
|
|
|
|
(declare-function ns-display-monitor-attributes-list "nsfns.m"
|
2013-05-09 15:17:38 +00:00
|
|
|
|
(&optional terminal))
|
2013-05-07 01:12:22 +00:00
|
|
|
|
|
|
|
|
|
(defun display-monitor-attributes-list (&optional display)
|
|
|
|
|
"Return a list of physical monitor attributes on DISPLAY.
|
2014-10-08 10:16:45 +00:00
|
|
|
|
DISPLAY can be a display name, a terminal name, or a frame.
|
2014-10-04 03:03:52 +00:00
|
|
|
|
If DISPLAY is omitted or nil, it defaults to the selected frame's display.
|
|
|
|
|
Each element of the list represents the attributes of a physical
|
|
|
|
|
monitor. The first element corresponds to the primary monitor.
|
2013-05-07 01:12:22 +00:00
|
|
|
|
|
2014-10-04 03:03:52 +00:00
|
|
|
|
The attributes for a physical monitor are represented as an alist
|
|
|
|
|
of attribute keys and values as follows:
|
2013-05-07 01:12:22 +00:00
|
|
|
|
|
2014-10-04 03:03:52 +00:00
|
|
|
|
geometry -- Position and size in pixels in the form of (X Y WIDTH HEIGHT)
|
|
|
|
|
workarea -- Position and size of the work area in pixels in the
|
2013-05-07 01:12:22 +00:00
|
|
|
|
form of (X Y WIDTH HEIGHT)
|
|
|
|
|
mm-size -- Width and height in millimeters in the form of
|
|
|
|
|
(WIDTH HEIGHT)
|
|
|
|
|
frames -- List of frames dominated by the physical monitor
|
|
|
|
|
name (*) -- Name of the physical monitor as a string
|
2014-10-09 00:47:30 +00:00
|
|
|
|
source (*) -- Source of multi-monitor information as a string
|
2013-05-07 01:12:22 +00:00
|
|
|
|
|
2014-10-09 00:47:30 +00:00
|
|
|
|
where X, Y, WIDTH, and HEIGHT are integers. X and Y are coordinates
|
|
|
|
|
of the top-left corner, and might be negative for monitors other than
|
|
|
|
|
the primary one. Keys labeled with (*) are optional.
|
|
|
|
|
|
|
|
|
|
The \"work area\" is a measure of the \"usable\" display space.
|
|
|
|
|
It may be less than the total screen size, owing to space taken up
|
|
|
|
|
by window manager features (docks, taskbars, etc.). The precise
|
|
|
|
|
details depend on the platform and environment.
|
|
|
|
|
|
|
|
|
|
The `source' attribute describes the source from which the information
|
|
|
|
|
was obtained. On X, this may be one of: \"Gdk\", \"XRandr\", \"Xinerama\",
|
|
|
|
|
or \"fallback\".
|
2013-05-07 01:12:22 +00:00
|
|
|
|
|
|
|
|
|
A frame is dominated by a physical monitor when either the
|
|
|
|
|
largest area of the frame resides in the monitor, or the monitor
|
|
|
|
|
is the closest to the frame if the frame does not intersect any
|
2014-10-04 03:03:52 +00:00
|
|
|
|
physical monitors. Every (non-tooltip) frame (including invisible ones)
|
2013-05-07 01:12:22 +00:00
|
|
|
|
in a graphical display is dominated by exactly one physical
|
|
|
|
|
monitor at a time, though it can span multiple (or no) physical
|
2014-10-04 03:03:52 +00:00
|
|
|
|
monitors."
|
2013-05-07 01:12:22 +00:00
|
|
|
|
(let ((frame-type (framep-on-display display)))
|
|
|
|
|
(cond
|
|
|
|
|
((eq frame-type 'x)
|
|
|
|
|
(x-display-monitor-attributes-list display))
|
2013-07-04 10:25:54 +00:00
|
|
|
|
((eq frame-type 'w32)
|
|
|
|
|
(w32-display-monitor-attributes-list display))
|
2013-05-09 15:17:38 +00:00
|
|
|
|
((eq frame-type 'ns)
|
|
|
|
|
(ns-display-monitor-attributes-list display))
|
2013-05-07 01:12:22 +00:00
|
|
|
|
(t
|
|
|
|
|
(let ((geometry (list 0 0 (display-pixel-width display)
|
|
|
|
|
(display-pixel-height display))))
|
|
|
|
|
`(((geometry . ,geometry)
|
|
|
|
|
(workarea . ,geometry)
|
|
|
|
|
(mm-size . (,(display-mm-width display)
|
|
|
|
|
,(display-mm-height display)))
|
|
|
|
|
(frames . ,(frames-on-display-list display)))))))))
|
|
|
|
|
|
(frames-on-display-list, framep-on-display): New functions.
(display-mouse-p, display-popup-menus-p, display-graphic-p)
(display-selections-p, display-screens, display-pixel-width)
(display-pixel-height, display-mm-width, display-mm-height)
(display-backing-store, display-save-under, display-planes)
(display-color-cells, display-visual-class): New functions.
2000-02-02 11:35:43 +00:00
|
|
|
|
|
2008-01-03 09:57:40 +00:00
|
|
|
|
;;;; Frame geometry values
|
|
|
|
|
|
|
|
|
|
(defun frame-geom-value-cons (type value &optional frame)
|
|
|
|
|
"Return equivalent geometry value for FRAME as a cons with car `+'.
|
|
|
|
|
A geometry value equivalent to VALUE for FRAME is returned,
|
|
|
|
|
where the value is a cons with car `+', not numeric.
|
|
|
|
|
TYPE is the car of the original geometry spec (TYPE . VALUE).
|
|
|
|
|
It is `top' or `left', depending on which edge VALUE is related to.
|
|
|
|
|
VALUE is the cdr of a frame geometry spec: (left/top . VALUE).
|
|
|
|
|
If VALUE is a number, then it is converted to a cons value, perhaps
|
|
|
|
|
relative to the opposite frame edge from that in the original spec.
|
|
|
|
|
FRAME defaults to the selected frame.
|
|
|
|
|
|
|
|
|
|
Examples (measures in pixels) -
|
|
|
|
|
Assuming display height/width=1024, frame height/width=600:
|
|
|
|
|
300 inside display edge: 300 => (+ 300)
|
|
|
|
|
(+ 300) => (+ 300)
|
|
|
|
|
300 inside opposite display edge: (- 300) => (+ 124)
|
|
|
|
|
-300 => (+ 124)
|
|
|
|
|
300 beyond display edge
|
|
|
|
|
(= 724 inside opposite display edge): (+ -300) => (+ -300)
|
|
|
|
|
300 beyond display edge
|
|
|
|
|
(= 724 inside opposite display edge): (- -300) => (+ 724)
|
|
|
|
|
|
|
|
|
|
In the 3rd, 4th, and 6th examples, the returned value is relative to
|
|
|
|
|
the opposite frame edge from the edge indicated in the input spec."
|
|
|
|
|
(cond ((and (consp value) (eq '+ (car value))) ; e.g. (+ 300), (+ -300)
|
|
|
|
|
value)
|
|
|
|
|
((natnump value) (list '+ value)) ; e.g. 300 => (+ 300)
|
|
|
|
|
(t ; e.g. -300, (- 300), (- -300)
|
|
|
|
|
(list '+ (- (if (eq 'left type) ; => (+ 124), (+ 124), (+ 724)
|
|
|
|
|
(x-display-pixel-width)
|
|
|
|
|
(x-display-pixel-height))
|
|
|
|
|
(if (integerp value) (- value) (cadr value))
|
|
|
|
|
(if (eq 'left type)
|
|
|
|
|
(frame-pixel-width frame)
|
|
|
|
|
(frame-pixel-height frame)))))))
|
|
|
|
|
|
|
|
|
|
(defun frame-geom-spec-cons (spec &optional frame)
|
|
|
|
|
"Return equivalent geometry spec for FRAME as a cons with car `+'.
|
|
|
|
|
A geometry specification equivalent to SPEC for FRAME is returned,
|
|
|
|
|
where the value is a cons with car `+', not numeric.
|
|
|
|
|
SPEC is a frame geometry spec: (left . VALUE) or (top . VALUE).
|
|
|
|
|
If VALUE is a number, then it is converted to a cons value, perhaps
|
Add new frame parameters and associated functions
Add new frame parameters `undecorated', `override-redirect',
`parent-frame', `skip-taskbar', `no-focus-on-map',
`no-accept-focus', `z-group', `delete-before', `no-other-frame',
`mouse-wheel-frame', `min-width', `min-height'. Add new
functions `frame-restack' and `frame-list-z-order'.
* lisp/cus-start.el (focus-follows-mouse): Adapt customization
type.
* lisp/frame.el (handle-delete-frame): Handle child and
`delete-before' frames.
(other-frame): Stop looking for other frame after one round.
(frame-list-z-order, frame-restack): New functions.
(delete-other-frames): Handle child frames.
* lisp/frameset.el (frameset-persistent-filter-alist)
(frameset--record-relationships): Handle `delete-before',
`parent-frame' and `mouse-wheel-frame' parameters. Rename
latter from `frameset--record-minibuffer-relationships'.
(frameset--restore-frame): Handle ‘parent-frame’ parameter
specially.
(frameset-restore): Handle `delete-before', `parent-frame' and
`mouse-wheel-frame' parameters.
* lisp/mwheel.el (mwheel-scroll): Handle `mouse-wheel-frame'
parameter.
* lisp/window.el (window--min-size-ignore-p): Fix doc-string.
(mouse-autoselect-window-select, handle-select-window): Major
rewrite. Try to not ignore errors. Handle auto-selection of
child frames and different values of `focus-follows-mouse'.
* src/frame.c (frame_windows_min_size): Handle new `min-width'
and `min-height' frame parameters.
(make_frame): Initialize new frame structure members.
(do_switch_frame): Don't reset internal_last_event_frame for
descendant frames.
(Fframe_parent, frame_ancestor_p, Fframe_ancestor_p): New
functions.
(candidate_frame): Don't return `no-other-frame' frame.
(other_frames): New function replacing other_visible_frames.
(delete_frame): Rewrite. Handle child and `delete-before' frames.
(Fmake_frame_invisible): Call other_frames.
(store_frame_param): Check `delete-before' and `parent-frame'
parameters for circular dependencies.
(frame_parms, syms_of_frame): Add entries for and define new
frame parameters.
(focus_follows_mouse): New meaningful value `auto-raise'.
* src/frame.h (z_group): New enumeration type.
(frame): New slots parent_frame, undecorated, override_redirect,
skip_taskbar, no_focus_on_map, no_accept_focus, z_group.
(fset_parent_frame): New inlined function.
(FRAME_UNDECORATED, FRAME_OVERRIDE_REDIRECT)
(FRAME_PARENT_FRAME, FRAME_SKIP_TASKBAR, FRAME_NO_FOCUS_ON_MAP)
(FRAME_NO_ACCEPT_FOCUS, FRAME_Z_GROUP, FRAME_Z_GROUP_NONE)
(FRAME_Z_GROUP_ABOVE, FRAME_Z_GROUP_ABOVE_SUSPENDED)
(FRAME_Z_GROUP_BELOW): New macros.
(frame_ancestor_p): Add declaration.
* src/gtkutil.c (xg_create_frame_widgets): Handle
`undecorated' and `override-redirect' frame parameters.
(x_wm_set_size_hint): None for child frames.
(xg_set_undecorated, xg_frame_restack, xg_set_skip_taskbar)
(xg_set_no_focus_on_map, xg_set_no_accept_focus)
(xg_set_override_redirect): New functions.
(xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos):
Don't let scrollbars obscure child frames.
* src/gtkutil.h: (xg_set_undecorated, xg_frame_restack)
(xg_set_skip_taskbar, xg_set_no_focus_on_map)
(xg_set_no_accept_focus, xg_set_override_redirect): Add extern
declarations.
* src/nsfns.m (ns_frame_parm_handlers): Add entries for new
frame parameters.
(Fx_create_frame): Install `min-width' and `min-height' frame
parameters.
* src/nsterm.m (mouseMoved:): Handle focus_follows_mouse change.
* src/w32fns.c (WS_EX_NOACTIVATE): Define if necessary.
(x_real_positions): Handle child frames.
(x_set_menu_bar_lines): Don't for child frames.
(x_set_undecorated, x_set_parent_frame, x_set_skip_taskbar)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_z_group): New functions.
(w32_createvscrollbar, w32_createhscrollbar): Don't draw
scroll bars over child frames.
(w32_createwindow): Handle new frame parameters and child frames.
(w32_wnd_proc): Let mouse clicks into a child frame activate
the frame. Try to handle the `no-accept-focus' parameter. Do
SetFocus when our window is brought to top or becomes the
foreground window.
(w32_window): Don't initialize menu bar for child frames.
(Fx_create_frame): Handle new frame parameters.
(x_create_tip_frame): Set explicit_parent slot.
(w32_dialog_in_progress): New function.
(Fx_file_dialog): Handle `z-group-above' frames.
(w32_frame_list_z_order, Fw32_frame_list_z_order)
(w32_frame_restack, Fw32_frame_restack): New functions.
(w32_frame_parm_handlers): Add entries for new frame
parameters.
* src/w32font.c (Fx_select_font): Handle `z-group-above'
frames during font selection dialogue.
* src/w32term.c (construct_mouse_wheel): Construct mouse wheel
event from F's w32 window.
(w32_mouse_position): Handle child frames.
(w32_set_vertical_scroll_bar, w32_set_horizontal_scroll_bar):
Don't draw scroll bars over child frames.
(w32_read_socket): Always erase background of child frames.
When generating SELECT_WINDOW_EVENTs handle new value of
`focus-follows-mouse' and handle `no-accept-focus' parameter.
Handle `mouse-wheel-frame' parameter.
(x_calc_absolute_position, x_set_offset, x_set_window_size):
Handle child frames.
(x_make_frame_visible): Handle child frames specially. Handle
`no-focus-on-map' parameter.
* src/w32term.h (w32_dialog_in_progress): Add external
declaration.
* src/xdisp.c (x_consider_frame_title, prepare_menu_bars): Not
for child frames.
* src/xfns.c (Xm/MwmUtil.h): Include for WM hints.
(PropMotifWmHints, PROP_MOTIF_WM_HINTS_ELEMENTS): Define for
non-Motif, non-GTK case.
(x_real_pos_and_offsets): Handle child frames.
(x_set_undecorated, x_set_parent_frame)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_override_redirect): New functions.
(x_set_menu_bar_lines): Not for child frames.
(x_window): Handle `undecorated' and `override_redirect' cases.
(Fx_create_frame): Handle new frame parameters.
(frame_geometry): Handle child frames and outer border.
(x_frame_list_z_order, Fx_frame_list_z_order)
(x_frame_restack, Fx_frame_restack): New functions.
(Fx_file_dialog, Fx_select_font): Set x_menu_set_in_use.
(x_frame_parm_handlers): Add entries for new frame parameters.
* src/xmenu.c (x_menu_set_in_use): Handle `z-group-above'
frames.
* src/xterm.c (x_set_frame_alpha): Don't set alpha of parent
for child frames.
(XTmouse_position): Handle child frames.
(x_scroll_bar_create, x_scroll_bar_expose): Don't let scroll
bars obscure child frames.
(handle_one_xevent): Handle child frame positions. If necessary
set `skip-taskbar' and reassign proper `z-group' when we are
mapped. When generating SELECT_WINDOW_EVENTs handle new value
of `focus-follows-mouse'. Handle `mouse-wheel-frame' parameter.
Let mouse clicks into a child frame activate the frame.
(x_calc_absolute_position, x_set_offset): Handle child frames
specially.
(x_set_skip_taskbar, x_set_z_group): New functions.
(x_make_frame_visible): Handle child frames.
(ATOM_REFS_INIT): Add entries for
Xatom_net_wm_state_skip_taskbar, Xatom_net_wm_state_above,
Xatom_net_wm_state_below.
* src/xterm.h (top-level): Declare Xatom_net_wm_state_above,
Xatom_net_wm_state_below and Xatom_net_wm_state_skip_taskbar.
(x_set_skip_taskbar, x_set_z_group): Add extern declarations.
2017-04-12 08:38:25 +00:00
|
|
|
|
relative to the opposite frame edge from that in the original spec.
|
2008-01-03 09:57:40 +00:00
|
|
|
|
FRAME defaults to the selected frame.
|
|
|
|
|
|
|
|
|
|
Examples (measures in pixels) -
|
|
|
|
|
Assuming display height=1024, frame height=600:
|
|
|
|
|
top 300 below display top: (top . 300) => (top + 300)
|
|
|
|
|
(top + 300) => (top + 300)
|
|
|
|
|
bottom 300 above display bottom: (top - 300) => (top + 124)
|
|
|
|
|
(top . -300) => (top + 124)
|
|
|
|
|
top 300 above display top
|
|
|
|
|
(= bottom 724 above display bottom): (top + -300) => (top + -300)
|
|
|
|
|
bottom 300 below display bottom
|
|
|
|
|
(= top 724 below display top): (top - -300) => (top + 724)
|
|
|
|
|
|
|
|
|
|
In the 3rd, 4th, and 6th examples, the returned value is relative to
|
|
|
|
|
the opposite frame edge from the edge indicated in the input spec."
|
2011-04-19 13:44:55 +00:00
|
|
|
|
(cons (car spec) (frame-geom-value-cons (car spec) (cdr spec) frame)))
|
2008-01-03 09:57:40 +00:00
|
|
|
|
|
2021-04-12 16:32:07 +00:00
|
|
|
|
(defun delete-other-frames (&optional frame iconify)
|
2016-08-25 08:53:27 +00:00
|
|
|
|
"Delete all frames on FRAME's terminal, except FRAME.
|
2001-04-17 12:02:53 +00:00
|
|
|
|
If FRAME uses another frame's minibuffer, the minibuffer frame is
|
Add new frame parameters and associated functions
Add new frame parameters `undecorated', `override-redirect',
`parent-frame', `skip-taskbar', `no-focus-on-map',
`no-accept-focus', `z-group', `delete-before', `no-other-frame',
`mouse-wheel-frame', `min-width', `min-height'. Add new
functions `frame-restack' and `frame-list-z-order'.
* lisp/cus-start.el (focus-follows-mouse): Adapt customization
type.
* lisp/frame.el (handle-delete-frame): Handle child and
`delete-before' frames.
(other-frame): Stop looking for other frame after one round.
(frame-list-z-order, frame-restack): New functions.
(delete-other-frames): Handle child frames.
* lisp/frameset.el (frameset-persistent-filter-alist)
(frameset--record-relationships): Handle `delete-before',
`parent-frame' and `mouse-wheel-frame' parameters. Rename
latter from `frameset--record-minibuffer-relationships'.
(frameset--restore-frame): Handle ‘parent-frame’ parameter
specially.
(frameset-restore): Handle `delete-before', `parent-frame' and
`mouse-wheel-frame' parameters.
* lisp/mwheel.el (mwheel-scroll): Handle `mouse-wheel-frame'
parameter.
* lisp/window.el (window--min-size-ignore-p): Fix doc-string.
(mouse-autoselect-window-select, handle-select-window): Major
rewrite. Try to not ignore errors. Handle auto-selection of
child frames and different values of `focus-follows-mouse'.
* src/frame.c (frame_windows_min_size): Handle new `min-width'
and `min-height' frame parameters.
(make_frame): Initialize new frame structure members.
(do_switch_frame): Don't reset internal_last_event_frame for
descendant frames.
(Fframe_parent, frame_ancestor_p, Fframe_ancestor_p): New
functions.
(candidate_frame): Don't return `no-other-frame' frame.
(other_frames): New function replacing other_visible_frames.
(delete_frame): Rewrite. Handle child and `delete-before' frames.
(Fmake_frame_invisible): Call other_frames.
(store_frame_param): Check `delete-before' and `parent-frame'
parameters for circular dependencies.
(frame_parms, syms_of_frame): Add entries for and define new
frame parameters.
(focus_follows_mouse): New meaningful value `auto-raise'.
* src/frame.h (z_group): New enumeration type.
(frame): New slots parent_frame, undecorated, override_redirect,
skip_taskbar, no_focus_on_map, no_accept_focus, z_group.
(fset_parent_frame): New inlined function.
(FRAME_UNDECORATED, FRAME_OVERRIDE_REDIRECT)
(FRAME_PARENT_FRAME, FRAME_SKIP_TASKBAR, FRAME_NO_FOCUS_ON_MAP)
(FRAME_NO_ACCEPT_FOCUS, FRAME_Z_GROUP, FRAME_Z_GROUP_NONE)
(FRAME_Z_GROUP_ABOVE, FRAME_Z_GROUP_ABOVE_SUSPENDED)
(FRAME_Z_GROUP_BELOW): New macros.
(frame_ancestor_p): Add declaration.
* src/gtkutil.c (xg_create_frame_widgets): Handle
`undecorated' and `override-redirect' frame parameters.
(x_wm_set_size_hint): None for child frames.
(xg_set_undecorated, xg_frame_restack, xg_set_skip_taskbar)
(xg_set_no_focus_on_map, xg_set_no_accept_focus)
(xg_set_override_redirect): New functions.
(xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos):
Don't let scrollbars obscure child frames.
* src/gtkutil.h: (xg_set_undecorated, xg_frame_restack)
(xg_set_skip_taskbar, xg_set_no_focus_on_map)
(xg_set_no_accept_focus, xg_set_override_redirect): Add extern
declarations.
* src/nsfns.m (ns_frame_parm_handlers): Add entries for new
frame parameters.
(Fx_create_frame): Install `min-width' and `min-height' frame
parameters.
* src/nsterm.m (mouseMoved:): Handle focus_follows_mouse change.
* src/w32fns.c (WS_EX_NOACTIVATE): Define if necessary.
(x_real_positions): Handle child frames.
(x_set_menu_bar_lines): Don't for child frames.
(x_set_undecorated, x_set_parent_frame, x_set_skip_taskbar)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_z_group): New functions.
(w32_createvscrollbar, w32_createhscrollbar): Don't draw
scroll bars over child frames.
(w32_createwindow): Handle new frame parameters and child frames.
(w32_wnd_proc): Let mouse clicks into a child frame activate
the frame. Try to handle the `no-accept-focus' parameter. Do
SetFocus when our window is brought to top or becomes the
foreground window.
(w32_window): Don't initialize menu bar for child frames.
(Fx_create_frame): Handle new frame parameters.
(x_create_tip_frame): Set explicit_parent slot.
(w32_dialog_in_progress): New function.
(Fx_file_dialog): Handle `z-group-above' frames.
(w32_frame_list_z_order, Fw32_frame_list_z_order)
(w32_frame_restack, Fw32_frame_restack): New functions.
(w32_frame_parm_handlers): Add entries for new frame
parameters.
* src/w32font.c (Fx_select_font): Handle `z-group-above'
frames during font selection dialogue.
* src/w32term.c (construct_mouse_wheel): Construct mouse wheel
event from F's w32 window.
(w32_mouse_position): Handle child frames.
(w32_set_vertical_scroll_bar, w32_set_horizontal_scroll_bar):
Don't draw scroll bars over child frames.
(w32_read_socket): Always erase background of child frames.
When generating SELECT_WINDOW_EVENTs handle new value of
`focus-follows-mouse' and handle `no-accept-focus' parameter.
Handle `mouse-wheel-frame' parameter.
(x_calc_absolute_position, x_set_offset, x_set_window_size):
Handle child frames.
(x_make_frame_visible): Handle child frames specially. Handle
`no-focus-on-map' parameter.
* src/w32term.h (w32_dialog_in_progress): Add external
declaration.
* src/xdisp.c (x_consider_frame_title, prepare_menu_bars): Not
for child frames.
* src/xfns.c (Xm/MwmUtil.h): Include for WM hints.
(PropMotifWmHints, PROP_MOTIF_WM_HINTS_ELEMENTS): Define for
non-Motif, non-GTK case.
(x_real_pos_and_offsets): Handle child frames.
(x_set_undecorated, x_set_parent_frame)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_override_redirect): New functions.
(x_set_menu_bar_lines): Not for child frames.
(x_window): Handle `undecorated' and `override_redirect' cases.
(Fx_create_frame): Handle new frame parameters.
(frame_geometry): Handle child frames and outer border.
(x_frame_list_z_order, Fx_frame_list_z_order)
(x_frame_restack, Fx_frame_restack): New functions.
(Fx_file_dialog, Fx_select_font): Set x_menu_set_in_use.
(x_frame_parm_handlers): Add entries for new frame parameters.
* src/xmenu.c (x_menu_set_in_use): Handle `z-group-above'
frames.
* src/xterm.c (x_set_frame_alpha): Don't set alpha of parent
for child frames.
(XTmouse_position): Handle child frames.
(x_scroll_bar_create, x_scroll_bar_expose): Don't let scroll
bars obscure child frames.
(handle_one_xevent): Handle child frame positions. If necessary
set `skip-taskbar' and reassign proper `z-group' when we are
mapped. When generating SELECT_WINDOW_EVENTs handle new value
of `focus-follows-mouse'. Handle `mouse-wheel-frame' parameter.
Let mouse clicks into a child frame activate the frame.
(x_calc_absolute_position, x_set_offset): Handle child frames
specially.
(x_set_skip_taskbar, x_set_z_group): New functions.
(x_make_frame_visible): Handle child frames.
(ATOM_REFS_INIT): Add entries for
Xatom_net_wm_state_skip_taskbar, Xatom_net_wm_state_above,
Xatom_net_wm_state_below.
* src/xterm.h (top-level): Declare Xatom_net_wm_state_above,
Xatom_net_wm_state_below and Xatom_net_wm_state_skip_taskbar.
(x_set_skip_taskbar, x_set_z_group): Add extern declarations.
2017-04-12 08:38:25 +00:00
|
|
|
|
left untouched. Do not delete any of FRAME's child frames. If
|
|
|
|
|
FRAME is a child frame, delete its siblings only. FRAME must be
|
2021-04-12 16:32:07 +00:00
|
|
|
|
a live frame and defaults to the selected one.
|
|
|
|
|
If the prefix arg ICONIFY is non-nil, just iconify the frames rather than
|
|
|
|
|
deleting them."
|
|
|
|
|
(interactive "i\nP")
|
2016-08-25 08:53:27 +00:00
|
|
|
|
(setq frame (window-normalize-frame frame))
|
|
|
|
|
(let ((minibuffer-frame (window-frame (minibuffer-window frame)))
|
|
|
|
|
(this (next-frame frame t))
|
Add new frame parameters and associated functions
Add new frame parameters `undecorated', `override-redirect',
`parent-frame', `skip-taskbar', `no-focus-on-map',
`no-accept-focus', `z-group', `delete-before', `no-other-frame',
`mouse-wheel-frame', `min-width', `min-height'. Add new
functions `frame-restack' and `frame-list-z-order'.
* lisp/cus-start.el (focus-follows-mouse): Adapt customization
type.
* lisp/frame.el (handle-delete-frame): Handle child and
`delete-before' frames.
(other-frame): Stop looking for other frame after one round.
(frame-list-z-order, frame-restack): New functions.
(delete-other-frames): Handle child frames.
* lisp/frameset.el (frameset-persistent-filter-alist)
(frameset--record-relationships): Handle `delete-before',
`parent-frame' and `mouse-wheel-frame' parameters. Rename
latter from `frameset--record-minibuffer-relationships'.
(frameset--restore-frame): Handle ‘parent-frame’ parameter
specially.
(frameset-restore): Handle `delete-before', `parent-frame' and
`mouse-wheel-frame' parameters.
* lisp/mwheel.el (mwheel-scroll): Handle `mouse-wheel-frame'
parameter.
* lisp/window.el (window--min-size-ignore-p): Fix doc-string.
(mouse-autoselect-window-select, handle-select-window): Major
rewrite. Try to not ignore errors. Handle auto-selection of
child frames and different values of `focus-follows-mouse'.
* src/frame.c (frame_windows_min_size): Handle new `min-width'
and `min-height' frame parameters.
(make_frame): Initialize new frame structure members.
(do_switch_frame): Don't reset internal_last_event_frame for
descendant frames.
(Fframe_parent, frame_ancestor_p, Fframe_ancestor_p): New
functions.
(candidate_frame): Don't return `no-other-frame' frame.
(other_frames): New function replacing other_visible_frames.
(delete_frame): Rewrite. Handle child and `delete-before' frames.
(Fmake_frame_invisible): Call other_frames.
(store_frame_param): Check `delete-before' and `parent-frame'
parameters for circular dependencies.
(frame_parms, syms_of_frame): Add entries for and define new
frame parameters.
(focus_follows_mouse): New meaningful value `auto-raise'.
* src/frame.h (z_group): New enumeration type.
(frame): New slots parent_frame, undecorated, override_redirect,
skip_taskbar, no_focus_on_map, no_accept_focus, z_group.
(fset_parent_frame): New inlined function.
(FRAME_UNDECORATED, FRAME_OVERRIDE_REDIRECT)
(FRAME_PARENT_FRAME, FRAME_SKIP_TASKBAR, FRAME_NO_FOCUS_ON_MAP)
(FRAME_NO_ACCEPT_FOCUS, FRAME_Z_GROUP, FRAME_Z_GROUP_NONE)
(FRAME_Z_GROUP_ABOVE, FRAME_Z_GROUP_ABOVE_SUSPENDED)
(FRAME_Z_GROUP_BELOW): New macros.
(frame_ancestor_p): Add declaration.
* src/gtkutil.c (xg_create_frame_widgets): Handle
`undecorated' and `override-redirect' frame parameters.
(x_wm_set_size_hint): None for child frames.
(xg_set_undecorated, xg_frame_restack, xg_set_skip_taskbar)
(xg_set_no_focus_on_map, xg_set_no_accept_focus)
(xg_set_override_redirect): New functions.
(xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos):
Don't let scrollbars obscure child frames.
* src/gtkutil.h: (xg_set_undecorated, xg_frame_restack)
(xg_set_skip_taskbar, xg_set_no_focus_on_map)
(xg_set_no_accept_focus, xg_set_override_redirect): Add extern
declarations.
* src/nsfns.m (ns_frame_parm_handlers): Add entries for new
frame parameters.
(Fx_create_frame): Install `min-width' and `min-height' frame
parameters.
* src/nsterm.m (mouseMoved:): Handle focus_follows_mouse change.
* src/w32fns.c (WS_EX_NOACTIVATE): Define if necessary.
(x_real_positions): Handle child frames.
(x_set_menu_bar_lines): Don't for child frames.
(x_set_undecorated, x_set_parent_frame, x_set_skip_taskbar)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_z_group): New functions.
(w32_createvscrollbar, w32_createhscrollbar): Don't draw
scroll bars over child frames.
(w32_createwindow): Handle new frame parameters and child frames.
(w32_wnd_proc): Let mouse clicks into a child frame activate
the frame. Try to handle the `no-accept-focus' parameter. Do
SetFocus when our window is brought to top or becomes the
foreground window.
(w32_window): Don't initialize menu bar for child frames.
(Fx_create_frame): Handle new frame parameters.
(x_create_tip_frame): Set explicit_parent slot.
(w32_dialog_in_progress): New function.
(Fx_file_dialog): Handle `z-group-above' frames.
(w32_frame_list_z_order, Fw32_frame_list_z_order)
(w32_frame_restack, Fw32_frame_restack): New functions.
(w32_frame_parm_handlers): Add entries for new frame
parameters.
* src/w32font.c (Fx_select_font): Handle `z-group-above'
frames during font selection dialogue.
* src/w32term.c (construct_mouse_wheel): Construct mouse wheel
event from F's w32 window.
(w32_mouse_position): Handle child frames.
(w32_set_vertical_scroll_bar, w32_set_horizontal_scroll_bar):
Don't draw scroll bars over child frames.
(w32_read_socket): Always erase background of child frames.
When generating SELECT_WINDOW_EVENTs handle new value of
`focus-follows-mouse' and handle `no-accept-focus' parameter.
Handle `mouse-wheel-frame' parameter.
(x_calc_absolute_position, x_set_offset, x_set_window_size):
Handle child frames.
(x_make_frame_visible): Handle child frames specially. Handle
`no-focus-on-map' parameter.
* src/w32term.h (w32_dialog_in_progress): Add external
declaration.
* src/xdisp.c (x_consider_frame_title, prepare_menu_bars): Not
for child frames.
* src/xfns.c (Xm/MwmUtil.h): Include for WM hints.
(PropMotifWmHints, PROP_MOTIF_WM_HINTS_ELEMENTS): Define for
non-Motif, non-GTK case.
(x_real_pos_and_offsets): Handle child frames.
(x_set_undecorated, x_set_parent_frame)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_override_redirect): New functions.
(x_set_menu_bar_lines): Not for child frames.
(x_window): Handle `undecorated' and `override_redirect' cases.
(Fx_create_frame): Handle new frame parameters.
(frame_geometry): Handle child frames and outer border.
(x_frame_list_z_order, Fx_frame_list_z_order)
(x_frame_restack, Fx_frame_restack): New functions.
(Fx_file_dialog, Fx_select_font): Set x_menu_set_in_use.
(x_frame_parm_handlers): Add entries for new frame parameters.
* src/xmenu.c (x_menu_set_in_use): Handle `z-group-above'
frames.
* src/xterm.c (x_set_frame_alpha): Don't set alpha of parent
for child frames.
(XTmouse_position): Handle child frames.
(x_scroll_bar_create, x_scroll_bar_expose): Don't let scroll
bars obscure child frames.
(handle_one_xevent): Handle child frame positions. If necessary
set `skip-taskbar' and reassign proper `z-group' when we are
mapped. When generating SELECT_WINDOW_EVENTs handle new value
of `focus-follows-mouse'. Handle `mouse-wheel-frame' parameter.
Let mouse clicks into a child frame activate the frame.
(x_calc_absolute_position, x_set_offset): Handle child frames
specially.
(x_set_skip_taskbar, x_set_z_group): New functions.
(x_make_frame_visible): Handle child frames.
(ATOM_REFS_INIT): Add entries for
Xatom_net_wm_state_skip_taskbar, Xatom_net_wm_state_above,
Xatom_net_wm_state_below.
* src/xterm.h (top-level): Declare Xatom_net_wm_state_above,
Xatom_net_wm_state_below and Xatom_net_wm_state_skip_taskbar.
(x_set_skip_taskbar, x_set_z_group): Add extern declarations.
2017-04-12 08:38:25 +00:00
|
|
|
|
(parent (frame-parent frame))
|
2016-08-25 08:53:27 +00:00
|
|
|
|
next)
|
|
|
|
|
;; In a first round consider minibuffer-less frames only.
|
|
|
|
|
(while (not (eq this frame))
|
|
|
|
|
(setq next (next-frame this t))
|
Add new frame parameters and associated functions
Add new frame parameters `undecorated', `override-redirect',
`parent-frame', `skip-taskbar', `no-focus-on-map',
`no-accept-focus', `z-group', `delete-before', `no-other-frame',
`mouse-wheel-frame', `min-width', `min-height'. Add new
functions `frame-restack' and `frame-list-z-order'.
* lisp/cus-start.el (focus-follows-mouse): Adapt customization
type.
* lisp/frame.el (handle-delete-frame): Handle child and
`delete-before' frames.
(other-frame): Stop looking for other frame after one round.
(frame-list-z-order, frame-restack): New functions.
(delete-other-frames): Handle child frames.
* lisp/frameset.el (frameset-persistent-filter-alist)
(frameset--record-relationships): Handle `delete-before',
`parent-frame' and `mouse-wheel-frame' parameters. Rename
latter from `frameset--record-minibuffer-relationships'.
(frameset--restore-frame): Handle ‘parent-frame’ parameter
specially.
(frameset-restore): Handle `delete-before', `parent-frame' and
`mouse-wheel-frame' parameters.
* lisp/mwheel.el (mwheel-scroll): Handle `mouse-wheel-frame'
parameter.
* lisp/window.el (window--min-size-ignore-p): Fix doc-string.
(mouse-autoselect-window-select, handle-select-window): Major
rewrite. Try to not ignore errors. Handle auto-selection of
child frames and different values of `focus-follows-mouse'.
* src/frame.c (frame_windows_min_size): Handle new `min-width'
and `min-height' frame parameters.
(make_frame): Initialize new frame structure members.
(do_switch_frame): Don't reset internal_last_event_frame for
descendant frames.
(Fframe_parent, frame_ancestor_p, Fframe_ancestor_p): New
functions.
(candidate_frame): Don't return `no-other-frame' frame.
(other_frames): New function replacing other_visible_frames.
(delete_frame): Rewrite. Handle child and `delete-before' frames.
(Fmake_frame_invisible): Call other_frames.
(store_frame_param): Check `delete-before' and `parent-frame'
parameters for circular dependencies.
(frame_parms, syms_of_frame): Add entries for and define new
frame parameters.
(focus_follows_mouse): New meaningful value `auto-raise'.
* src/frame.h (z_group): New enumeration type.
(frame): New slots parent_frame, undecorated, override_redirect,
skip_taskbar, no_focus_on_map, no_accept_focus, z_group.
(fset_parent_frame): New inlined function.
(FRAME_UNDECORATED, FRAME_OVERRIDE_REDIRECT)
(FRAME_PARENT_FRAME, FRAME_SKIP_TASKBAR, FRAME_NO_FOCUS_ON_MAP)
(FRAME_NO_ACCEPT_FOCUS, FRAME_Z_GROUP, FRAME_Z_GROUP_NONE)
(FRAME_Z_GROUP_ABOVE, FRAME_Z_GROUP_ABOVE_SUSPENDED)
(FRAME_Z_GROUP_BELOW): New macros.
(frame_ancestor_p): Add declaration.
* src/gtkutil.c (xg_create_frame_widgets): Handle
`undecorated' and `override-redirect' frame parameters.
(x_wm_set_size_hint): None for child frames.
(xg_set_undecorated, xg_frame_restack, xg_set_skip_taskbar)
(xg_set_no_focus_on_map, xg_set_no_accept_focus)
(xg_set_override_redirect): New functions.
(xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos):
Don't let scrollbars obscure child frames.
* src/gtkutil.h: (xg_set_undecorated, xg_frame_restack)
(xg_set_skip_taskbar, xg_set_no_focus_on_map)
(xg_set_no_accept_focus, xg_set_override_redirect): Add extern
declarations.
* src/nsfns.m (ns_frame_parm_handlers): Add entries for new
frame parameters.
(Fx_create_frame): Install `min-width' and `min-height' frame
parameters.
* src/nsterm.m (mouseMoved:): Handle focus_follows_mouse change.
* src/w32fns.c (WS_EX_NOACTIVATE): Define if necessary.
(x_real_positions): Handle child frames.
(x_set_menu_bar_lines): Don't for child frames.
(x_set_undecorated, x_set_parent_frame, x_set_skip_taskbar)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_z_group): New functions.
(w32_createvscrollbar, w32_createhscrollbar): Don't draw
scroll bars over child frames.
(w32_createwindow): Handle new frame parameters and child frames.
(w32_wnd_proc): Let mouse clicks into a child frame activate
the frame. Try to handle the `no-accept-focus' parameter. Do
SetFocus when our window is brought to top or becomes the
foreground window.
(w32_window): Don't initialize menu bar for child frames.
(Fx_create_frame): Handle new frame parameters.
(x_create_tip_frame): Set explicit_parent slot.
(w32_dialog_in_progress): New function.
(Fx_file_dialog): Handle `z-group-above' frames.
(w32_frame_list_z_order, Fw32_frame_list_z_order)
(w32_frame_restack, Fw32_frame_restack): New functions.
(w32_frame_parm_handlers): Add entries for new frame
parameters.
* src/w32font.c (Fx_select_font): Handle `z-group-above'
frames during font selection dialogue.
* src/w32term.c (construct_mouse_wheel): Construct mouse wheel
event from F's w32 window.
(w32_mouse_position): Handle child frames.
(w32_set_vertical_scroll_bar, w32_set_horizontal_scroll_bar):
Don't draw scroll bars over child frames.
(w32_read_socket): Always erase background of child frames.
When generating SELECT_WINDOW_EVENTs handle new value of
`focus-follows-mouse' and handle `no-accept-focus' parameter.
Handle `mouse-wheel-frame' parameter.
(x_calc_absolute_position, x_set_offset, x_set_window_size):
Handle child frames.
(x_make_frame_visible): Handle child frames specially. Handle
`no-focus-on-map' parameter.
* src/w32term.h (w32_dialog_in_progress): Add external
declaration.
* src/xdisp.c (x_consider_frame_title, prepare_menu_bars): Not
for child frames.
* src/xfns.c (Xm/MwmUtil.h): Include for WM hints.
(PropMotifWmHints, PROP_MOTIF_WM_HINTS_ELEMENTS): Define for
non-Motif, non-GTK case.
(x_real_pos_and_offsets): Handle child frames.
(x_set_undecorated, x_set_parent_frame)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_override_redirect): New functions.
(x_set_menu_bar_lines): Not for child frames.
(x_window): Handle `undecorated' and `override_redirect' cases.
(Fx_create_frame): Handle new frame parameters.
(frame_geometry): Handle child frames and outer border.
(x_frame_list_z_order, Fx_frame_list_z_order)
(x_frame_restack, Fx_frame_restack): New functions.
(Fx_file_dialog, Fx_select_font): Set x_menu_set_in_use.
(x_frame_parm_handlers): Add entries for new frame parameters.
* src/xmenu.c (x_menu_set_in_use): Handle `z-group-above'
frames.
* src/xterm.c (x_set_frame_alpha): Don't set alpha of parent
for child frames.
(XTmouse_position): Handle child frames.
(x_scroll_bar_create, x_scroll_bar_expose): Don't let scroll
bars obscure child frames.
(handle_one_xevent): Handle child frame positions. If necessary
set `skip-taskbar' and reassign proper `z-group' when we are
mapped. When generating SELECT_WINDOW_EVENTs handle new value
of `focus-follows-mouse'. Handle `mouse-wheel-frame' parameter.
Let mouse clicks into a child frame activate the frame.
(x_calc_absolute_position, x_set_offset): Handle child frames
specially.
(x_set_skip_taskbar, x_set_z_group): New functions.
(x_make_frame_visible): Handle child frames.
(ATOM_REFS_INIT): Add entries for
Xatom_net_wm_state_skip_taskbar, Xatom_net_wm_state_above,
Xatom_net_wm_state_below.
* src/xterm.h (top-level): Declare Xatom_net_wm_state_above,
Xatom_net_wm_state_below and Xatom_net_wm_state_skip_taskbar.
(x_set_skip_taskbar, x_set_z_group): Add extern declarations.
2017-04-12 08:38:25 +00:00
|
|
|
|
(unless (or (eq (window-frame (minibuffer-window this)) this)
|
|
|
|
|
;; When FRAME is a child frame, delete its siblings
|
|
|
|
|
;; only.
|
|
|
|
|
(and parent (not (eq (frame-parent this) parent)))
|
|
|
|
|
;; Do not delete a child frame of FRAME.
|
|
|
|
|
(eq (frame-parent this) frame))
|
2021-04-12 16:32:07 +00:00
|
|
|
|
(if iconify (iconify-frame this) (delete-frame this)))
|
2016-08-25 08:53:27 +00:00
|
|
|
|
(setq this next))
|
|
|
|
|
;; In a second round consider all remaining frames.
|
|
|
|
|
(setq this (next-frame frame t))
|
|
|
|
|
(while (not (eq this frame))
|
|
|
|
|
(setq next (next-frame this t))
|
Add new frame parameters and associated functions
Add new frame parameters `undecorated', `override-redirect',
`parent-frame', `skip-taskbar', `no-focus-on-map',
`no-accept-focus', `z-group', `delete-before', `no-other-frame',
`mouse-wheel-frame', `min-width', `min-height'. Add new
functions `frame-restack' and `frame-list-z-order'.
* lisp/cus-start.el (focus-follows-mouse): Adapt customization
type.
* lisp/frame.el (handle-delete-frame): Handle child and
`delete-before' frames.
(other-frame): Stop looking for other frame after one round.
(frame-list-z-order, frame-restack): New functions.
(delete-other-frames): Handle child frames.
* lisp/frameset.el (frameset-persistent-filter-alist)
(frameset--record-relationships): Handle `delete-before',
`parent-frame' and `mouse-wheel-frame' parameters. Rename
latter from `frameset--record-minibuffer-relationships'.
(frameset--restore-frame): Handle ‘parent-frame’ parameter
specially.
(frameset-restore): Handle `delete-before', `parent-frame' and
`mouse-wheel-frame' parameters.
* lisp/mwheel.el (mwheel-scroll): Handle `mouse-wheel-frame'
parameter.
* lisp/window.el (window--min-size-ignore-p): Fix doc-string.
(mouse-autoselect-window-select, handle-select-window): Major
rewrite. Try to not ignore errors. Handle auto-selection of
child frames and different values of `focus-follows-mouse'.
* src/frame.c (frame_windows_min_size): Handle new `min-width'
and `min-height' frame parameters.
(make_frame): Initialize new frame structure members.
(do_switch_frame): Don't reset internal_last_event_frame for
descendant frames.
(Fframe_parent, frame_ancestor_p, Fframe_ancestor_p): New
functions.
(candidate_frame): Don't return `no-other-frame' frame.
(other_frames): New function replacing other_visible_frames.
(delete_frame): Rewrite. Handle child and `delete-before' frames.
(Fmake_frame_invisible): Call other_frames.
(store_frame_param): Check `delete-before' and `parent-frame'
parameters for circular dependencies.
(frame_parms, syms_of_frame): Add entries for and define new
frame parameters.
(focus_follows_mouse): New meaningful value `auto-raise'.
* src/frame.h (z_group): New enumeration type.
(frame): New slots parent_frame, undecorated, override_redirect,
skip_taskbar, no_focus_on_map, no_accept_focus, z_group.
(fset_parent_frame): New inlined function.
(FRAME_UNDECORATED, FRAME_OVERRIDE_REDIRECT)
(FRAME_PARENT_FRAME, FRAME_SKIP_TASKBAR, FRAME_NO_FOCUS_ON_MAP)
(FRAME_NO_ACCEPT_FOCUS, FRAME_Z_GROUP, FRAME_Z_GROUP_NONE)
(FRAME_Z_GROUP_ABOVE, FRAME_Z_GROUP_ABOVE_SUSPENDED)
(FRAME_Z_GROUP_BELOW): New macros.
(frame_ancestor_p): Add declaration.
* src/gtkutil.c (xg_create_frame_widgets): Handle
`undecorated' and `override-redirect' frame parameters.
(x_wm_set_size_hint): None for child frames.
(xg_set_undecorated, xg_frame_restack, xg_set_skip_taskbar)
(xg_set_no_focus_on_map, xg_set_no_accept_focus)
(xg_set_override_redirect): New functions.
(xg_update_scrollbar_pos, xg_update_horizontal_scrollbar_pos):
Don't let scrollbars obscure child frames.
* src/gtkutil.h: (xg_set_undecorated, xg_frame_restack)
(xg_set_skip_taskbar, xg_set_no_focus_on_map)
(xg_set_no_accept_focus, xg_set_override_redirect): Add extern
declarations.
* src/nsfns.m (ns_frame_parm_handlers): Add entries for new
frame parameters.
(Fx_create_frame): Install `min-width' and `min-height' frame
parameters.
* src/nsterm.m (mouseMoved:): Handle focus_follows_mouse change.
* src/w32fns.c (WS_EX_NOACTIVATE): Define if necessary.
(x_real_positions): Handle child frames.
(x_set_menu_bar_lines): Don't for child frames.
(x_set_undecorated, x_set_parent_frame, x_set_skip_taskbar)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_z_group): New functions.
(w32_createvscrollbar, w32_createhscrollbar): Don't draw
scroll bars over child frames.
(w32_createwindow): Handle new frame parameters and child frames.
(w32_wnd_proc): Let mouse clicks into a child frame activate
the frame. Try to handle the `no-accept-focus' parameter. Do
SetFocus when our window is brought to top or becomes the
foreground window.
(w32_window): Don't initialize menu bar for child frames.
(Fx_create_frame): Handle new frame parameters.
(x_create_tip_frame): Set explicit_parent slot.
(w32_dialog_in_progress): New function.
(Fx_file_dialog): Handle `z-group-above' frames.
(w32_frame_list_z_order, Fw32_frame_list_z_order)
(w32_frame_restack, Fw32_frame_restack): New functions.
(w32_frame_parm_handlers): Add entries for new frame
parameters.
* src/w32font.c (Fx_select_font): Handle `z-group-above'
frames during font selection dialogue.
* src/w32term.c (construct_mouse_wheel): Construct mouse wheel
event from F's w32 window.
(w32_mouse_position): Handle child frames.
(w32_set_vertical_scroll_bar, w32_set_horizontal_scroll_bar):
Don't draw scroll bars over child frames.
(w32_read_socket): Always erase background of child frames.
When generating SELECT_WINDOW_EVENTs handle new value of
`focus-follows-mouse' and handle `no-accept-focus' parameter.
Handle `mouse-wheel-frame' parameter.
(x_calc_absolute_position, x_set_offset, x_set_window_size):
Handle child frames.
(x_make_frame_visible): Handle child frames specially. Handle
`no-focus-on-map' parameter.
* src/w32term.h (w32_dialog_in_progress): Add external
declaration.
* src/xdisp.c (x_consider_frame_title, prepare_menu_bars): Not
for child frames.
* src/xfns.c (Xm/MwmUtil.h): Include for WM hints.
(PropMotifWmHints, PROP_MOTIF_WM_HINTS_ELEMENTS): Define for
non-Motif, non-GTK case.
(x_real_pos_and_offsets): Handle child frames.
(x_set_undecorated, x_set_parent_frame)
(x_set_no_focus_on_map, x_set_no_accept_focus)
(x_set_override_redirect): New functions.
(x_set_menu_bar_lines): Not for child frames.
(x_window): Handle `undecorated' and `override_redirect' cases.
(Fx_create_frame): Handle new frame parameters.
(frame_geometry): Handle child frames and outer border.
(x_frame_list_z_order, Fx_frame_list_z_order)
(x_frame_restack, Fx_frame_restack): New functions.
(Fx_file_dialog, Fx_select_font): Set x_menu_set_in_use.
(x_frame_parm_handlers): Add entries for new frame parameters.
* src/xmenu.c (x_menu_set_in_use): Handle `z-group-above'
frames.
* src/xterm.c (x_set_frame_alpha): Don't set alpha of parent
for child frames.
(XTmouse_position): Handle child frames.
(x_scroll_bar_create, x_scroll_bar_expose): Don't let scroll
bars obscure child frames.
(handle_one_xevent): Handle child frame positions. If necessary
set `skip-taskbar' and reassign proper `z-group' when we are
mapped. When generating SELECT_WINDOW_EVENTs handle new value
of `focus-follows-mouse'. Handle `mouse-wheel-frame' parameter.
Let mouse clicks into a child frame activate the frame.
(x_calc_absolute_position, x_set_offset): Handle child frames
specially.
(x_set_skip_taskbar, x_set_z_group): New functions.
(x_make_frame_visible): Handle child frames.
(ATOM_REFS_INIT): Add entries for
Xatom_net_wm_state_skip_taskbar, Xatom_net_wm_state_above,
Xatom_net_wm_state_below.
* src/xterm.h (top-level): Declare Xatom_net_wm_state_above,
Xatom_net_wm_state_below and Xatom_net_wm_state_skip_taskbar.
(x_set_skip_taskbar, x_set_z_group): Add extern declarations.
2017-04-12 08:38:25 +00:00
|
|
|
|
(unless (or (eq this minibuffer-frame)
|
|
|
|
|
;; When FRAME is a child frame, delete its siblings
|
|
|
|
|
;; only.
|
|
|
|
|
(and parent (not (eq (frame-parent this) parent)))
|
|
|
|
|
;; Do not delete a child frame of FRAME.
|
|
|
|
|
(eq (frame-parent this) frame))
|
2021-04-12 16:32:07 +00:00
|
|
|
|
(if iconify (iconify-frame this) (delete-frame this)))
|
2016-08-25 08:53:27 +00:00
|
|
|
|
(setq this next))))
|
2000-01-28 13:22:46 +00:00
|
|
|
|
|
1999-07-21 21:43:03 +00:00
|
|
|
|
|
2015-07-02 07:03:45 +00:00
|
|
|
|
;;; Window dividers.
|
|
|
|
|
(defgroup window-divider nil
|
|
|
|
|
"Window dividers."
|
|
|
|
|
:version "25.1"
|
|
|
|
|
:group 'frames
|
|
|
|
|
:group 'windows)
|
|
|
|
|
|
2015-07-03 13:15:51 +00:00
|
|
|
|
(defcustom window-divider-default-places 'right-only
|
|
|
|
|
"Default positions of window dividers.
|
|
|
|
|
Possible values are `bottom-only' (dividers on the bottom of each
|
|
|
|
|
window only), `right-only' (dividers on the right of each window
|
|
|
|
|
only), and t (dividers on the bottom and on the right of each
|
|
|
|
|
window). The default is `right-only'.
|
|
|
|
|
|
|
|
|
|
The value takes effect if and only if dividers are enabled by
|
|
|
|
|
`window-divider-mode'.
|
|
|
|
|
|
|
|
|
|
To position dividers on frames individually, use the frame
|
|
|
|
|
parameters `bottom-divider-width' and `right-divider-width'."
|
|
|
|
|
:type '(choice (const :tag "Bottom only" bottom-only)
|
2015-07-02 07:03:45 +00:00
|
|
|
|
(const :tag "Right only" right-only)
|
|
|
|
|
(const :tag "Bottom and right" t))
|
2021-04-12 16:32:07 +00:00
|
|
|
|
:initialize #'custom-initialize-default
|
2015-07-03 13:15:51 +00:00
|
|
|
|
:set (lambda (symbol value)
|
|
|
|
|
(set-default symbol value)
|
|
|
|
|
(when window-divider-mode
|
|
|
|
|
(window-divider-mode-apply t)))
|
2015-07-02 07:03:45 +00:00
|
|
|
|
:version "25.1")
|
|
|
|
|
|
2015-07-03 13:15:51 +00:00
|
|
|
|
(defun window-divider-width-valid-p (value)
|
2015-07-02 07:03:45 +00:00
|
|
|
|
"Return non-nil if VALUE is a positive number."
|
|
|
|
|
(and (numberp value) (> value 0)))
|
|
|
|
|
|
|
|
|
|
(defcustom window-divider-default-bottom-width 6
|
|
|
|
|
"Default width of dividers on bottom of windows.
|
|
|
|
|
The value must be a positive integer and takes effect when bottom
|
|
|
|
|
dividers are displayed by `window-divider-mode'.
|
|
|
|
|
|
|
|
|
|
To adjust bottom dividers for frames individually, use the frame
|
|
|
|
|
parameter `bottom-divider-width'."
|
|
|
|
|
:type '(restricted-sexp
|
2015-07-03 13:15:51 +00:00
|
|
|
|
:tag "Default width of bottom dividers"
|
2017-07-26 08:14:06 +00:00
|
|
|
|
:match-alternatives (window-divider-width-valid-p))
|
2021-04-12 16:32:07 +00:00
|
|
|
|
:initialize #'custom-initialize-default
|
2015-07-02 07:03:45 +00:00
|
|
|
|
:set (lambda (symbol value)
|
|
|
|
|
(set-default symbol value)
|
2015-07-03 13:15:51 +00:00
|
|
|
|
(when window-divider-mode
|
|
|
|
|
(window-divider-mode-apply t)))
|
2015-07-02 07:03:45 +00:00
|
|
|
|
:version "25.1")
|
|
|
|
|
|
|
|
|
|
(defcustom window-divider-default-right-width 6
|
|
|
|
|
"Default width of dividers on the right of windows.
|
|
|
|
|
The value must be a positive integer and takes effect when right
|
|
|
|
|
dividers are displayed by `window-divider-mode'.
|
|
|
|
|
|
|
|
|
|
To adjust right dividers for frames individually, use the frame
|
|
|
|
|
parameter `right-divider-width'."
|
|
|
|
|
:type '(restricted-sexp
|
2015-07-03 13:15:51 +00:00
|
|
|
|
:tag "Default width of right dividers"
|
2017-07-26 08:14:06 +00:00
|
|
|
|
:match-alternatives (window-divider-width-valid-p))
|
2021-04-12 16:32:07 +00:00
|
|
|
|
:initialize #'custom-initialize-default
|
2015-07-02 07:03:45 +00:00
|
|
|
|
:set (lambda (symbol value)
|
|
|
|
|
(set-default symbol value)
|
2015-07-03 13:15:51 +00:00
|
|
|
|
(when window-divider-mode
|
|
|
|
|
(window-divider-mode-apply t)))
|
2015-07-02 07:03:45 +00:00
|
|
|
|
:version "25.1")
|
|
|
|
|
|
2015-07-03 13:15:51 +00:00
|
|
|
|
(defun window-divider-mode-apply (enable)
|
|
|
|
|
"Apply window divider places and widths to all frames.
|
|
|
|
|
If ENABLE is nil, apply default places and widths. Else reset
|
|
|
|
|
all divider widths to zero."
|
|
|
|
|
(let ((bottom (if (and enable
|
|
|
|
|
(memq window-divider-default-places
|
|
|
|
|
'(bottom-only t)))
|
2015-07-02 07:03:45 +00:00
|
|
|
|
window-divider-default-bottom-width
|
|
|
|
|
0))
|
2015-07-03 13:15:51 +00:00
|
|
|
|
(right (if (and enable
|
|
|
|
|
(memq window-divider-default-places
|
|
|
|
|
'(right-only t)))
|
2015-07-02 07:03:45 +00:00
|
|
|
|
window-divider-default-right-width
|
|
|
|
|
0)))
|
|
|
|
|
(modify-all-frames-parameters
|
|
|
|
|
(list (cons 'bottom-divider-width bottom)
|
|
|
|
|
(cons 'right-divider-width right)))
|
|
|
|
|
(setq default-frame-alist
|
|
|
|
|
(assq-delete-all
|
|
|
|
|
'bottom-divider-width default-frame-alist))
|
|
|
|
|
(setq default-frame-alist
|
|
|
|
|
(assq-delete-all
|
|
|
|
|
'right-divider-width default-frame-alist))
|
|
|
|
|
(when (> bottom 0)
|
|
|
|
|
(setq default-frame-alist
|
|
|
|
|
(cons
|
|
|
|
|
(cons 'bottom-divider-width bottom)
|
|
|
|
|
default-frame-alist)))
|
|
|
|
|
(when (> right 0)
|
|
|
|
|
(setq default-frame-alist
|
|
|
|
|
(cons
|
|
|
|
|
(cons 'right-divider-width right)
|
|
|
|
|
default-frame-alist)))))
|
|
|
|
|
|
2015-07-03 13:15:51 +00:00
|
|
|
|
(define-minor-mode window-divider-mode
|
|
|
|
|
"Display dividers between windows (Window Divider mode).
|
|
|
|
|
|
|
|
|
|
The option `window-divider-default-places' specifies on which
|
|
|
|
|
side of a window dividers are displayed. The options
|
|
|
|
|
`window-divider-default-bottom-width' and
|
|
|
|
|
`window-divider-default-right-width' specify their respective
|
|
|
|
|
widths."
|
|
|
|
|
:group 'window-divider
|
|
|
|
|
:global t
|
|
|
|
|
(window-divider-mode-apply window-divider-mode))
|
2015-07-02 07:03:45 +00:00
|
|
|
|
|
2001-10-12 20:39:54 +00:00
|
|
|
|
;; Blinking cursor
|
1999-07-21 21:43:03 +00:00
|
|
|
|
|
2016-10-02 20:19:08 +00:00
|
|
|
|
(defvar blink-cursor-idle-timer nil
|
|
|
|
|
"Timer started after `blink-cursor-delay' seconds of Emacs idle time.
|
|
|
|
|
The function `blink-cursor-start' is called when the timer fires.")
|
|
|
|
|
|
|
|
|
|
(defvar blink-cursor-timer nil
|
|
|
|
|
"Timer started from `blink-cursor-start'.
|
|
|
|
|
This timer calls `blink-cursor-timer-function' every
|
|
|
|
|
`blink-cursor-interval' seconds.")
|
|
|
|
|
|
1999-07-21 21:43:03 +00:00
|
|
|
|
(defgroup cursor nil
|
1999-11-01 15:28:32 +00:00
|
|
|
|
"Displaying text cursors."
|
1999-07-30 18:39:32 +00:00
|
|
|
|
:version "21.1"
|
1999-07-21 21:43:03 +00:00
|
|
|
|
:group 'frames)
|
|
|
|
|
|
|
|
|
|
(defcustom blink-cursor-delay 0.5
|
2016-10-01 08:23:18 +00:00
|
|
|
|
"Seconds of idle time before the first blink of the cursor.
|
|
|
|
|
Values smaller than 0.2 sec are treated as 0.2 sec."
|
1999-07-21 21:43:03 +00:00
|
|
|
|
:type 'number
|
2016-09-10 08:16:32 +00:00
|
|
|
|
:group 'cursor
|
|
|
|
|
:set (lambda (symbol value)
|
|
|
|
|
(set-default symbol value)
|
|
|
|
|
(when blink-cursor-idle-timer (blink-cursor--start-idle-timer))))
|
1999-07-21 21:43:03 +00:00
|
|
|
|
|
|
|
|
|
(defcustom blink-cursor-interval 0.5
|
Fix typos in docstrings.
* cus-edit.el (customize-apropos-options, custom-comment)
(custom-comment-tag, custom-face-edit-attribute-tag):
Fix typos in docstrings.
(custom-buffer-done-kill): Remove * from defcustom docstring.
(custom-file): Fix typo in doc of defcustom choice.
* frame.el (display-visual-class): Fix typo in docstring.
(initial-frame-alist, minibuffer-frame-alist, pop-up-frame-alist)
(special-display-frame-alist, show-trailing-whitespace)
(auto-hscroll-mode, blink-cursor-delay, blink-cursor-interval)
(display-hourglass, hourglass-delay, cursor-in-non-selected-windows):
Remove * from defcustom docstrings.
* md4.el (md4-buffer): Fix typo in docstring.
(md4, md4-64): Doc fixes.
(md4-pack-int32): Reflow docstring.
* paths.el (rmail-file-name): Remove * from defcustom docstring.
(prune-directory-list, gnus-nntp-service): Fix typos in docstrings.
* rect.el (open-rectangle): Reflow docstring.
(spaces-string): Fix docstring typo. Use "?\s" instead of "? ".
* select.el (x-get-cut-buffer): Fix typo in docstring.
* timezone.el (timezone-zone-to-minute, timezone-time-from-absolute)
(timezone-time-zone-from-absolute, timezone-leap-year-p):
Fix typos in docstrings.
* emacs-lisp/assoc.el (asort, aelement, aput, aget, amake):
Fix typos in docstrings.
2008-11-01 01:24:33 +00:00
|
|
|
|
"Length of cursor blink interval in seconds."
|
1999-07-21 21:43:03 +00:00
|
|
|
|
:type 'number
|
2016-09-10 08:16:32 +00:00
|
|
|
|
:group 'cursor
|
|
|
|
|
:set (lambda (symbol value)
|
|
|
|
|
(set-default symbol value)
|
|
|
|
|
(when blink-cursor-timer (blink-cursor--start-timer))))
|
1999-07-21 21:43:03 +00:00
|
|
|
|
|
2013-07-16 11:41:06 +00:00
|
|
|
|
(defcustom blink-cursor-blinks 10
|
2014-04-13 07:49:23 +00:00
|
|
|
|
"How many times to blink before using a solid cursor on NS, X, and MS-Windows.
|
2013-07-16 11:41:06 +00:00
|
|
|
|
Use 0 or negative value to blink forever."
|
|
|
|
|
:version "24.4"
|
|
|
|
|
:type 'integer
|
|
|
|
|
:group 'cursor)
|
|
|
|
|
|
|
|
|
|
(defvar blink-cursor-blinks-done 1
|
2014-04-13 07:49:23 +00:00
|
|
|
|
"Number of blinks done since we started blinking on NS, X, and MS-Windows.")
|
2013-07-16 11:41:06 +00:00
|
|
|
|
|
2016-09-10 08:16:32 +00:00
|
|
|
|
(defun blink-cursor--start-idle-timer ()
|
|
|
|
|
"Start the `blink-cursor-idle-timer'."
|
|
|
|
|
(when blink-cursor-idle-timer (cancel-timer blink-cursor-idle-timer))
|
|
|
|
|
(setq blink-cursor-idle-timer
|
|
|
|
|
;; The 0.2 sec limitation from below is to avoid erratic
|
|
|
|
|
;; behavior (or downright failure to display the cursor
|
|
|
|
|
;; during command execution) if they set blink-cursor-delay
|
|
|
|
|
;; to a very small or even zero value.
|
|
|
|
|
(run-with-idle-timer (max 0.2 blink-cursor-delay)
|
|
|
|
|
:repeat #'blink-cursor-start)))
|
|
|
|
|
|
|
|
|
|
(defun blink-cursor--start-timer ()
|
|
|
|
|
"Start the `blink-cursor-timer'."
|
|
|
|
|
(when blink-cursor-timer (cancel-timer blink-cursor-timer))
|
|
|
|
|
(setq blink-cursor-timer
|
|
|
|
|
(run-with-timer blink-cursor-interval blink-cursor-interval
|
|
|
|
|
#'blink-cursor-timer-function)))
|
|
|
|
|
|
1999-07-21 21:43:03 +00:00
|
|
|
|
(defun blink-cursor-start ()
|
1999-11-01 15:28:32 +00:00
|
|
|
|
"Timer function called from the timer `blink-cursor-idle-timer'.
|
|
|
|
|
This starts the timer `blink-cursor-timer', which makes the cursor blink
|
|
|
|
|
if appropriate. It also arranges to cancel that timer when the next
|
|
|
|
|
command starts, by installing a pre-command hook."
|
2021-01-19 17:10:48 +00:00
|
|
|
|
(cond
|
|
|
|
|
((null blink-cursor-mode) (blink-cursor-mode -1))
|
|
|
|
|
((null blink-cursor-timer)
|
2006-08-20 14:43:29 +00:00
|
|
|
|
;; Set up the timer first, so that if this signals an error,
|
|
|
|
|
;; blink-cursor-end is not added to pre-command-hook.
|
2013-07-16 11:41:06 +00:00
|
|
|
|
(setq blink-cursor-blinks-done 1)
|
2016-09-10 08:16:32 +00:00
|
|
|
|
(blink-cursor--start-timer)
|
2021-01-16 04:18:08 +00:00
|
|
|
|
(add-hook 'pre-command-hook #'blink-cursor-end)
|
2021-01-19 17:10:48 +00:00
|
|
|
|
(internal-show-cursor nil nil))))
|
1999-11-03 15:57:21 +00:00
|
|
|
|
|
|
|
|
|
(defun blink-cursor-timer-function ()
|
|
|
|
|
"Timer function of timer `blink-cursor-timer'."
|
2013-07-16 11:41:06 +00:00
|
|
|
|
(internal-show-cursor nil (not (internal-show-cursor-p)))
|
2015-02-23 17:46:44 +00:00
|
|
|
|
;; Suspend counting blinks when the w32 menu-bar menu is displayed,
|
|
|
|
|
;; since otherwise menu tooltips will behave erratically.
|
|
|
|
|
(or (and (fboundp 'w32--menu-bar-in-use)
|
|
|
|
|
(w32--menu-bar-in-use))
|
|
|
|
|
(setq blink-cursor-blinks-done (1+ blink-cursor-blinks-done)))
|
2013-07-16 11:41:06 +00:00
|
|
|
|
;; Each blink is two calls to this function.
|
2013-11-25 02:41:02 +00:00
|
|
|
|
(when (and (> blink-cursor-blinks 0)
|
|
|
|
|
(<= (* 2 blink-cursor-blinks) blink-cursor-blinks-done))
|
|
|
|
|
(blink-cursor-suspend)
|
2021-01-16 04:18:08 +00:00
|
|
|
|
(add-hook 'post-command-hook #'blink-cursor-check)))
|
2013-07-16 11:41:06 +00:00
|
|
|
|
|
1999-07-21 21:43:03 +00:00
|
|
|
|
(defun blink-cursor-end ()
|
|
|
|
|
"Stop cursor blinking.
|
1999-11-01 15:28:32 +00:00
|
|
|
|
This is installed as a pre-command hook by `blink-cursor-start'.
|
2001-11-26 18:20:20 +00:00
|
|
|
|
When run, it cancels the timer `blink-cursor-timer' and removes
|
1999-11-01 15:28:32 +00:00
|
|
|
|
itself as a pre-command hook."
|
2021-01-16 04:18:08 +00:00
|
|
|
|
(remove-hook 'pre-command-hook #'blink-cursor-end)
|
1999-11-03 15:57:21 +00:00
|
|
|
|
(internal-show-cursor nil t)
|
2006-08-22 01:35:45 +00:00
|
|
|
|
(when blink-cursor-timer
|
|
|
|
|
(cancel-timer blink-cursor-timer)
|
|
|
|
|
(setq blink-cursor-timer nil)))
|
1999-07-21 21:43:03 +00:00
|
|
|
|
|
2013-07-16 11:41:06 +00:00
|
|
|
|
(defun blink-cursor-suspend ()
|
2013-11-25 02:41:02 +00:00
|
|
|
|
"Suspend cursor blinking.
|
2013-07-16 11:41:06 +00:00
|
|
|
|
This is called when no frame has focus and timers can be suspended.
|
|
|
|
|
Timers are restarted by `blink-cursor-check', which is called when a
|
|
|
|
|
frame receives focus."
|
2013-11-25 02:41:02 +00:00
|
|
|
|
(blink-cursor-end)
|
|
|
|
|
(when blink-cursor-idle-timer
|
|
|
|
|
(cancel-timer blink-cursor-idle-timer)
|
|
|
|
|
(setq blink-cursor-idle-timer nil)))
|
2013-07-16 11:41:06 +00:00
|
|
|
|
|
2018-06-11 23:54:23 +00:00
|
|
|
|
(defun blink-cursor--should-blink ()
|
2018-06-11 23:08:29 +00:00
|
|
|
|
"Determine whether we should be blinking.
|
2018-06-11 23:54:23 +00:00
|
|
|
|
Returns whether we have any focused non-TTY frame."
|
2019-06-26 14:24:59 +00:00
|
|
|
|
(and blink-cursor-mode
|
|
|
|
|
(let ((frame-list (frame-list))
|
|
|
|
|
(any-graphical-focused nil))
|
|
|
|
|
(while frame-list
|
|
|
|
|
(let ((frame (pop frame-list)))
|
|
|
|
|
(when (and (display-graphic-p frame) (frame-focus-state frame))
|
|
|
|
|
(setf any-graphical-focused t)
|
|
|
|
|
(setf frame-list nil))))
|
|
|
|
|
any-graphical-focused)))
|
2018-06-11 23:08:29 +00:00
|
|
|
|
|
2018-06-11 23:54:23 +00:00
|
|
|
|
(defun blink-cursor-check ()
|
2013-07-21 04:22:33 +00:00
|
|
|
|
"Check if cursor blinking shall be restarted.
|
2018-06-11 23:08:29 +00:00
|
|
|
|
This is done when a frame gets focus. Blink timers may be
|
|
|
|
|
stopped by `blink-cursor-suspend'. Internally calls
|
|
|
|
|
`blink-cursor--should-blink' and returns its result."
|
2018-06-11 23:54:23 +00:00
|
|
|
|
(let ((should-blink (blink-cursor--should-blink)))
|
2018-06-11 23:08:29 +00:00
|
|
|
|
(when (and should-blink (not blink-cursor-idle-timer))
|
2021-01-19 17:10:48 +00:00
|
|
|
|
(remove-hook 'post-command-hook #'blink-cursor-check)
|
2018-06-11 23:08:29 +00:00
|
|
|
|
(blink-cursor--start-idle-timer))
|
|
|
|
|
should-blink))
|
|
|
|
|
|
2018-06-11 23:54:23 +00:00
|
|
|
|
(defun blink-cursor--rescan-frames (&optional _ign)
|
|
|
|
|
"Called when the set of focused frames changes or when we delete a frame."
|
|
|
|
|
(unless (blink-cursor-check)
|
2018-06-11 23:08:29 +00:00
|
|
|
|
(blink-cursor-suspend)))
|
2013-07-16 11:41:06 +00:00
|
|
|
|
|
2006-08-22 01:35:45 +00:00
|
|
|
|
(define-minor-mode blink-cursor-mode
|
Fix minor mode docstrings for the new meaning of a nil ARG.
* abbrev.el (abbrev-mode):
* allout.el (allout-mode):
* autoinsert.el (auto-insert-mode):
* autoarg.el (autoarg-mode, autoarg-kp-mode):
* autorevert.el (auto-revert-mode, auto-revert-tail-mode)
(global-auto-revert-mode):
* battery.el (display-battery-mode):
* composite.el (global-auto-composition-mode)
(auto-composition-mode):
* delsel.el (delete-selection-mode):
* desktop.el (desktop-save-mode):
* dired-x.el (dired-omit-mode):
* dirtrack.el (dirtrack-mode):
* doc-view.el (doc-view-minor-mode):
* double.el (double-mode):
* electric.el (electric-indent-mode, electric-pair-mode):
* emacs-lock.el (emacs-lock-mode):
* epa-hook.el (auto-encryption-mode):
* follow.el (follow-mode):
* font-core.el (font-lock-mode):
* frame.el (auto-raise-mode, auto-lower-mode, blink-cursor-mode):
* help.el (temp-buffer-resize-mode):
* hilit-chg.el (highlight-changes-mode)
(highlight-changes-visible-mode):
* hi-lock.el (hi-lock-mode):
* hl-line.el (hl-line-mode, global-hl-line-mode):
* icomplete.el (icomplete-mode):
* ido.el (ido-everywhere):
* image-file.el (auto-image-file-mode):
* image-mode.el (image-minor-mode):
* iswitchb.el (iswitchb-mode):
* jka-cmpr-hook.el (auto-compression-mode):
* linum.el (linum-mode):
* longlines.el (longlines-mode):
* master.el (master-mode):
* mb-depth.el (minibuffer-depth-indicate-mode):
* menu-bar.el (menu-bar-mode):
* minibuf-eldef.el (minibuffer-electric-default-mode):
* mouse-sel.el (mouse-sel-mode):
* msb.el (msb-mode):
* mwheel.el (mouse-wheel-mode):
* outline.el (outline-minor-mode):
* paren.el (show-paren-mode):
* recentf.el (recentf-mode):
* reveal.el (reveal-mode, global-reveal-mode):
* rfn-eshadow.el (file-name-shadow-mode):
* ruler-mode.el (ruler-mode):
* savehist.el (savehist-mode):
* scroll-all.el (scroll-all-mode):
* scroll-bar.el (scroll-bar-mode):
* server.el (server-mode):
* shell.el (shell-dirtrack-mode):
* simple.el (auto-fill-mode, transient-mark-mode)
(visual-line-mode, overwrite-mode, binary-overwrite-mode)
(line-number-mode, column-number-mode, size-indication-mode)
(auto-save-mode, normal-erase-is-backspace-mode, visible-mode):
* strokes.el (strokes-mode):
* time.el (display-time-mode):
* t-mouse.el (gpm-mouse-mode):
* tool-bar.el (tool-bar-mode):
* tooltip.el (tooltip-mode):
* type-break.el (type-break-mode-line-message-mode)
(type-break-query-mode):
* view.el (view-mode):
* whitespace.el (whitespace-mode, whitespace-newline-mode)
(global-whitespace-mode, global-whitespace-newline-mode):
* xt-mouse.el (xterm-mouse-mode): Doc fix.
* emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Fix
autogenerated docstring.
2011-10-19 12:54:24 +00:00
|
|
|
|
"Toggle cursor blinking (Blink Cursor mode).
|
|
|
|
|
|
2014-04-13 07:49:23 +00:00
|
|
|
|
If the value of `blink-cursor-blinks' is positive (10 by default),
|
|
|
|
|
the cursor stops blinking after that number of blinks, if Emacs
|
|
|
|
|
gets no input during that time.
|
|
|
|
|
|
|
|
|
|
See also `blink-cursor-interval' and `blink-cursor-delay'.
|
|
|
|
|
|
Fix minor mode docstrings for the new meaning of a nil ARG.
* abbrev.el (abbrev-mode):
* allout.el (allout-mode):
* autoinsert.el (auto-insert-mode):
* autoarg.el (autoarg-mode, autoarg-kp-mode):
* autorevert.el (auto-revert-mode, auto-revert-tail-mode)
(global-auto-revert-mode):
* battery.el (display-battery-mode):
* composite.el (global-auto-composition-mode)
(auto-composition-mode):
* delsel.el (delete-selection-mode):
* desktop.el (desktop-save-mode):
* dired-x.el (dired-omit-mode):
* dirtrack.el (dirtrack-mode):
* doc-view.el (doc-view-minor-mode):
* double.el (double-mode):
* electric.el (electric-indent-mode, electric-pair-mode):
* emacs-lock.el (emacs-lock-mode):
* epa-hook.el (auto-encryption-mode):
* follow.el (follow-mode):
* font-core.el (font-lock-mode):
* frame.el (auto-raise-mode, auto-lower-mode, blink-cursor-mode):
* help.el (temp-buffer-resize-mode):
* hilit-chg.el (highlight-changes-mode)
(highlight-changes-visible-mode):
* hi-lock.el (hi-lock-mode):
* hl-line.el (hl-line-mode, global-hl-line-mode):
* icomplete.el (icomplete-mode):
* ido.el (ido-everywhere):
* image-file.el (auto-image-file-mode):
* image-mode.el (image-minor-mode):
* iswitchb.el (iswitchb-mode):
* jka-cmpr-hook.el (auto-compression-mode):
* linum.el (linum-mode):
* longlines.el (longlines-mode):
* master.el (master-mode):
* mb-depth.el (minibuffer-depth-indicate-mode):
* menu-bar.el (menu-bar-mode):
* minibuf-eldef.el (minibuffer-electric-default-mode):
* mouse-sel.el (mouse-sel-mode):
* msb.el (msb-mode):
* mwheel.el (mouse-wheel-mode):
* outline.el (outline-minor-mode):
* paren.el (show-paren-mode):
* recentf.el (recentf-mode):
* reveal.el (reveal-mode, global-reveal-mode):
* rfn-eshadow.el (file-name-shadow-mode):
* ruler-mode.el (ruler-mode):
* savehist.el (savehist-mode):
* scroll-all.el (scroll-all-mode):
* scroll-bar.el (scroll-bar-mode):
* server.el (server-mode):
* shell.el (shell-dirtrack-mode):
* simple.el (auto-fill-mode, transient-mark-mode)
(visual-line-mode, overwrite-mode, binary-overwrite-mode)
(line-number-mode, column-number-mode, size-indication-mode)
(auto-save-mode, normal-erase-is-backspace-mode, visible-mode):
* strokes.el (strokes-mode):
* time.el (display-time-mode):
* t-mouse.el (gpm-mouse-mode):
* tool-bar.el (tool-bar-mode):
* tooltip.el (tooltip-mode):
* type-break.el (type-break-mode-line-message-mode)
(type-break-query-mode):
* view.el (view-mode):
* whitespace.el (whitespace-mode, whitespace-newline-mode)
(global-whitespace-mode, global-whitespace-newline-mode):
* xt-mouse.el (xterm-mouse-mode): Doc fix.
* emacs-lisp/easy-mmode.el (define-globalized-minor-mode): Fix
autogenerated docstring.
2011-10-19 12:54:24 +00:00
|
|
|
|
This command is effective only on graphical frames. On text-only
|
|
|
|
|
terminals, cursor blinking is controlled by the terminal."
|
2006-08-22 01:35:45 +00:00
|
|
|
|
:init-value (not (or noninteractive
|
|
|
|
|
no-blinking-cursor
|
2021-01-19 17:10:48 +00:00
|
|
|
|
(eq system-type 'ms-dos)))
|
|
|
|
|
:initialize #'custom-initialize-delay
|
2006-08-22 01:35:45 +00:00
|
|
|
|
:group 'cursor
|
|
|
|
|
:global t
|
2014-05-18 12:58:30 +00:00
|
|
|
|
(blink-cursor-suspend)
|
2018-06-11 23:54:23 +00:00
|
|
|
|
(remove-hook 'after-delete-frame-functions #'blink-cursor--rescan-frames)
|
2018-06-11 23:08:29 +00:00
|
|
|
|
(remove-function after-focus-change-function #'blink-cursor--rescan-frames)
|
2006-08-22 01:35:45 +00:00
|
|
|
|
(when blink-cursor-mode
|
2021-01-19 17:10:48 +00:00
|
|
|
|
(add-function :after after-focus-change-function
|
|
|
|
|
#'blink-cursor--rescan-frames)
|
2018-06-11 23:54:23 +00:00
|
|
|
|
(add-hook 'after-delete-frame-functions #'blink-cursor--rescan-frames)
|
2021-01-16 04:18:08 +00:00
|
|
|
|
(blink-cursor-check)))
|
2016-09-10 08:16:32 +00:00
|
|
|
|
|
2012-12-12 14:43:45 +00:00
|
|
|
|
|
2012-12-27 20:09:45 +00:00
|
|
|
|
;; Frame maximization/fullscreen
|
2012-12-12 14:43:45 +00:00
|
|
|
|
|
2018-01-11 22:14:35 +00:00
|
|
|
|
(defun toggle-frame-maximized (&optional frame)
|
|
|
|
|
"Toggle maximization state of FRAME.
|
2015-02-11 08:07:24 +00:00
|
|
|
|
Maximize selected frame or un-maximize if it is already maximized.
|
|
|
|
|
|
|
|
|
|
If the frame is in fullscreen state, don't change its state, but
|
|
|
|
|
set the frame's `fullscreen-restore' parameter to `maximized', so
|
|
|
|
|
the frame will be maximized after disabling fullscreen state.
|
2014-10-03 09:18:49 +00:00
|
|
|
|
|
|
|
|
|
Note that with some window managers you may have to set
|
|
|
|
|
`frame-resize-pixelwise' to non-nil in order to make a frame
|
2015-02-11 08:07:24 +00:00
|
|
|
|
appear truly maximized. In addition, you may have to set
|
|
|
|
|
`x-frame-normalize-before-maximize' in order to enable
|
|
|
|
|
transitions from one fullscreen state to another.
|
2014-10-03 09:18:49 +00:00
|
|
|
|
|
2012-12-27 20:09:45 +00:00
|
|
|
|
See also `toggle-frame-fullscreen'."
|
2012-12-12 14:43:45 +00:00
|
|
|
|
(interactive)
|
2018-01-11 22:14:35 +00:00
|
|
|
|
(let ((fullscreen (frame-parameter frame 'fullscreen)))
|
2015-02-11 08:07:24 +00:00
|
|
|
|
(cond
|
|
|
|
|
((memq fullscreen '(fullscreen fullboth))
|
2018-01-11 22:14:35 +00:00
|
|
|
|
(set-frame-parameter frame 'fullscreen-restore 'maximized))
|
2015-02-11 08:07:24 +00:00
|
|
|
|
((eq fullscreen 'maximized)
|
2018-01-11 22:14:35 +00:00
|
|
|
|
(set-frame-parameter frame 'fullscreen nil))
|
2015-02-11 08:07:24 +00:00
|
|
|
|
(t
|
2018-01-11 22:14:35 +00:00
|
|
|
|
(set-frame-parameter frame 'fullscreen 'maximized)))))
|
2012-12-27 20:09:45 +00:00
|
|
|
|
|
2018-01-11 22:14:35 +00:00
|
|
|
|
(defun toggle-frame-fullscreen (&optional frame)
|
|
|
|
|
"Toggle fullscreen state of FRAME.
|
|
|
|
|
Make selected frame fullscreen or restore its previous size
|
|
|
|
|
if it is already fullscreen.
|
2015-02-11 08:07:24 +00:00
|
|
|
|
|
|
|
|
|
Before making the frame fullscreen remember the current value of
|
|
|
|
|
the frame's `fullscreen' parameter in the `fullscreen-restore'
|
|
|
|
|
parameter of the frame. That value is used to restore the
|
2015-02-11 10:02:03 +00:00
|
|
|
|
frame's fullscreen state when toggling fullscreen the next time.
|
2014-10-03 09:18:49 +00:00
|
|
|
|
|
|
|
|
|
Note that with some window managers you may have to set
|
|
|
|
|
`frame-resize-pixelwise' to non-nil in order to make a frame
|
2015-02-11 08:07:24 +00:00
|
|
|
|
appear truly fullscreen. In addition, you may have to set
|
|
|
|
|
`x-frame-normalize-before-maximize' in order to enable
|
|
|
|
|
transitions from one fullscreen state to another.
|
2014-10-03 09:18:49 +00:00
|
|
|
|
|
2012-12-12 14:43:45 +00:00
|
|
|
|
See also `toggle-frame-maximized'."
|
|
|
|
|
(interactive)
|
2018-01-11 22:14:35 +00:00
|
|
|
|
(let ((fullscreen (frame-parameter frame 'fullscreen)))
|
2015-02-11 08:07:24 +00:00
|
|
|
|
(if (memq fullscreen '(fullscreen fullboth))
|
2018-01-11 22:14:35 +00:00
|
|
|
|
(let ((fullscreen-restore (frame-parameter frame 'fullscreen-restore)))
|
2015-02-11 08:07:24 +00:00
|
|
|
|
(if (memq fullscreen-restore '(maximized fullheight fullwidth))
|
2018-01-11 22:14:35 +00:00
|
|
|
|
(set-frame-parameter frame 'fullscreen fullscreen-restore)
|
|
|
|
|
(set-frame-parameter frame 'fullscreen nil)))
|
2015-02-11 08:07:24 +00:00
|
|
|
|
(modify-frame-parameters
|
2020-03-10 08:14:59 +00:00
|
|
|
|
frame `((fullscreen . fullboth) (fullscreen-restore . ,fullscreen))))))
|
2018-01-11 22:14:35 +00:00
|
|
|
|
|
1991-08-15 21:29:06 +00:00
|
|
|
|
|
|
|
|
|
;;;; Key bindings
|
|
|
|
|
|
2021-04-12 16:32:07 +00:00
|
|
|
|
(define-key ctl-x-5-map "2" #'make-frame-command)
|
|
|
|
|
(define-key ctl-x-5-map "1" #'delete-other-frames)
|
|
|
|
|
(define-key ctl-x-5-map "0" #'delete-frame)
|
|
|
|
|
(define-key ctl-x-5-map "o" #'other-frame)
|
|
|
|
|
(define-key ctl-x-5-map "5" #'other-frame-prefix)
|
2021-09-01 09:42:48 +00:00
|
|
|
|
(define-key ctl-x-5-map "c" #'clone-frame)
|
2021-04-12 16:32:07 +00:00
|
|
|
|
(define-key global-map [f11] #'toggle-frame-fullscreen)
|
|
|
|
|
(define-key global-map [(meta f10)] #'toggle-frame-maximized)
|
|
|
|
|
(define-key esc-map [f10] #'toggle-frame-maximized)
|
1992-03-16 20:39:07 +00:00
|
|
|
|
|
2012-04-15 15:15:00 +00:00
|
|
|
|
|
|
|
|
|
;; Misc.
|
|
|
|
|
|
2012-08-15 16:29:11 +00:00
|
|
|
|
;; Only marked as obsolete in 24.3.
|
2012-05-13 03:05:06 +00:00
|
|
|
|
(define-obsolete-variable-alias 'automatic-hscrolling
|
|
|
|
|
'auto-hscroll-mode "22.1")
|
2012-04-15 15:15:00 +00:00
|
|
|
|
|
|
|
|
|
(make-variable-buffer-local 'show-trailing-whitespace)
|
|
|
|
|
|
2012-09-06 09:29:32 +00:00
|
|
|
|
;; Defined in dispnew.c.
|
|
|
|
|
(make-obsolete-variable
|
|
|
|
|
'window-system-version "it does not give useful information." "24.3")
|
|
|
|
|
|
2021-03-16 00:29:28 +00:00
|
|
|
|
(defun set-frame-property--interactive (prompt number)
|
|
|
|
|
"Get a value for `set-frame-width' or `set-frame-height', prompting with PROMPT.
|
|
|
|
|
Offer NUMBER as default value, if it is a natural number."
|
|
|
|
|
(if (and current-prefix-arg (not (consp current-prefix-arg)))
|
|
|
|
|
(list (selected-frame) (prefix-numeric-value current-prefix-arg))
|
|
|
|
|
(let ((default (and (natnump number) number)))
|
2021-03-16 18:03:55 +00:00
|
|
|
|
(list (selected-frame) (read-number prompt default)))))
|
2021-03-16 00:29:28 +00:00
|
|
|
|
|
2017-07-08 08:08:55 +00:00
|
|
|
|
;; Variables whose change of value should trigger redisplay of the
|
|
|
|
|
;; current buffer.
|
|
|
|
|
;; To test whether a given variable needs to be added to this list,
|
|
|
|
|
;; write a simple interactive function that changes the variable's
|
|
|
|
|
;; value and bind that function to a simple key, like F5. If typing
|
|
|
|
|
;; F5 then produces the correct effect, the variable doesn't need
|
|
|
|
|
;; to be in this list; otherwise, it does.
|
2015-11-07 13:32:45 +00:00
|
|
|
|
(mapc (lambda (var)
|
2018-06-01 12:34:30 +00:00
|
|
|
|
;; Using symbol-function here tells the watcher machinery to
|
|
|
|
|
;; call the C function set-buffer-redisplay directly, thus
|
2019-06-25 22:57:30 +00:00
|
|
|
|
;; avoiding a potential GC. This isn't strictly necessary,
|
|
|
|
|
;; but it's a nice way to exercise the direct subr-calling
|
|
|
|
|
;; machinery.
|
2015-11-21 22:02:42 +00:00
|
|
|
|
(add-variable-watcher var (symbol-function 'set-buffer-redisplay)))
|
2015-11-06 19:21:52 +00:00
|
|
|
|
'(line-spacing
|
|
|
|
|
overline-margin
|
|
|
|
|
line-prefix
|
2015-11-13 09:56:08 +00:00
|
|
|
|
wrap-prefix
|
2016-01-04 17:08:37 +00:00
|
|
|
|
truncate-lines
|
Fix redisplay when mode-line-format changes mode-line's height
* lisp/frame.el (top-level): Add mode-line-format,
tab-line-format, and header-line-format to the list of variables
that should trigger an immediate redisplay of the buffer's
window. This fixes redisplay of windows when the mode line
changes its height.
* src/xdisp.c (window_box_height): Use the window's
mode_line_height, tab_line_height, and header_line_height fields
in preference to CURRENT_MODE_LINE_HEIGHT,
CURRENT_TAB_LINE_HEIGHT, and CURRENT_HEADER_LINE_HEIGHT,
respectively. This fixes display of vertical scroll bar when the
height of the window's mode line changes.
* src/dispnew.c (adjust_glyph_matrix): When resizing a window's
matrix, reset the mode_line_p flag of the previous mode-line row,
so that the window_box_height, CURRENT_MODE_LINE_HEIGHT, and their
ilk won't use stale info. (Bug#38828)
2020-01-03 07:28:35 +00:00
|
|
|
|
mode-line-format
|
|
|
|
|
header-line-format
|
|
|
|
|
tab-line-format
|
2017-06-24 09:37:30 +00:00
|
|
|
|
display-line-numbers
|
2017-07-12 15:35:31 +00:00
|
|
|
|
display-line-numbers-width
|
2017-07-06 17:22:16 +00:00
|
|
|
|
display-line-numbers-current-absolute
|
|
|
|
|
display-line-numbers-widen
|
2019-10-06 18:53:18 +00:00
|
|
|
|
display-line-numbers-major-tick
|
|
|
|
|
display-line-numbers-minor-tick
|
2019-10-09 10:49:39 +00:00
|
|
|
|
display-line-numbers-offset
|
2019-03-12 19:06:28 +00:00
|
|
|
|
display-fill-column-indicator
|
|
|
|
|
display-fill-column-indicator-column
|
|
|
|
|
display-fill-column-indicator-character
|
2015-11-13 09:56:08 +00:00
|
|
|
|
bidi-paragraph-direction
|
2019-11-28 15:00:33 +00:00
|
|
|
|
bidi-display-reordering
|
|
|
|
|
bidi-inhibit-bpa))
|
2015-11-06 19:21:52 +00:00
|
|
|
|
|
1992-07-15 00:32:19 +00:00
|
|
|
|
(provide 'frame)
|
1992-05-30 21:11:25 +00:00
|
|
|
|
|
1992-07-15 00:32:19 +00:00
|
|
|
|
;;; frame.el ends here
|