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: Jan Djärv
Subject: Re: Add function to make frame topmost?
Date: Sat, 01 May 2010 10:28:57 +0200
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4



Lennart Borgman skrev 2010-05-01 01.22:


1) a frame which is topmost.
2) looks like a tooltip frame
3) can show different things
4) can be hidden
5) can be shown without becoming active
6) never becomes the active window
7) looses it topmost property when switching to another app.
8) regains it when switching back
9) has to be recognized as such a frame by Emacs

Except for 7, 8 and 9, this is a tooltip. How does one dimiss such a window, by timer? Or clicking on it? This has impact on the type of window as well.


I am not sure about this list, please comment. What about having a
function make-tooltip-type-frame?

As I understand what you write here much of this is easily available
on X with _NET_WM_WINDOW_TYPE_TOOLTIP. How about point 2 above? 4 and
5? 6? 7 and 8?

Actually overrride-redirect is still needed, the specification recommends just using _NET_WM_WINDOW_TYPE_TOOLTIP for override-redirect windows. You need override-redirect anyway, because of older window managers.


w32:
- For 4 and 5 on w32 I have just added the bug report
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6068
- And I just sent the function w32-set-frame-topmost here. This is
needed, of course.
- The w32 window style has to be modified for 2. (Just wrote this.)
- Same for 6.
- 7 and 8 are a bit more difficult (need to check WM_APPACTIVATE).
- 9 is not specific to w32. A bit has to be added to the frame struct.


7 and 8 on X must depend on input focus. If emacs looses input focus it can be considered not active. But this is a tricky question. If we for example activate the system menu Emacs looses focus, but no other application has it either. We do not now keep track of focus on a global Emacs application level, just per frame.

How does "Urgency" work? Is that appropriate for reminders? I would
prefer that to be a frame that pops up but does not get focus until
the user choosen it.

Typically it is placed at the top. But if it gets focus or not is up to the window manager. You have to add code to handle focus switch to be sure.




***
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?


In the sense that it makes that frame topmost for window managers that support it, yes. But it might as well be a no-op on other window managers.
Anyway, it is not recommended to use STATE_ABOVE like this.
But if we are going to abuse the spec, we might as well use _NET_RESTACK_WINDOW.

        JanD.





reply via email to

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