[Top][All Lists]

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

bug#21173: 25.0.50; New frames positioned off screen with multiple monit

From: Francis Litterio
Subject: bug#21173: 25.0.50; New frames positioned off screen with multiple monitors
Date: Fri, 31 Jul 2015 23:28:05 -0400

On Windows, using Emacs built from the latest source, I see the following
behavior on a machine with two 1920x1080 monitors arranged side-by-side, such
that the right monitor is the primary monitor (i.e., the monitor on which the
taskbar is drawn).  This monitor arrangement gives frames on the left monitor
negative X offsets, which is why this bug happens.

  $ runemacs.exe -Q

In buffer *scratch*:

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

  (frame-parameter f 'left)

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 right monitor):

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

The root cause appears to be that function x_calc_absolute_position (in
xterm.c and w32term.c) calls function x_display_pixel_width to obtain the
combined pixel width of all monitors, but the code doesn't take into account
that one (or more) monitors might have negative X offsets, which can happen on
Windows.  Thus, the new frame's left offset is miscomputed.

Under the X window system, I'm not sure if monitors can have negative X offsets,
so this may not be an issue under X.

I suspect the same problem would happen when making a frame with a 'top
parameter of -1 when the non-primary monitor is positioned above the primary
monitor (i.e., has negative Y offsets).
Fran Litterio
flitterio <at> gmail.com

In GNU Emacs (i686-pc-mingw32)
 of 2015-06-30 on PUPPY
Repository revision: 5f004117f5bcab9171eaddb2867393ed69ae49bf
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=c:/apps/emacs --without-x --without-xpm
 --without-png --without-jpeg --without-tiff --without-gif'

Configured features:

Important settings:
  value of $LANG: C.ISO-8859-1
  locale-coding-system: cp1252

Major mode: Text

Minor modes in effect:
  erc-list-mode: t
  erc-menu-mode: t
  erc-ring-mode: t
  erc-networks-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-match-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-netsplit-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  diff-auto-refine-mode: t
  show-paren-mode: t
  save-place-mode: t
  icomplete-mode: t
  savehist-mode: t
  shell-dirtrack-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  auto-fill-function: do-auto-fill
  transient-mark-mode: t
  abbrev-mode: t

Recent messages:
Wrote c:/franl/emacs-bug.txt
Saving file c:/franl/emacs-bug.txt...
Wrote c:/franl/emacs-bug.txt
Saving file c:/franl/emacs-bug.txt...
Wrote c:/franl/emacs-bug.txt
Saving file c:/franl/emacs-bug.txt...
Wrote c:/franl/emacs-bug.txt
Mark set [2 times]
(No changes need to be saved)

Load-path shadows:
None found.

(rfc2104 mailalias pulse jka-compr find-func sh-script smie executable
shadow mail-extr emacsbug calc-alg calc-aent calc-menu rect misearch
multi-isearch edmacro kmacro server sort gnus-draft gnus-agent gnus-srvr
nnvirtual nndraft nnmh gnus-msg gnus-cite canlock gnus-art mm-uu mml2015
epg-config mm-view mml-smime smime dig mailcap gnus-async gnus-score
score-mode gnus-cache gnus-sum fpl-moo fpl-react erc-notify erc-truncate
erc-log erc-dcc erc-list erc-menu erc-join erc-ring erc-networks
erc-pcomplete erc-track erc-match erc-button erc-fill erc-stamp
erc-netsplit erc-goodies erc erc-backend erc-compat thingatpt help-mode
source-safe ediff-merg ediff-wind ediff-diff ediff-mult ediff-help
ediff-init ediff-util ediff grep python json ielm pp sgml-mode
csharp-mode cc-langs cl smtpmail sendmail nntp gnus-group gnus-undo
gnus-start gnus-cloud nnimap nnmail mail-source utf7 netrc parse-time
gnus-spec gnus-int gnus-range message rfc822 mml mml-sec mm-decode
mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums
mailabbrev gmm-utils mailheader gnus-win nnoo gnus gnus-ems nnheader
mail-utils wid-edit etags vc vc-dispatcher dired-aux hexl smerge-mode
diff-mode easy-mmode paren man info compile apropos tramp tramp-compat
tramp-loaddefs trampver format-spec advice saveplace icomplete xref
savehist browse-url shell pcomplete warnings arc-mode archive-mode
ange-ftp socks network-stream nsm auth-source cl-macs cl-seq eieio
byte-opt gv bytecomp byte-compile cl-extra seq cconv eieio-core
cl-loaddefs pcase cl-lib gnus-util mm-util help-fns mail-prsvr
password-cache starttls tls dired cc-mode cc-fonts easymenu cc-guess
cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs comint
ansi-color ring calc-ext calc calc-loaddefs calc-macs time-stamp
time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel dos-w32 ls-lisp disp-table w32-win w32-vars
term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help
simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
w32notify w32 multi-tty make-network-process emacs)

Memory information:
((conses 8 345101 52543)
 (symbols 32 43222 2)
 (miscs 32 278 1325)
 (strings 16 100168 21170)
 (string-bytes 1 2854256)
 (vectors 8 49499)
 (vector-slots 4 967355 64132)
 (floats 8 603 1334)
 (intervals 28 3770 1352)
 (buffers 516 36))

reply via email to

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