From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David De La Harpe Golden Newsgroups: gmane.emacs.devel Subject: Re: Add function to make frame topmost? Date: Sat, 01 May 2010 02:48:54 +0100 Message-ID: <4BDB8886.4050202@harpegolden.net> 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 1272678551 23219 80.91.229.12 (1 May 2010 01:49:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 1 May 2010 01:49:11 +0000 (UTC) Cc: Stefan Monnier , Emacs-Devel devel To: Lennart Borgman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 01 03:49:10 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 1O81pM-0000aI-NK for ged-emacs-devel@m.gmane.org; Sat, 01 May 2010 03:49:09 +0200 Original-Received: from localhost ([127.0.0.1]:60546 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O81pM-0002Oi-1P for ged-emacs-devel@m.gmane.org; Fri, 30 Apr 2010 21:49:08 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O81pF-0002Lu-N1 for emacs-devel@gnu.org; Fri, 30 Apr 2010 21:49:01 -0400 Original-Received: from [140.186.70.92] (port=53466 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O81pE-0002L3-LK for emacs-devel@gnu.org; Fri, 30 Apr 2010 21:49:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O81pD-0003eK-3e for emacs-devel@gnu.org; Fri, 30 Apr 2010 21:49:00 -0400 Original-Received: from harpegolden.net ([65.99.215.13]:60020) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O81pC-0003eD-TF for emacs-devel@gnu.org; Fri, 30 Apr 2010 21:48:59 -0400 Original-Received: from [87.198.54.194] (87-198-54-194.ptr.magnet.ie [87.198.54.194]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "David De La Harpe Golden", Issuer "David De La Harpe Golden Personal CA rev 3" (verified OK)) by harpegolden.net (Postfix) with ESMTP id BAA089772; Sat, 1 May 2010 02:48:56 +0100 (IST) User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20091109) 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:124376 Archived-At: >> *** >> 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)