all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: "Clément Pit--Claudel" <clement.pit@gmail.com>,
	"Emacs developers" <emacs-devel@gnu.org>
Cc: Stefan Monnier <monnier@iro.umontreal.ca>,
	Dmitry Gutov <dgutov@yandex.ru>
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	[thread overview]
Message-ID: <56C1AF03.7070804@gmx.at> (raw)
In-Reply-To: <56BDF3DE.2050704@gmail.com>

 > 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?  ‘x_create_tip_frame’ creates a frame with up to two
types of borders, the one specified via the ‘internal-border-width’ and
the other one specified via the ‘border-width’ frame parameter (where
the latter is AFAICT used for tooltips only).  At the same time,
‘x_create_tip_frame’ 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-borderless-frame,
 > to no avail.

‘x-show-tip’ is highly tailored to emulating "conventional" tooltips and
strongly tied to ‘x-hide-tip’.  Parts of its implementation (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 ‘border-width’ parameter 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 call:
 >
 >    x_default_parameter (f, parms, Qborder_width, make_number (0), "borderWidth", "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.  ‘border-width’ is the most
obscure of our frame parameters, it's implementation is beyond our
control.  You can set it via ‘tooltip-frame-parameters’ and 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 ‘gtk_window_set_decorated’ 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




  parent reply	other threads:[~2016-02-15 10:57 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-12 15:01 Could x-show-tip be reimplemented in Elisp? How does one create borderless frames from Elisp? Clément Pit--Claudel
2016-02-13  2:15 ` Chris Feng
2016-02-13  3:35   ` Clément Pit--Claudel
2016-02-13  3:57     ` Chris Feng
2016-02-16 20:12       ` Creating a "borderless" frame (without WM chrome) (was Re: Could x-show-tip be reimplemented in Elisp? How does one create borderless frames from Elisp?) Clément Pit--Claudel
2016-02-16 22:41         ` Chris Feng
2016-02-16 22:55           ` Clément Pit--Claudel
2016-02-16 23:14             ` Chris Feng
2016-02-16 23:46               ` Clément Pit--Claudel
2016-02-17  9:13                 ` martin rudalics
2016-02-17 13:49                   ` Chris Feng
2016-02-17 14:55                     ` Clément Pit--Claudel
2016-02-18  1:28                       ` Chris Feng
2016-02-17 14:57                   ` Clément Pit--Claudel
2016-02-18 10:51                     ` martin rudalics
2016-02-14 14:05     ` Could x-show-tip be reimplemented in Elisp? How does one create borderless frames from Elisp? Stefan Monnier
2016-02-14 16:44       ` Eli Zaretskii
2016-02-14 17:19         ` Stefan Monnier
2016-02-14 18:00           ` Eli Zaretskii
2016-02-16 20:06       ` Clément Pit--Claudel
2016-02-15 10:57 ` martin rudalics [this message]
2016-02-15 13:31   ` Stefan Monnier
2016-02-16 20:06     ` Clément Pit--Claudel
2016-02-16 20:05   ` Clément Pit--Claudel
2016-02-16 21:33     ` Johan Bockgård
2016-02-16 22:18       ` Clément Pit--Claudel
2016-02-17  9:12     ` martin rudalics
2016-02-17 14:26       ` Clément Pit--Claudel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56C1AF03.7070804@gmx.at \
    --to=rudalics@gmx.at \
    --cc=clement.pit@gmail.com \
    --cc=dgutov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.