From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Spencer Baugh Newsgroups: gmane.emacs.bugs Subject: bug#62164: 29.0.60; ediff behaves poorly by default on tiling window managers Date: Tue, 27 Jun 2023 21:13:09 -0400 Message-ID: References: <87cz5c87xg.fsf@yahoo.com> <878rg087v5.fsf@yahoo.com> <87a60c3zuc.fsf@yahoo.com> <871ql3nj6y.fsf@catern.com> <871ql2su9q.fsf@yahoo.com> <87v8iemsbh.fsf@catern.com> <83ild19uzd.fsf@gnu.org> <83y1kw3k3d.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14368"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: luangruo@yahoo.com, sbaugh@catern.com, 62164@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 28 03:14:23 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qEJlG-0003ZN-Tw for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 28 Jun 2023 03:14:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qEJky-0002si-Of; Tue, 27 Jun 2023 21:14:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qEJkw-0002ru-SI for bug-gnu-emacs@gnu.org; Tue, 27 Jun 2023 21:14:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qEJkw-0001RU-KI for bug-gnu-emacs@gnu.org; Tue, 27 Jun 2023 21:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qEJkv-0001cY-TM for bug-gnu-emacs@gnu.org; Tue, 27 Jun 2023 21:14:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Spencer Baugh Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 28 Jun 2023 01:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62164 X-GNU-PR-Package: emacs Original-Received: via spool by 62164-submit@debbugs.gnu.org id=B62164.16879147996171 (code B ref 62164); Wed, 28 Jun 2023 01:14:01 +0000 Original-Received: (at 62164) by debbugs.gnu.org; 28 Jun 2023 01:13:19 +0000 Original-Received: from localhost ([127.0.0.1]:49738 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEJkE-0001bT-Od for submit@debbugs.gnu.org; Tue, 27 Jun 2023 21:13:19 -0400 Original-Received: from mxout6.mail.janestreet.com ([64.215.233.21]:38763) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qEJkA-0001bA-FP for 62164@debbugs.gnu.org; Tue, 27 Jun 2023 21:13:18 -0400 In-Reply-To: <83y1kw3k3d.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 06 Jun 2023 14:29:10 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:264187 Archived-At: --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> From: Spencer Baugh >> Cc: luangruo@yahoo.com, sbaugh@catern.com, 62164@debbugs.gnu.org >> Date: Mon, 05 Jun 2023 17:56:38 -0400 >> >> Eli Zaretskii writes: >> >> Cc: Po Lu , 62164@debbugs.gnu.org >> >> From: Spencer Baugh >> >> Date: Tue, 09 May 2023 14:27:11 -0400 >> >> >> >> +(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." >> > >> > If this option causes the control frame to be floating rather than >> > tiled, the name of the option should reflect that. Using "utility" in >> > the name of the variable makes the option less self-explanatory, >> > because that technical terms is not relevant on the user level. >> > >> > Thanks. >> >> Agreed. Revised patch attached: > > Thanks, but I think the first line of the doc string should also be > modified to explain better what the option does. The rest of the doc > string could then mention "utility window", if doing so will help > someone to understand what happens and why. But the first line should > be a concise summary, because the various apropos commands show only > that one line. > >> (modify-frame-parameters ctl-frame adjusted-parameters) >> + (when (and ediff-x-floating-control-frame (eq window-system 'x)) >> + (ediff-frame-make-utility ctl-frame)) ^^^^^^^^^^^^^ > > I think it is better to use window-system the function here, since > you are talking about a specific frame. OK, revised patch attached. I don't know how to name the variable to incorporate both you and Po's feedback. The name of the variable can either include "utility" to describe its implementation, or include "floating" to describe its effect on most window managers. (Or include neither, and describe nothing, which seems worse.) I personally prefer your variable name, since I still don't know of any window managers that don't float utility windows, but I don't care much. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Allow-setting-the-ediff-control-frame-as-a-utility-w.patch >From b8f893709f914b483997791507ee2db888bb9279 Mon Sep 17 00:00:00 2001 From: Spencer Baugh 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 | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lisp/vc/ediff-wind.el b/lisp/vc/ediff-wind.el index eb903f093f9..7471c5f0fd3 100644 --- a/lisp/vc/ediff-wind.el +++ b/lisp/vc/ediff-wind.el @@ -69,6 +69,17 @@ ediff-window-setup-function (function :tag "Other function")) :version "24.3") +(defcustom ediff-x-floating-control-frame nil + "If non-nil, the control frame will float under most X WMs. + +The control frame will be give the window type \"utility\". On +most tiling window managers, 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 floats" t) + (const :tag "Control frame has default WM behavior" nil)) + :version "30.1") + (ediff-defvar-local ediff-multiframe nil "Indicates if we are in a multiframe setup.") @@ -873,6 +884,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 +969,8 @@ ediff-setup-control-frame (goto-char (point-min)) (modify-frame-parameters ctl-frame adjusted-parameters) + (when (and ediff-x-floating-control-frame (eq (window-system ctl-frame) '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.39.3 --=-=-=--