[Top][All Lists]

[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: Sat, 18 Jul 2015 11:03:29 +0200

>> For example, on Windows I need accurate dimensions of decorations to
>> emulate fullheight and fullwidth fullscreen modes.
> What do you mean by "emulate"?  AFAIK, these are supported on Windows
> without any need for emulation.

The Windows API knows only minimized and maximized frames.  The
fullboth, fullheight and fullwidth ones must be emulated.  I read that
Aero Snap provides a similar service but to my knowledge we can't call
that from within Emacs.  Also there was a bug report (by Juanma IIRC)
that we don't support some Snap feature(s) yet.

Just to explain what emulation means in this context: When a user sets
the `fullscreen' parameter to `maximized' we send a maximize request to
the OS, the latter calculates the coordinates and calls us back with the
new coordiantes.  When a user sets the `fullscreen' parameter to
`fullheight', Emacs calculates the new coordinates and sends a resize
request to the OS.  The OS has no idea that our frame is "full height".

> Why do you need _frame_ relative coordinates to display something at
> _window_ relative position?

Because currently `window-absolute-pixel-edges' is not accurate.  I use
a three steps translation process:

(1) `pos-visible-in-window-p' gets me "pixel coordinates relative to the
    top left corner of the window".

(2) I add the offsets of the window within its frame.

(3) I add the offsets of the frame on the display.

But the frame offsets I get via the `left' and `top' frame parameters in
(3) are those of the "outer frame" as placed by the window manager.
Hence in (2) the offsets provided, for example, by `window-pixel-edges'
as "relative to 0, 0 at the top left corner of the frame" are
insufficient because that corner is not the one from (3).

>> No.  The root window is beneath the tool bar window separated from the
>> latter by the internal border.
> Strange.

In a session where you never split windows, the root window is always
the one you see and work in.  Also, the minibuffer window, if it exists,
is beneath the root window unless your frame is a "minibuffer-only" one.


reply via email to

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