unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: sbaugh@catern.com
To: Po Lu <luangruo@yahoo.com>
Cc: Spencer Baugh <sbaugh@janestreet.com>, 62164@debbugs.gnu.org
Subject: bug#62164: 29.0.60; ediff behaves poorly by default on tiling window managers
Date: Sun, 02 Apr 2023 01:53:26 +0000 (UTC)	[thread overview]
Message-ID: <871ql3nj6y.fsf@catern.com> (raw)
In-Reply-To: <87a60c3zuc.fsf@yahoo.com> (Po Lu's message of "Fri, 17 Mar 2023 09:56:27 +0800")

Po Lu <luangruo@yahoo.com> writes:
> Spencer Baugh <sbaugh@janestreet.com> writes:
>> On Mon, Mar 13, 2023 at 8:59 PM Po Lu <luangruo@yahoo.com> wrote:
>>> BTW, `x-change-window-property' lets you mess around with window
>>> properties if you want.  No frame parameter needed.
>>
>> AFAICT, my tiling window manager (XMonad) makes its tiling vs floating
>> decision when the window is first created, so changing the window
>> property after the fact doesn't help.  I assume most tiling window
>> managers behave the same.
>
> You can withdraw the window prior to mapping it: see
> `make-frame-visible' and `make-frame-invisible'.
>
> Window managers don't care about a window until it is mapped.

Thank you for this.  With that I was able to put together this simple
patch which makes the ediff control window float by default on tiling
window managers, or at least on most of them.

What do you think about this patch?  It would be really nice to have
this behavior by default in this way, and I think it would benefit many
users.

diff --git a/lisp/vc/ediff-wind.el b/lisp/vc/ediff-wind.el
index eb903f093f9..1a09bc4225e 100644
--- a/lisp/vc/ediff-wind.el
+++ b/lisp/vc/ediff-wind.el
@@ -948,6 +948,19 @@ ediff-setup-control-frame
     (goto-char (point-min))
 
     (modify-frame-parameters ctl-frame adjusted-parameters)
+    (if (eq window-system 'x)
+      (x-change-window-property
+       "_NET_WM_WINDOW_TYPE"
+       '("_NET_WM_WINDOW_TYPE_UTILITY")
+       ctl-frame
+       "ATOM" 32
+       t)
+      (x-change-window-property
+       "WM_TRANSIENT_FOR"
+       (list (string-to-number (frame-parameter nil 'window-id)))
+       ctl-frame
+       "WINDOW" 32
+       t))
     (make-frame-visible ctl-frame)
 
     ;; This works around a bug in 19.25 and earlier.  There, if frame gets
--





  reply	other threads:[~2023-04-02  1:53 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 [this message]
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
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=871ql3nj6y.fsf@catern.com \
    --to=sbaugh@catern.com \
    --cc=62164@debbugs.gnu.org \
    --cc=luangruo@yahoo.com \
    --cc=sbaugh@janestreet.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).