From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?B?SmFuIERqw6Rydg==?= Newsgroups: gmane.emacs.devel Subject: Re: Add function to make frame topmost? Date: Sat, 01 May 2010 10:28:57 +0200 Message-ID: <4BDBE649.4020307@swipnet.se> References: <4BDB5A6E.5060803@harpegolden.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1272702556 12723 80.91.229.12 (1 May 2010 08:29:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 1 May 2010 08:29:16 +0000 (UTC) Cc: Emacs-Devel devel , Stefan Monnier , David De La Harpe Golden To: Lennart Borgman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 01 10:29:15 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O884V-0002mv-PL for ged-emacs-devel@m.gmane.org; Sat, 01 May 2010 10:29:12 +0200 Original-Received: from localhost ([127.0.0.1]:58372 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O884U-0004z5-UH for ged-emacs-devel@m.gmane.org; Sat, 01 May 2010 04:29:10 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O884O-0004x9-0q for emacs-devel@gnu.org; Sat, 01 May 2010 04:29:04 -0400 Original-Received: from [140.186.70.92] (port=45365 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O884L-0004vM-Mc for emacs-devel@gnu.org; Sat, 01 May 2010 04:29:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O884J-0004HA-WB for emacs-devel@gnu.org; Sat, 01 May 2010 04:29:01 -0400 Original-Received: from smtprelay-h12.telenor.se ([62.127.194.5]:58850) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O884J-0004Gr-KY for emacs-devel@gnu.org; Sat, 01 May 2010 04:28:59 -0400 Original-Received: from ipb2.telenor.se (ipb2.telenor.se [195.54.127.165]) by smtprelay-h12.telenor.se (Postfix) with ESMTP id 3C21AEB8B1 for ; Sat, 1 May 2010 10:29:59 +0200 (CEST) X-SENDER-IP: [85.225.45.110] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkYuACuD20tV4S1uPGdsb2JhbACDF5oZDAEBAQE1LaoukHSBJoJ+bgQ X-IronPort-AV: E=Sophos;i="4.52,308,1270418400"; d="scan'208";a="69441408" Original-Received: from c-6e2de155.25-1-64736c10.cust.bredbandsbolaget.se (HELO coolsville.localdomain) ([85.225.45.110]) by ipb2.telenor.se with ESMTP; 01 May 2010 10:28:57 +0200 Original-Received: from [172.20.199.13] (zeplin [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id 521F47FA05A; Sat, 1 May 2010 10:28:57 +0200 (CEST) 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 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:124388 Archived-At: 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.