Subject: Re: bug#62164: 29.0.60; ediff behaves poorly by default on tiling window managers

From: Spencer Baugh <[email-masked]>
Date: Thu, 16 Mar 2023 11:07:21 -0400

On Mon, Mar 13, 2023 at 8:59 PM Po Lu <[email-masked]> wrote:
> Spencer Baugh <[email-masked]> writes:
> > ediff defaults to a multiframe UI on graphical displays.  If the user is
> > running a tiling window manager on X, the control panel frame gets tiled
> > and the whole thing becomes either very ugly or unusable.
> >
> > This is a very long-standing bug, but it should be fixed.  Most tiling
> > window manager users work around this with:
> >
> > (setq ediff-window-setup-function 'ediff-setup-windows-plain)
> >
> > But I would rather the multiframe UI just work correctly by default.
>
> Maybe such users could be taught to make the utility window
> override-redirect instead.
>
> > On X, perhaps we should set _NET_WM_WINDOW_TYPE to
> > _NET_WM_WINDOW_TYPE_UTILITY for the ediff control panel frame, so that
> > tiling window managers float the control panel frame frame by default.
> > This would probably need to be a new frame parameter specific to X.  I
> > can try to make that change if that seems reasonable.  (This would also
> > be useful for allowing other packages to have multiframe UI modes.)
>
> The ediff control frame is not a utility frame because you are supposed
> to type in it.

When in multi-window mode, Gimp displays its toolbar as a utility
window, and you are supposed to type in that.  If Gimp does it, surely
we can do it.

> One window manager which extensively uses keyboard navigation (I'm not
> sure I remember which) applies the No Input focus model to
> _NET_WM_WINDOW_TYPE_UTILITY, not letting you type in such toplevel
> windows.

Does it do this even if the Input hint is set in WMHints?  If so,
isn't that window manager just plain broken?  Gimp's toolbar would
also be broken on that WM.  If Gimp isn't hacking around this broken
window manager, I don't think we should either.

(That argument suffices on its own, but as an extra point, keep in
mind that if this broken WM is a tiling window manager, the ediff
experience is *already* broken-by-default on that WM)

> 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.

So, we need a new frame parameter so that we can set the window type
at the time of creating the frame.  Unless there's some existing way
to set a window property for a new frame at creation time?