bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#66141: 29.1; Window size properties not set immediately for window i


From: Mattias Nyrell
Subject: bug#66141: 29.1; Window size properties not set immediately for window in new frame
Date: Fri, 22 Sep 2023 08:47:02 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1


On 2023-09-21 21:04, Mattias Nyrell wrote:


On 2023-09-21 20:51, Eli Zaretskii wrote:
[Please use Reply All to reply, to keep the bug tracer CC'ed.]

Date: Thu, 21 Sep 2023 20:48:19 +0200
From: Mattias Nyrell <mattias@nyrell.se>



On 2023-09-21 18:39, Eli Zaretskii wrote:
Date: Thu, 21 Sep 2023 18:16:01 +0200
From: Mattias Nyrell <mattias@nyrell.se>

Starting from emacs -Q, enter the following in *scratch*:

(let ((f (make-frame '((fullscreen . maximized)))))
     (select-frame-set-input-focus f)
     (message "window-body-width=%s" (window-body-width))
     (sleep-for 1)
     (message "window-body-width=%s" (window-body-width)) )

Execute with C-x C-e

Result:
- A new frame is created.
- The message "window-body-width=80" is printed
- The message "window-body-width=190" is printed (exact value depending
on screen size of course)

Expected result:
The first printed message should be the same as the second printed message.
Isn't it because the actual resizing of the frame is done by the
window-system, and we can only ask it to do so?

IOW, I think your expectation is incorrect, as it assumes that frame
move/resize operations are executed immediately.
I have no idea, but your explanation sounds very reasonable and it is
probably right!

Is there a way to get notified when the resize operation has finished?
Or is sleeping for a short while a reasonable solution?
Yes, calling sleep-for is one way.  I would also suggest to try

   (sit-for 0)

If that works, it is faster.
Ok, thank you!

/Mattias

I tried (sit-for 0) and even (sit-for 5), but none of those worked.

(sleep-for 0.1) or (sleep-for 0) worked for me.

/Mattias






reply via email to

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