unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Bug in function x_calc_absolute_position in xterm.c and w32term.c
@ 2015-06-23 16:12 Fran Litterio
  2015-06-30 13:42 ` Bug in function x_calc_absolute_positionin " Fran Litterio
  0 siblings, 1 reply; 2+ messages in thread
From: Fran Litterio @ 2015-06-23 16:12 UTC (permalink / raw)
  To: emacs-devel

Using the latest sources, I see the following behavior on a machine
with two 1920x1080 monitors arranged side-by-side:

  $ runemacs.exe -Q

In buffer *scratch*:

  (setq f (make-frame '((left . -1))))
  #<frame emacs@IZSYSTEM023 015257f0>
  (frame-parameter f 'left)
  3155

The left offset of the new frame appears to be 1920 pixels too far
to the right.  Evaluating the following form positions the frame to
its expected location (abutting the right edge of the rightmost 
monitor):

  (set-frame-position f (- 3155 1920) 0)

The root cause appears to be that function x_calc_absolute_position
(in files xterm.c and w32term.c) calls function x_display_pixel_width
to obtain the pixel width of the current monitor, but
x_display_pixel_width has changed to give the combined pixel width
of all monitors.

I expect the same problem would happen making a frame with a 'top
parameter of -1 with multiple vertically stacked monitors (due to
x_display_pixel_height having changed similarly).

If I can get a fix working, I'll send a patch.
--
Fran Litterio





^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Bug in function x_calc_absolute_positionin xterm.c and w32term.c
  2015-06-23 16:12 Bug in function x_calc_absolute_position in xterm.c and w32term.c Fran Litterio
@ 2015-06-30 13:42 ` Fran Litterio
  0 siblings, 0 replies; 2+ messages in thread
From: Fran Litterio @ 2015-06-30 13:42 UTC (permalink / raw)
  To: emacs-devel

I wrote:

> Using the latest sources, I see the following behavior on a machine
> with two 1920x1080 monitors arranged side-by-side:
> 
>   $ runemacs.exe -Q
...
>   (setq f (make-frame '((left . -1))))
>   #<frame emacs <at> IZSYSTEM023 015257f0>
>   (frame-parameter f 'left)
>   3155
> 
> The left offset of the new frame appears to be 1920 pixels too far
> to the right.  Evaluating the following form positions the frame to
> its expected location (abutting the right edge of the rightmost 
> monitor):
> 
>   (set-frame-position f (- 3155 1920) 0)

I've learned that this only happen when the 2nd monitor is positioned
to the left of the primary Windows monitor, resulting in negative
X offsets for frames on the 2nd monitor.  If I configure Windows to
position the 2nd monitor to the right of the primary monitor, all
X offsets are positive, and the first form above works as expected
(the new frame abuts the far right edge of the combined monitors).

I still believe the fix should be made in x_calc_absolute_position, but 
it must now take into consideration whether X offset 0 is within the 
multi-monitor display or at the far left edge.

I still hope to create a patch to fix this problem.
--
Fran Litterio
flitterio@gmail.com





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-30 13:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-23 16:12 Bug in function x_calc_absolute_position in xterm.c and w32term.c Fran Litterio
2015-06-30 13:42 ` Bug in function x_calc_absolute_positionin " Fran Litterio

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).