bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#15336: Bad computation of window height


From: Sebastien Vauban
Subject: bug#15336: Bad computation of window height
Date: Fri, 24 Oct 2014 16:35:36 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (windows-nt)

Eli Zaretskii wrote:>> From: Sebastien Vauban <sva-news@mygooglest.com>
>> Date: Fri, 24 Oct 2014 16:16:27 +0200
>> 
>> One side note though: I have 2 screens, and they are set up one above
>> the other (physically and logically).
>> 
>>   |----------------------|
>>   | screen #2 (external) |  <-- 1680 x 1050
>>   |----------------------|
>>   | screen #1 (laptop)   |  <-- 1920 x 1080 (Full HD)
>>   |----------------------|
>> 
>> That may impact what I see on Emacs 25.0.50.1.
>> 
>> With the following code:
>> 
>> --8<---------------cut here---------------start------------->8---
>>   (when (display-graphic-p)
>> 
>>     ;; put Emacs exactly where you want it, every time it starts up
>>     (setq initial-frame-alist '((top . 0) (left . 0)))
>> 
>>     ;; auto-detect the screen dimensions and compute the height of Emacs
>>     (add-to-list 'default-frame-alist
>>                  (cons 'height
>>                        (/ (- (x-display-pixel-height) 106)
>>                           (frame-char-height))))
>> 
>>     ;; maximize Emacs by default
>>     (modify-all-frames-parameters '((fullscreen . maximized))))
>> --8<---------------cut here---------------end--------------->8---
>> 
>> I'm expecting to have Emacs maximized at startup, on the main screen,
>> that is occupying the full space of screen #1: 1920 x 1080.
>> 
>> What I get, instead, is an Emacs frame of (1680 + 1920) x 1080... whose
>> top-right corner is located at the top-right corner of screen #1 (hence,
>> I don't even see its full height, without minimizing and re-maximizing
>> it first).
>
> I'm guessing that the coordinates (0, 0) are on screen #1, in which
> case you are getting what you asked for: a frame whose top-left corner
> is on screen #1.
>
> When using several monitors connected to the same machine, you
> shouldn't assume that the top-left corner of the virtual screen has
> the coordinates (0, 0).

Then, how do I ask for a maximized Emacs on screen #1?  I don't need it
to be on screen #2. I'm perfectly happy to get Emacs occupying the full
space of screen #1, and nothing more.

Currently, it's some sort of mix: for placing the Emacs frame, it only
counts on screen #1, while for its height it counts on screens #1 and
#2...

> What does the function display-monitor-attributes-list return?

--8<---------------cut here---------------start------------->8---
(((geometry 0 0 1920 1080) (workarea 0 0 1920 1032) (mm-size 280 160) (name . 
"\\\\.\\DISPLAY1") (frames)) ((geometry 0 -1050 1680 1050) (workarea 0 -1050 
1680 1002) (mm-size 430 270) (name . "\\\\.\\DISPLAY2") (frames #<frame 
Windows-Nt Emacs 25.0.50.1 (r118168) of 2014-10-20 - PID: 7896 0174e5a8>)))
--8<---------------cut here---------------end--------------->8---





reply via email to

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