emacs-devel
[Top][All Lists]
Advanced

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

Question about sit-for.


From: Jan D.
Subject: Question about sit-for.
Date: Sun, 30 Jan 2005 17:37:29 +0100

Hello.

I'm looking in to a bug report that the non-fancy splash screen does not appear when "About Emacs" is invoked from the menu (GTK version).

The problem turns out to be sit-for. The normal splash screen (normal-splash-screen) uses (sit-for 120) to wait for input, and then remove the splash screen. The problem with this approach is that the GTK menu bar takes focus and so when the menu bar action is invoked, a FOCUS_IN event to the frame is generated. This event makes the sit-for return at once so the splash screen is never seen.

A solution is to modify sit-for so that it ignores FOCUS events. But since that may affect other things it is a bit of a risky change. The documentation for sit-for says:
"...wait for seconds seconds or until input is available."

Is FOCUS_IN considered input? Or do we need another sit-for that waits until "real input" (mouse click or key invoked) is available?

I can not get rid of the FOCUS_IN in this special case, it is needed for Emacs to detect focus correctly. The reason GTK differs from other toolkits is because GTK also has a buffering of events (in addition to X) so the timing is different.

An alternative approach is to use the same mechanism as the fancy-splash-screens, i.e. a timer instead of sit-for.

        Jan D.





reply via email to

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