unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Xu Fasheng <fasheng.xu@gmail.com>
To: 21152@debbugs.gnu.org
Subject: bug#21152: emacs make system blocked if "Xft/DPI = -1" in xsettings
Date: Tue, 28 Jul 2015 13:58:28 +0800	[thread overview]
Message-ID: <CA+TDsSnFQDYoDS9mKT1NTMTXFV-0L=PHBZ=8jJf_KRtVzbPCaQ@mail.gmail.com> (raw)

Hi, everyone.

I found that emacs could not compute a right dpi value if "Xft/DPI =
-1" in xsettings. The document said "Xft/DPI" is an integer, and "-1"
is the default value [1].

And in the code of src/xsettings.c:parse_settings(), all the interger
value in xsettings are converted to CARD32(unsigned int). So if
Xft/DPI is "-1", emacs will convert it to uint(4294967295), and owns a
huge dpi(4294967295/1024=4194303). Its so huge that will make system
blocked.

Here is the code snippets in
emacs24-24.5+1/src/xsettings.c:parse_settings() from debian/sid:
    ....
    420: CARD32 vlen, ival = 0;
    ....
    544: else if (strcmp (name, "Xft/DPI") == 0)
    545:  {
    546:    settings->seen |= SEEN_DPI;
    547:    settings->dpi = (double)ival/1024.0;
    548:  }

[1] http://www.freedesktop.org/wiki/Specifications/XSettingsRegistry/





             reply	other threads:[~2015-07-28  5:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-28  5:58 Xu Fasheng [this message]
2015-08-09  5:10 ` bug#21152: emacs make system blocked if "Xft/DPI = -1" in xsettings Paul Eggert
     [not found]   ` <CA+TDsSnFnUdwf4UsrSG2fF0o8dr5YLBhN8W1cWmMz7r6-Z_KWA@mail.gmail.com>
2015-08-10  6:24     ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+TDsSnFQDYoDS9mKT1NTMTXFV-0L=PHBZ=8jJf_KRtVzbPCaQ@mail.gmail.com' \
    --to=fasheng.xu@gmail.com \
    --cc=21152@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).