emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Coordinates and Windows


From: martin rudalics
Subject: Re: Coordinates and Windows
Date: Thu, 16 Jul 2015 09:14:25 +0200

>> Yes.  And there might be even a menu bar window on top of it.
>
> Is there some configuration where the menu bar is a window?

In X builds without toolkit.

>> Maybe.  But coordinates inside the tool and menu bars are not exposed to
>> Lisp (IIUC) so the confusion would be restricted to the display engine
>> and the mouse handling routines.
>
> That's not something to dismiss, surely.

Right.

>> Currently we confuse the user.
>
> My suggestion attempts to remove that confusion, I think.

We'd expect users (like we currently do on Windows, Lucid and Motif) to
care about tool bar dimensions when talking about window and frame
coordinates.  Asking Gtk users to do the same would certainly not be met
with great enthusiasm (once such a change had been installed).

>> I'm not sure yet.  Coordinates on TTY frames are a separate issue,
>> functions like `window-pixel-edges' don't make too much sense there.
>
> They still should work, to avoid complications in applications.

Actually, I started to look into this when I detected that it's
virtually impossible to position a tooltip frame via `x-show-tip' at a
window position obtained via `pos-visible-in-window-p' consistently on
all platforms.

To illustrate how little care has been applied to this so far, consider
the function `window-absolute-pixel-edges'.  With a maximized frame on
Windows XP this function returns (-4 -4 1676 964) here.  Apparently,
this was designed for Gtk users, never really tested on other platforms.
But this also implies that changing things for Gtk might not be a good
idea.

>>   > And don't forget that some modes, like gdb-mi, simulate the tool bar
>>   > below the menu bar on TTY frames -- what about those?
>>
>> But if I'm not mistaken neither of these are windows.
>
> No, but their glyph rows still have coordinates.

Which implies that in order to build a glyph matrix we don't necessarily
need a window.  So couldn't we do away with those pseudo-windows needed
for tool and menu bars?

>> So usually the root window top line must be rounded which I dislike
>> profoundly.  With a toolbar on the left I would then have to round the
>> value of (window-left-column) on GTK as well.
>
> Why do we have to round, now that we have pixel-wise accuracy in
> resizing windows and frames?

Because most programmers think (and applications work) in terms of rows
and columns.  `window-edges' is still quite in use although it's bound
to provide inaccurate results in many occasions now.

>> And then we would have still the problem that while for most builds we
>> do not include the menu bar, we would have to include it when we draw it
>> ourselves.  So the problem would be only partly solved.
>
> The only cases I know of are the TTY and non-toolkit X.  Are there any
> others?  If not, these are special anyway, and could be handled
> separately.

The non-toolkit X code is rather intertwingled with the non-GTK code so
we'd certainly had to provide lots more of special casing than we do
now.  To coherently apply your proposal we would have to put the origin
at the left upper corner of the menu bar - toolkit or not.

martin



reply via email to

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