emacs-devel
[Top][All Lists]
Advanced

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

Re: Add function to make frame topmost?


From: Lennart Borgman
Subject: Re: Add function to make frame topmost?
Date: Fri, 30 Apr 2010 15:26:56 +0200

On Fri, Apr 30, 2010 at 3:06 PM, Stefan Monnier
<address@hidden> wrote:
>> Could something like this please be added to w32fns.c?
>
> First, if it's w32-specific, its name should not start with "x-" but
> with "w32-".  If it's not, then its name should start with neither and
> the DEFUN should be in a system-independent file.

This version is w32-specific, yes. It will only appear in an Emacs
compiled for w32.

Looking at w32fns.c it looks to me like this is how some functions
(for example x-show-tip) that must have different implemantations for
x and w32 are handled. But indeed that looks like a bad convention
since it makes it impossible to choose function according to the
display used.

So I will rename it to w32-set-frame-topmost. And I think some other
functions also should be renamed and integrated in the way I suggest
below.

Then there should of course be a similar function x-set-frame-topmost
for X windows, but I can't write that.

To tie this together I think something like

  (defun set-frame-topmost (frame top activate)
    (cond
     ((eq (display-type) 'x-windows) (x-set-frame-topmost frame top activate))
     ((eq (display-type) 'w32) (w32-set-frame-topmost frame top activate))))

is needed. The function `display-type' does not exist yet of course.

> Finally, I don't know what means "topmost", so the docstring needs to
> be improved.

Yes, "topmost" is what is used for tooltip etc to make that frame
window stay above other windows without having focus. On w32 (and I
guess on x) this also works across applications, ie a topmost frame
window stays above the active application.

My usecase for something like this is reminders that pops up at a
certain times. You may want to see them even if you are not in Emacs.
And you may prefer to not get interrupted when you type so directly
activating Emacs might not be a good thing.




reply via email to

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