unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#58945: 29.0.50; Setting frame name in pgtk Emacs is asynchronous
@ 2022-11-01 14:58 Thibault Polge
  2022-11-03  0:31 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 3+ messages in thread
From: Thibault Polge @ 2022-11-01 14:58 UTC (permalink / raw)
  To: 58945

[-- Attachment #1: Type: text/plain, Size: 819 bytes --]

In pgtk Emacs (built from a very recent git HEAD), running under the
Sway window manager, setting a frame name like this:

(set-frame-parameter (selected-frame) 'name "Some new name")
(redisplay t)

Doesn't immediately take effect.

The example program below demonstrates this by triggering a race
condition: it renames all frames, then immediately requests the state of
the Sway window manager, and renames them back. Repeatedly eval'ing the
final sexp randomly returns either the original or the renamed frame
names. (When testing with a few frames, it never returned a mix of
original or renamed names --- it's 100% one or the other)

This is an issue because frame names is the only way to associate Emacs
frames with Sway identifiers (or any wayland wm) on pgtk Emacs).

MWE code follows.

Best regards,
Thibault


[-- Attachment #2: mwe.el --]
[-- Type: application/emacs-lisp, Size: 2285 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#58945: 29.0.50; Setting frame name in pgtk Emacs is asynchronous
  2022-11-01 14:58 bug#58945: 29.0.50; Setting frame name in pgtk Emacs is asynchronous Thibault Polge
@ 2022-11-03  0:31 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-11-12 20:34   ` Stefan Kangas
  0 siblings, 1 reply; 3+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-11-03  0:31 UTC (permalink / raw)
  To: Thibault Polge; +Cc: 58945

tags 58945 notabug
thanks

Thibault Polge <thibault@thb.lt> writes:

> In pgtk Emacs (built from a very recent git HEAD), running under the
> Sway window manager, setting a frame name like this:
>
> (set-frame-parameter (selected-frame) 'name "Some new name")
> (redisplay t)
>
> Doesn't immediately take effect.
>
> The example program below demonstrates this by triggering a race
> condition: it renames all frames, then immediately requests the state of
> the Sway window manager, and renames them back. Repeatedly eval'ing the
> final sexp randomly returns either the original or the renamed frame
> names. (When testing with a few frames, it never returned a mix of
> original or renamed names --- it's 100% one or the other)
>
> This is an issue because frame names is the only way to associate Emacs
> frames with Sway identifiers (or any wayland wm) on pgtk Emacs).

Setting the title on Wayland is asynchronous, just as it is with X.  By
the time the request or PropertyNotify event reaches the compositor or
window manager, other processes may already have run.  In addition,
running asynchronously improves performance.

I would recommend just waiting a set delay after setting the title.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#58945: 29.0.50; Setting frame name in pgtk Emacs is asynchronous
  2022-11-03  0:31 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-11-12 20:34   ` Stefan Kangas
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Kangas @ 2022-11-12 20:34 UTC (permalink / raw)
  To: Po Lu; +Cc: Thibault Polge, 58945-done

Po Lu <luangruo@yahoo.com> writes:

> tags 58945 notabug
> thanks
>
> Thibault Polge <thibault@thb.lt> writes:
>
>> In pgtk Emacs (built from a very recent git HEAD), running under the
>> Sway window manager, setting a frame name like this:
>>
>> (set-frame-parameter (selected-frame) 'name "Some new name")
>> (redisplay t)
>>
>> Doesn't immediately take effect.
>>
>> The example program below demonstrates this by triggering a race
>> condition: it renames all frames, then immediately requests the state of
>> the Sway window manager, and renames them back. Repeatedly eval'ing the
>> final sexp randomly returns either the original or the renamed frame
>> names. (When testing with a few frames, it never returned a mix of
>> original or renamed names --- it's 100% one or the other)
>>
>> This is an issue because frame names is the only way to associate Emacs
>> frames with Sway identifiers (or any wayland wm) on pgtk Emacs).
>
> Setting the title on Wayland is asynchronous, just as it is with X.  By
> the time the request or PropertyNotify event reaches the compositor or
> window manager, other processes may already have run.  In addition,
> running asynchronously improves performance.
>
> I would recommend just waiting a set delay after setting the title.

No further comments within 1 week, so I'm closing this bug report.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-12 20:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-01 14:58 bug#58945: 29.0.50; Setting frame name in pgtk Emacs is asynchronous Thibault Polge
2022-11-03  0:31 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-12 20:34   ` Stefan Kangas

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).