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: David De La Harpe Golden
Subject: Re: Add function to make frame topmost?
Date: Sat, 01 May 2010 02:48:54 +0100
User-agent: Mozilla-Thunderbird 2.0.0.22 (X11/20091109)

***
One can certainly do this from within emacs as per the spec (note you
do this for mapped windows by sending a client message to the root window).
 Note however, that window managers may refuse an app's request to be always
on top.

(defun x-toggle-frame-always-on-top (&optional frame)
   (x-send-client-message
    frame 0 frame "_NET_WM_STATE" 32
    ;; _NET_WM_STATE_REMOVE = 0
    ;; _NET_WM_STATE_ADD = 1
    ;; _NET_WM_STATE_TOGGLE = 2
    '(2 "_NET_WM_STATE_ABOVE" 0 1)))


Does this work already?

Yes, that's working code, on window managers that honour it. But I don't actually recommend it for the purposes you wanted it for.

Would however be vaguely okay for people who don't want to reach for the mouse to use the relevant window manager menu. If it were to be included in emacs it would make more sense to treat it as a frame parameter at the elisp api level, similar to the handling of several other similar existing parameters, i.e. so one could write

(set-frame-parameter frame 'always-on-top t)

(I think this was what Stefan was saying, pretty much)
















reply via email to

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