all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Mattias Nyrell <mattias@nyrell.se>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 66141@debbugs.gnu.org
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	[thread overview]
Message-ID: <0ace9d7d-8a01-d0b8-f290-0e2ee2241246@nyrell.se> (raw)
In-Reply-To: <79870529-9459-5ed9-3d90-18f449efc838@nyrell.se>


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	other threads:[~2023-09-22  6:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-21 16:16 bug#66141: 29.1; Window size properties not set immediately for window in new frame Mattias Nyrell
2023-09-21 16:39 ` Eli Zaretskii
     [not found]   ` <dd7c9d58-3adf-7669-a071-5db6f619e268@nyrell.se>
2023-09-21 18:51     ` Eli Zaretskii
2023-09-21 19:04       ` Mattias Nyrell
2023-09-22  6:47         ` Mattias Nyrell [this message]
2023-09-22  6:58           ` Eli Zaretskii
2023-09-22  7:23             ` Mattias Nyrell
2023-09-22 11:07               ` Eli Zaretskii

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0ace9d7d-8a01-d0b8-f290-0e2ee2241246@nyrell.se \
    --to=mattias@nyrell.se \
    --cc=66141@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.