unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Spencer Baugh <sbaugh@janestreet.com>
To: sbaugh@catern.com
Cc: Po Lu <luangruo@yahoo.com>, 62164@debbugs.gnu.org
Subject: bug#62164: 29.0.60; ediff behaves poorly by default on tiling window managers
Date: Tue, 09 May 2023 14:27:11 -0400	[thread overview]
Message-ID: <ierfs85fji8.fsf@janestreet.com> (raw)
In-Reply-To: <87v8iemsbh.fsf@catern.com> (sbaugh@catern.com's message of "Sun,  02 Apr 2023 11:33:55 +0000 (UTC)")

[-- Attachment #1: Type: text/plain, Size: 99 bytes --]


Here's a patch which supports making the control frame into a utility
window with a user option.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Allow-setting-the-ediff-control-frame-as-a-utility-w.patch --]
[-- Type: text/x-patch, Size: 2456 bytes --]

From f23dc72acd370ace6fd934f46e1d6f9a72f943bf Mon Sep 17 00:00:00 2001
From: Spencer Baugh <sbaugh@janestreet.com>
Date: Tue, 9 May 2023 14:22:29 -0400
Subject: [PATCH] Allow setting the ediff control frame as a utility window
 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-x-utility-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)
---
 lisp/vc/ediff-wind.el | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/lisp/vc/ediff-wind.el b/lisp/vc/ediff-wind.el
index eb903f093f9..9eaed48f16c 100644
--- a/lisp/vc/ediff-wind.el
+++ b/lisp/vc/ediff-wind.el
@@ -69,6 +69,16 @@ ediff-window-setup-function
 		 (function :tag "Other function"))
   :version "24.3")
 
+(defcustom ediff-x-utility-control-frame nil
+  "If non-nil, the control frame is a utility window under X.
+
+This is useful in tiling window managers, where this will cause
+the control frame to be floating rather than tiled.  It should be
+harmless on other well-behaved window managers."
+  :type '(choice (const :tag "Control frame is utility window" t)
+                 (const :tag "Control frame is normal window" nil))
+  :version "30.1")
+
 (ediff-defvar-local ediff-multiframe nil
   "Indicates if we are in a multiframe setup.")
 
@@ -873,6 +883,16 @@ ediff-window-ok-for-display
     (not (ediff-frame-has-dedicated-windows (window-frame wind)))
     )))
 
+(defun ediff-frame-make-utility (frame)
+  (let ((x-fast-protocol-requests t))
+    (x-change-window-property
+     "_NET_WM_WINDOW_TYPE" '("_NET_WM_WINDOW_TYPE_UTILITY")
+     frame "ATOM" 32 t)
+    (x-change-window-property
+     "WM_TRANSIENT_FOR"
+     (list (string-to-number (frame-parameter nil 'window-id)))
+     frame "WINDOW" 32 t)))
+
 ;; Prepare or refresh control frame
 (defun ediff-setup-control-frame (ctl-buffer designated-minibuffer-frame)
   (let ((window-min-height 1)
@@ -948,6 +968,8 @@ ediff-setup-control-frame
     (goto-char (point-min))
 
     (modify-frame-parameters ctl-frame adjusted-parameters)
+    (when (and ediff-x-utility-control-frame (eq window-system 'x))
+      (ediff-frame-make-utility ctl-frame))
     (make-frame-visible ctl-frame)
 
     ;; This works around a bug in 19.25 and earlier.  There, if frame gets
-- 
2.30.2


  reply	other threads:[~2023-05-09 18:27 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-13 16:44 bug#62164: 29.0.60; ediff behaves poorly by default on tiling window managers Spencer Baugh
2023-03-14  0:59 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-14  1:00   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-16 15:07     ` Spencer Baugh
2023-03-17  1:56       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-02  1:53         ` sbaugh
2023-04-02  5:55           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-02 11:33             ` sbaugh
2023-05-09 18:27               ` Spencer Baugh [this message]
2023-05-09 19:15                 ` Eli Zaretskii
2023-06-05 21:56                   ` Spencer Baugh
2023-06-05 23:51                     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-06 11:29                     ` Eli Zaretskii
2023-06-28  1:13                       ` Spencer Baugh
2023-06-28  1:25                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-28 11:56                         ` Eli Zaretskii
2023-06-28 12:55                           ` Spencer Baugh
2023-06-28 13:40                             ` Robert Pluim
2023-07-03 19:21                               ` sbaugh
2023-07-06  7:51                                 ` Eli Zaretskii
2023-03-14  3:06   ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-14 13:13 ` Phil Sainty

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ierfs85fji8.fsf@janestreet.com \
    --to=sbaugh@janestreet.com \
    --cc=62164@debbugs.gnu.org \
    --cc=luangruo@yahoo.com \
    --cc=sbaugh@catern.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).