Subject: bug#32977: 26.1.50; Emacs (on gnome 3, wayland, debian buster) calculates incorrect horizontal positions

From: Kai Tetzlaff <[email-masked]>
Date: Sun, 07 Oct 2018 21:07:20 +0200

The following happens within Gnome 3 (3.30, but also earlier versions),
Wayland on Debian Buster on a Laptop with HiDPI display with fractional
scaling factor set to 1.5.

Position frame at the left border of the display, evaluate:

    (frame-parameter (selected-frame) 'left)
    ;; -10

or

    (car (frame-position (selected-frame)))
    ;; '(+ -10)

The horizontal frame position should be 0, instead it gets reported as
-10 (indicating that part of the frame is invisible - which is not the
case). Even if the frame is positioned within the first 9 pixel
positions, the result is still negative.

In GNU Emacs 26.1.50 (build 6, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
 of 2018-09-15 built on moka
Repository revision: 20ecc5266e1ffb1cff3e31475631b5c76b99e997
Windowing system distributor 'The X.Org Foundation', version 11.0.12001000
System Description:	Debian GNU/Linux testing (buster)

Recent messages:
Wrote /home/kail/.emacs.d/init/user/kai_tetzlaff.el
Mark set [8 times]
Auto-saving...
Mark set [2 times]
Quit
Mark set [6 times]
Auto-saving...done
Saving file /home/kail/.emacs.d/init/user/kai_tetzlaff.el...
Wrote /home/kail/.emacs.d/init/user/kai_tetzlaff.el
Computing completion candidates... [2 times]

Configured using:
 'configure --with-modules --with-xwidgets'

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS GLIB
NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS
LIBSYSTEMD LCMS2

Important settings:
  value of $LC_COLLATE: de_DE.UTF-8
  value of $LC_CTYPE: de_DE.UTF-8
  value of $LC_MESSAGES: en_US.UTF-8
  value of $LC_MONETARY: de_DE.UTF-8
  value of $LC_NUMERIC: de_DE.UTF-8
  value of $LC_TIME: de_DE.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Emacs-Lisp

Minor modes in effect:
  diff-auto-refine-mode: t
  icicle-mode: t
  minibuffer-depth-indicate-mode: t
  shell-dirtrack-mode: t
  recentf-mode: t
  pretty-control-l-mode: t
  diredp-highlight-autofiles-mode: t
  Info-breadcrumbs-in-mode-line-mode: t
  display-time-mode: t
  delete-selection-mode: t
  show-paren-mode: t
  global-auto-revert-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/home/kail/.emacs.d/elpa/pde-0.2.16/perlcritic hides /home/kail/.emacs.d/elpa/perlcritic-1.10/perlcritic
/home/kail/.emacs.d/lisp/yaml-mode hides /home/kail/.emacs.d/elpa/yaml-mode-0.0.13/yaml-mode
/home/kail/.emacs.d/lisp/adams/ls-lisp hides /usr/local/share/emacs/26.1.50/lisp/ls-lisp
/home/kail/.emacs.d/lisp/tempo hides /usr/local/share/emacs/26.1.50/lisp/tempo
/home/kail/.emacs.d/lisp/cc-mode/cc-guess hides /usr/local/share/emacs/26.1.50/lisp/progmodes/cc-guess
/home/kail/.emacs.d/lisp/cc-mode/cc-bytecomp hides /usr/local/share/emacs/26.1.50/lisp/progmodes/cc-bytecomp
/home/kail/.emacs.d/lisp/cc-mode/cc-engine hides /usr/local/share/emacs/26.1.50/lisp/progmodes/cc-engine
/home/kail/.emacs.d/lisp/cc-mode/cc-fonts hides /usr/local/share/emacs/26.1.50/lisp/progmodes/cc-fonts
/home/kail/.emacs.d/lisp/cc-mode/cc-cmds hides /usr/local/share/emacs/26.1.50/lisp/progmodes/cc-cmds
/home/kail/.emacs.d/lisp/cc-mode/cc-langs hides /usr/local/share/emacs/26.1.50/lisp/progmodes/cc-langs
/home/kail/.emacs.d/lisp/cc-mode/cc-mode hides /usr/local/share/emacs/26.1.50/lisp/progmodes/cc-mode
/home/kail/.emacs.d/lisp/cc-mode/cc-styles hides /usr/local/share/emacs/26.1.50/lisp/progmodes/cc-styles
/home/kail/.emacs.d/lisp/cc-mode/cc-vars hides /usr/local/share/emacs/26.1.50/lisp/progmodes/cc-vars
/home/kail/.emacs.d/lisp/cc-mode/cc-align hides /usr/local/share/emacs/26.1.50/lisp/progmodes/cc-align
/home/kail/.emacs.d/lisp/cc-mode/cc-menus hides /usr/local/share/emacs/26.1.50/lisp/progmodes/cc-menus
/home/kail/.emacs.d/lisp/cc-mode/cc-defs hides /usr/local/share/emacs/26.1.50/lisp/progmodes/cc-defs
/home/kail/.emacs.d/lisp/cc-mode/cc-awk hides /usr/local/share/emacs/26.1.50/lisp/progmodes/cc-awk

Features:
(shadow sort mailalias bbdb-com crm bbdb bbdb-site timezone mail-extr
emacsbug message rmc puny rfc822 mml mml-sec gnus-util rmail
rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mail-utils cl-indent ibuf-ext ibuffer ibuffer-loaddefs time-stamp edebug
misearch multi-isearch vc-git diff-mode cl-print debug find-dired grep
compile eieio-opt speedbar sb-image ezimage dframe sh-script smie
executable face-remap rc-icicles two-column icicles icicles-mode
mb-depth+ mb-depth icicles-cmd2 icicles-cmd1 icicles-mcmd icicles-fn
icicles-var apropos-fn+var icicles-face icicles-opt ffap- ffap cus-theme
cus-edit cus-start cus-load hexrgb elec-pair kai_tetzlaff rc-misc
tramp-cache tramp-sh tramp tramp-compat tramp-loaddefs trampver
ucs-normalize shell pcomplete comint ansi-color ring parse-time recentf
tree-widget browse-kill-ring+ browse-kill-ring generic-x rc-cc-mode
gtags kt-tiny cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles
cc-align cc-engine cc-vars cc-defs generic replace+ isearch+ pp-c-l
buff-menu+ dired-sort-menu+ dired-sort-menu dired+ image-dired
image-mode format-spec image-file highlight bookmark+ bookmark+-key
bookmark+-1 font-lock+ bookmark+-bmu menu-bar+ apropos+ apropos
second-sel warnings misc-cmds help-fns+ wid-edit+ wid-edit help-fns
radix-tree help+ info+ bookmark+-lit pp+ bookmark pp dired-x dired-aux
dired dired-loaddefs finder+ finder find-func lisp-mnt window+
modeline-posn time files+ faces+ nuke-whitespace rc-markdown rc-ecb
rc-session rc-nxml rng-loc rng-uri rng-parse rng-match rng-dt rng-util
rng-pttrn nxml-parse nxml-ns nxml-enc xmltok nxml-util rc-ediff rc-irfc
rc-filladapt filladapt rc-spelling rw-hunspell rw-ispell ispell rc-dired
rc-hs rc-template template rc-epa epa-file epa epg rc-mail rc-w3
rc-psprint rc-bookmark rc-bbdb rc-gnus rc-clojure delsel paren mic-paren
server autorevert filenotify frame-cmds advice strings misc-fns
thingatpt+ thingatpt frame-fns avoid fit-frame rc-ibuffer edmacro kmacro
rc-calendar rc-limits mm-util mail-prsvr zenburn-theme solarized-theme
solarized-definitions whiteboard-theme dichromacy-theme tango-theme
rc-gnutls gnutls rc-git cl-extra help-mode kt-tools use-package
use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key easy-mmode use-package-core derived subr-x
rc-package finder-inf rw-hunspell-autoloads rw-ispell-autoloads info
package easymenu epg-config url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs eieio-loaddefs password-cache url-vars seq
byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib time-date
mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode elisp-mode lisp-mode prog-mode register page menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors 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 composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray 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 threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
xwidget-internal move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 554725 49389)
 (symbols 48 47965 4)
 (miscs 40 175 1139)
 (strings 32 118287 4659)
 (string-bytes 1 4060436)
 (vectors 16 68163)
 (vector-slots 8 1102590 23108)
 (floats 8 221 695)
 (intervals 56 2006 944)
 (buffers 992 19))