From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: Could x-show-tip be reimplemented in Elisp? How does one create borderless frames from Elisp? Date: Mon, 15 Feb 2016 11:57:07 +0100 Message-ID: <56C1AF03.7070804@gmx.at> References: <56BDF3DE.2050704@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1455533862 25325 80.91.229.3 (15 Feb 2016 10:57:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 15 Feb 2016 10:57:42 +0000 (UTC) Cc: Stefan Monnier , Dmitry Gutov To: =?UTF-8?B?Q2zDqW1lbnQgUGl0LS1DbGF1ZGVs?= , Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 15 11:57:32 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aVGqR-0002U6-Um for ged-emacs-devel@m.gmane.org; Mon, 15 Feb 2016 11:57:32 +0100 Original-Received: from localhost ([::1]:58967 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVGqM-00010Q-G7 for ged-emacs-devel@m.gmane.org; Mon, 15 Feb 2016 05:57:26 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVGqI-0000zZ-P7 for emacs-devel@gnu.org; Mon, 15 Feb 2016 05:57:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVGqD-0004cN-Pq for emacs-devel@gnu.org; Mon, 15 Feb 2016 05:57:22 -0500 Original-Received: from mout.gmx.net ([212.227.15.18]:62959) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVGqD-0004b8-G6 for emacs-devel@gnu.org; Mon, 15 Feb 2016 05:57:17 -0500 Original-Received: from [192.168.1.100] ([212.95.7.26]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0MK0Np-1aW5ee3XIz-001Oda; Mon, 15 Feb 2016 11:57:13 +0100 In-Reply-To: <56BDF3DE.2050704@gmail.com> X-Provags-ID: V03:K0:X8MtBsf/16gFcvWTwPxPRxTD7KHk8VKi+xIwzr9Ejwpdnld2hDc s0iyoT17rAUdHseDguIIlOqhK4NqIeEo9eL2ifFI0LZe7yyl621L6Ei74JGjXtgIgZrA+W6 oqw+AzEJ1H/R+9udx4ImNa3NO2mRhbYYzqqn//8z/N5Ly/SjP61ZfN822QwB4S+5mRFVWwa p0dkszuqygdccxz8mYbGg== X-UI-Out-Filterresults: notjunk:1;V01:K0:CF5Uyf+bYxc=:BIvtJK0dsxlvyC9BcJFvKT w4C3wMHPPHMujQWbAVq5r4DumE9lLdB5MBpezWDc2a39VeFbd7YNWYDtnmaXjaz04NOyHIJqr AzPQIMLFffS/BWae05KFRdvUSWJPCsDvGQMV4X1QJTaAot+BYc/PuZwXzgcQjQufQxi0LLMV9 C90z7V9vZWqHIsXvIVYU+3SC8VBFH5AA21gx2Wjyo+6Z3asCUsJmMzGkTr0Tpa0xmlbCNWjPL LmTog+maTW+AGVYATxLJo7r+XWQNehU3h5L3lsUYJwG/5Mc+W+wkHa6GKY07EMUKGRZcryuBs Cm8prhHDMcWCZqMkdN+Xtm4A6drs8LKQyY5T5x0KQxB29TM6HM65pihWp67fUxEPmSxJjzlja tjT6sTQ9oIec9qVtzQovC1FfTq8S25RkxbG113NVX96cVm9cWfmq4/kKE0TIlYXbS94vzCA5k wKctqHFDON4StrRAQWIlvla3YURqD+LB62nrZyZt2b3SC+1+XmYXp0VZn943ATtxh/JUMuixJ Un72vReFaZgnGHR9suCiHMhEv9h7yf5dNH9f9I8OaijZ3jkTNgvdnx+tlqOo5AAiDrNnpENUc TTqEyBRmA+w1Dh+k9bFtvfvVtAcAvevLA/mvuMuwvI/uY1Tsm+PHj8FYxOnTYS6h7494rpZJs S7X7eVj/8v7akhJHSVpazOdYRTwvwnfUY9VyZ0r7590Hb2pjbU2ZGSCuPMKj60sfmdImxTeu5 //g2N3jDzhYuGV+6u/Ei4akL5eA24/28x49XFD63/k+8haetPZKexXWtB6jVgy4V2YhCfkuk X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.18 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:199966 Archived-At: > TL;DR: How do I create a frame without a border, in the style of > x_create_tip_frame (called by x-show-tip in the C sources), from > Elisp? What is a border? =E2=80=98x_create_tip_frame=E2=80=99 creates a frame w= ith up to two types of borders, the one specified via the =E2=80=98internal-border-widt= h=E2=80=99 and the other one specified via the =E2=80=98border-width=E2=80=99 frame para= meter (where the latter is AFAICT used for tooltips only). At the same time, =E2=80=98x_create_tip_frame=E2=80=99 tries to suppress decorations of the= window manager which is probably what you want. > I'm looking at ways in which we could use real tooptip popups instead > of overlays to display company-mode completion lists. This would have > many advantages, including better interaction with font sizes, no > issues with recursive display specs, good support for variable-width > fonts, and so on. I believe Stefan has spoken in favour of that > approach in the past, too. Is there any reason you cannot use menus for this purpose? > The natural candidate for this task is x-show-tip, and it probably > meets most of the requirements; but not all. In particular, there can > be at most one tooltip displayed at any time; this means that we'd > break other packages that display tooltips while completion is > ongoing. Examples include company-quickhelp, which displays > documentation for the currently selected entry next to completion > candidates. > > `x-show-tip` is currently implemented in C; as far as I can see, > however, it essentially creates a frame and displays it at a given > location; given this, I thought it would be possible to reimplement it= > in ELisp. Unfortunately, I've been hitting a wall when it comes to > displaying a borderless frame. I asked on > https://emacs.stackexchange.com/questions/20167/how-do-i-create-a-bord= erless-frame, > to no avail. =E2=80=98x-show-tip=E2=80=99 is highly tailored to emulating "conventiona= l" tooltips and strongly tied to =E2=80=98x-hide-tip=E2=80=99. Parts of its implementati= on (in particular the Lucid menubar issue) are highly fragile, so better don't tinker with it. Also a reimplementation in ELisp hardly makes sense because the API calls are used to hide the implementation details wrt X11 and Windows. You can't use the =E2=80=98border-width=E2=80=99 parame= ter with the latter so we have to emulate the X11 behavior somehow with the "thin-line" border approach provided by the Windows API. And the GTK/OSX tooltips will behave specially anyway. > My original guess was that the relevant part of the C code was this ca= ll: > > x_default_parameter (f, parms, Qborder_width, make_number (0), "bor= derWidth", "BorderWidth", RES_TYPE_NUMBER); > > Unfortunately, neither (set-frame-param (selected-frame) 'border-width= > 0) nor (make-frame '((border-width . 0))) (both inspired from the call= > above) yield a borderless frame. These are overridden by the window manager. =E2=80=98border-width=E2=80=99= is the most obscure of our frame parameters, it's implementation is beyond our control. You can set it via =E2=80=98tooltip-frame-parameters=E2=80=99 a= nd then it is usually honored for X11 tooltips (but not on Windows). > Is there a way to create a borderless frame from Elisp? If a truly borderless frame is what you want, we can do that for X11 and Windows. GTK has =E2=80=98gtk_window_set_decorated=E2=80=99 and we could= try using that as well. I have no idea how to do that on OSX, maybe Anders has. You would, however, have to say how a borderless frame should look like. At least the Windows tooltip frame is _not_ borderless. And on X11 I wouldn't know how to remove caption and borders separately. IIUC you can only remove them both or neither. martin