[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 20:23:06 +0200 |
> I don't see why. Having the top-left corner of the frame as the
> reference point sounds simpler and more clear to me, and allows one to
> use it in the same way in all the builds. No?
If by top-left corner you intend the top-left position of the menu bar,
or if that's absent that of the top/left tool bar, or if that's absent
too that of the internal border, or if that is absent too that of the
root window, I agree. Just that it's not all too trivial to calculate
it.
We know the size of the tool bar only after we have displayed it. This
is already a problem on Lucid, Motif, Windows. And Windows has certain
difficulties telling us the height of the menubar when it wraps. This
too is already a problem, so nothing new here. But there might be yet
unknown problems with Gtk and NS.
>> 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.
>
> I get (-8 28 1912 984) on Windows 7 and (-4 32 1916 1022) on XP, so at
> least the Y coordinate seems OK.
Just 32 pixels for title, menu, and tool bar? Here `x-frame-geometry'
tells me that they alone take 74 pixels. BTW, has Windows 7 an 8 pixel
wide border by default?
>> 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.
>
> I don't follow the logic, can you elaborate why this implies what you
> think it implies? Are you saying that on GTK a maximized frame has
> some of its GTK decorations off-screen?
No, off-screen decorations are a Windows feature. What I meant is that
Gtk has some established, working features that albeit never worked on
Windows. And I'm afraid to break these features.
>> 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.
>
> I'm afraid I still don't see why this requires rounding, especially if
> the results are already inaccurate. E.g., can we consider the menu
> bar a single line, and the tool bar another N lines (N is usually 1,
> but doesn't have to be). IOW, can we treat each "row" of display in
> these windows as a single line, for the purposes of counting rows? If
> not, why not?
The windmove code, for example, determined adjacency of windows from the
fact that their respective edges matched. It took me some time to
adjust the line/column calculation code to handle that in an artificial
way. I don't know how much code exists that uses similar heuristics.
martin
- Coordinates and Windows, martin rudalics, 2015/07/15
- Re: Coordinates and Windows, Eli Zaretskii, 2015/07/15
- Re: Coordinates and Windows, martin rudalics, 2015/07/15
- Re: Coordinates and Windows, Eli Zaretskii, 2015/07/15
- Re: Coordinates and Windows, martin rudalics, 2015/07/16
- Re: Coordinates and Windows, Eli Zaretskii, 2015/07/16
- Re: Coordinates and Windows,
martin rudalics <=
- Re: Coordinates and Windows, Eli Zaretskii, 2015/07/17
- Re: Coordinates and Windows, martin rudalics, 2015/07/17
- Re: Coordinates and Windows, Eli Zaretskii, 2015/07/17
- RE: Coordinates and Windows, Drew Adams, 2015/07/17
- Re: Coordinates and Windows, martin rudalics, 2015/07/17
- RE: Coordinates and Windows, Drew Adams, 2015/07/17
- Re: Coordinates and Windows, martin rudalics, 2015/07/18
- Re: Coordinates and Windows, Eli Zaretskii, 2015/07/19
- Re: Coordinates and Windows, martin rudalics, 2015/07/20
- Re: Coordinates and Windows, martin rudalics, 2015/07/17