[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs's set-frame-size can not work well with gnome-shell?

From: martin rudalics
Subject: Re: Emacs's set-frame-size can not work well with gnome-shell?
Date: Fri, 21 Feb 2020 17:08:04 +0100

>>> Did you set 'x-resize-child-frame-special' to t?
>> I... no. I only changed the value of this variable (locally or globally) 
after the frame was created.
> Sorry, the email got sent too fast.
> Resizing indeed works if this variable is set to t before the frame is
> created.

My bad.  I should have explained it better.

> One problem is that the initial width and height are 2x the specified
> (probably scaling at fault).

With the patch applied and 'x-resize-child-frame-special' non-nil
'x-create-frame' asks for an initial frame size of 1000x1000 pixels

  if (FRAME_PARENT_FRAME (f) && x_resize_child_frame_special)
    adjust_frame_size (f, 1000, 1000, 0, true, Qx_create_frame_2);

So what you see could be the 1000 (2000 scaled?) pixels from that call.
You could try with other values instead of 1000 so we can tell whether
that call has any visible impact.  It's possible that the WM rejects too
large values, for example, because they would exceed the initial size of
the parent frame (insanely large values can make Emacs even crash here).

And always keep in mind that all this is a crazy hack that tries to
second-guess what the WM (or GTK) might do.  I've nowhere in their code
seen the slightest evidence for such behavior.

> Otherwise, it seems to work OK is the test scenario. Not so ideal in
> "production": it seems company-posframe still fails to change the
> width (!) when height is kept unchanged. And when that happens, the
> expected extra area (when we're enlarging the frame, but seemingly
> fail) is apparently where Emacs and the WM disagree (clicks don't do
> through).

Did you use 'set-frame-width' to change it?  Does it also fail to shrink
the width or only to enlarge it?

In either case I attach a patch that now tries to make the second
adjust_frame_size call apply the initially requested sizes but I'm
afraid that it will not produce anything useful.


Attachment: x-resize-child-frame-special.diff
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]