diff options
| author | Spencer Baugh | 2023-04-07 17:54:06 -0400 |
|---|---|---|
| committer | Eli Zaretskii | 2023-07-06 10:45:59 +0300 |
| commit | e02d0b554e70b8e2170c8eb4411608ef54e7de1d (patch) | |
| tree | 98d47e4acea2ae3fea755c7fab5145a23583c051 | |
| parent | ea845e3fcd1d784c2f86595ff43f3fb37fd081ef (diff) | |
| download | emacs-e02d0b554e70b8e2170c8eb4411608ef54e7de1d.tar.gz emacs-e02d0b554e70b8e2170c8eb4411608ef54e7de1d.zip | |
Allow floating the ediff control frame under X
This is a step in the direction of making ediff behave better by
default under tiling window managers and fixing Bug#62164.
* lisp/vc/ediff-wind.el (ediff-floating-control-frame): Add
defcustom.
(ediff-frame-make-utility, ediff-setup-control-frame): Allow setting
the control frame up as a utility window under X. (Bug#62164)
| -rw-r--r-- | lisp/vc/ediff-wind.el | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lisp/vc/ediff-wind.el b/lisp/vc/ediff-wind.el index eb903f093f9..3077c562d63 100644 --- a/lisp/vc/ediff-wind.el +++ b/lisp/vc/ediff-wind.el | |||
| @@ -69,6 +69,16 @@ provided functions are written." | |||
| 69 | (function :tag "Other function")) | 69 | (function :tag "Other function")) |
| 70 | :version "24.3") | 70 | :version "24.3") |
| 71 | 71 | ||
| 72 | (defcustom ediff-floating-control-frame nil | ||
| 73 | "If non-nil, try making the control frame be floating rather than tiled. | ||
| 74 | |||
| 75 | If your X window manager makes the Ediff control frame a tiled one, | ||
| 76 | set this to a non-nil value, and Emacs will try to make it floating. | ||
| 77 | This only has effect on X displays." | ||
| 78 | :type '(choice (const :tag "Control frame floats" t) | ||
| 79 | (const :tag "Control frame has default WM behavior" nil)) | ||
| 80 | :version "30.1") | ||
| 81 | |||
| 72 | (ediff-defvar-local ediff-multiframe nil | 82 | (ediff-defvar-local ediff-multiframe nil |
| 73 | "Indicates if we are in a multiframe setup.") | 83 | "Indicates if we are in a multiframe setup.") |
| 74 | 84 | ||
| @@ -873,6 +883,16 @@ Create a new splittable frame if none is found." | |||
| 873 | (not (ediff-frame-has-dedicated-windows (window-frame wind))) | 883 | (not (ediff-frame-has-dedicated-windows (window-frame wind))) |
| 874 | ))) | 884 | ))) |
| 875 | 885 | ||
| 886 | (defun ediff-frame-make-utility (frame) | ||
| 887 | (let ((x-fast-protocol-requests t)) | ||
| 888 | (x-change-window-property | ||
| 889 | "_NET_WM_WINDOW_TYPE" '("_NET_WM_WINDOW_TYPE_UTILITY") | ||
| 890 | frame "ATOM" 32 t) | ||
| 891 | (x-change-window-property | ||
| 892 | "WM_TRANSIENT_FOR" | ||
| 893 | (list (string-to-number (frame-parameter nil 'window-id))) | ||
| 894 | frame "WINDOW" 32 t))) | ||
| 895 | |||
| 876 | ;; Prepare or refresh control frame | 896 | ;; Prepare or refresh control frame |
| 877 | (defun ediff-setup-control-frame (ctl-buffer designated-minibuffer-frame) | 897 | (defun ediff-setup-control-frame (ctl-buffer designated-minibuffer-frame) |
| 878 | (let ((window-min-height 1) | 898 | (let ((window-min-height 1) |
| @@ -948,6 +968,8 @@ Create a new splittable frame if none is found." | |||
| 948 | (goto-char (point-min)) | 968 | (goto-char (point-min)) |
| 949 | 969 | ||
| 950 | (modify-frame-parameters ctl-frame adjusted-parameters) | 970 | (modify-frame-parameters ctl-frame adjusted-parameters) |
| 971 | (when (and ediff-floating-control-frame (eq (window-system ctl-frame) 'x)) | ||
| 972 | (ediff-frame-make-utility ctl-frame)) | ||
| 951 | (make-frame-visible ctl-frame) | 973 | (make-frame-visible ctl-frame) |
| 952 | 974 | ||
| 953 | ;; This works around a bug in 19.25 and earlier. There, if frame gets | 975 | ;; This works around a bug in 19.25 and earlier. There, if frame gets |