From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Child-frame can not move to proper position when run "env GDK_SCALE=2 emacs" Date: Wed, 10 Jan 2018 03:52:22 +0300 Message-ID: References: <87wp0sy3bq.fsf@163.com> <5A53B5C5.70105@gmx.at> <87608c54xw.fsf@163.com> <87incbe47u.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1515545444 27769 195.159.176.226 (10 Jan 2018 00:50:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 10 Jan 2018 00:50:44 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:58.0) Gecko/20100101 Thunderbird/58.0 Cc: Feng Shu , emacs-devel@gnu.org To: Robert Pluim , martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jan 10 01:50:40 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZ4bE-0006gN-GW for ged-emacs-devel@m.gmane.org; Wed, 10 Jan 2018 01:50:36 +0100 Original-Received: from localhost ([::1]:60129 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZ4dE-0004Fs-4f for ged-emacs-devel@m.gmane.org; Tue, 09 Jan 2018 19:52:40 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZ4d5-0004Ff-De for emacs-devel@gnu.org; Tue, 09 Jan 2018 19:52:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZ4d2-0001kH-AZ for emacs-devel@gnu.org; Tue, 09 Jan 2018 19:52:31 -0500 Original-Received: from mail-lf0-x22d.google.com ([2a00:1450:4010:c07::22d]:39772) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eZ4d2-0001hh-2X for emacs-devel@gnu.org; Tue, 09 Jan 2018 19:52:28 -0500 Original-Received: by mail-lf0-x22d.google.com with SMTP id m8so11851892lfc.6 for ; Tue, 09 Jan 2018 16:52:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=NvST57Ue5FqKmz1l2ad7t5YAUul3K5NO8a1I7ysgZdc=; b=l21fXB61akbREcjEgtCZB0mhhQcjP1DA569e63vpe29HCdZn7PsU1sT7QTzkTogNZB wLJBOlxSe0wLeUwSZ3PL08gLJ+B1VpjnpkMh57B7QXPhEhhhcMK3y+OZPxK1o8ecX7LY W86igtetBmQL6NlXKq/Dc50vMB3MA6eC2+Jd28nebDpZQJ3/Vwj0AsVsRSHZnGTyIJ/4 ruWfN9AhJqJRu2s9vAS6V7+YIuxlUnRrTK8hpbFD90Wew9BUtfnpcP17L7QLtHKQlVLH oVwFSHRF+wRb5bgMJBRcogeuLeg7ru1ASS6C9QUpJm39iPofN6DnxbpQyKtSptAI5snf TnUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=NvST57Ue5FqKmz1l2ad7t5YAUul3K5NO8a1I7ysgZdc=; b=K0/VsWx5k5/bUWX7Ba+QEoZY6Y7Qs69xsLkMsNM4Taez1SfSbMnKf2MF1J/f45mGgX dWHjU51W7MIPZo3nTrzdfOBCAWm0Qmcd9s8cospt9ydZ3ubjuuQ+jYUrFbB49SoA7kPW emFI7yUgwDJXgGuf1XWSugnS54GnAQDJY5nZufx6ylc6j7LNClh4GJDS/c9lJOSJMEb6 t3Hw0PCWtKVbfogbWYeSDjHCe8iOsSEJrGOv2J9NKUSb47gLNM0iEtd8IVgbStkUA2is CoNpL02QXhNCHezyNifWpbRE2xkCqbs1pqJDTBG0YaTknopJp3topeEUAEZN68zSG4ZH dVYw== X-Gm-Message-State: AKGB3mIIXHY6xBCQSuwpSJHPW89uK16WclaUgrEmVaCSAg59TiKvm7m1 VCWbUvDpepydi4IQMEfn809OTa1a X-Google-Smtp-Source: ACJfBouzHOKyZ/9Fy6hWqAGVYCIx3V8TcMDy9jYsKL4nz9hyqsYVCwpkfAoSsOPpNHkPLY6JH1ELqQ== X-Received: by 10.46.20.25 with SMTP id u25mr10274030ljd.39.1515545545958; Tue, 09 Jan 2018 16:52:25 -0800 (PST) Original-Received: from [192.168.1.174] ([178.252.127.239]) by smtp.googlemail.com with ESMTPSA id 40sm2716451lfr.55.2018.01.09.16.52.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jan 2018 16:52:24 -0800 (PST) In-Reply-To: <87incbe47u.fsf@gmail.com> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::22d X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:221770 Archived-At: On 1/9/18 1:06 PM, Robert Pluim wrote: > Ugh. I don't think we should expose the scale values, we should fix > whatever the issue is with set-frame-position. Naively that's the > attached patch, but I worry about other places that assume unscaled > coordinates. I'll run with it for a while and see if any pop up. This seems to fix the immediate issue (company-mode popup based on child frames is now positioned correctly on my HiDPI screen). Would be great to get this one into Emacs 26. > Longer term we need to implement your 'eliminate direct X calls' plan, > and have everything inside Emacs use GTK coordinates. > > Robert > > diff --git i/src/xterm.c w/src/xterm.c > index f771631daf..950e6231e0 100644 > --- i/src/xterm.c > +++ w/src/xterm.c > @@ -10311,6 +10311,14 @@ x_set_offset (struct frame *f, register int xoff, register int yoff, int change_ > { > int modified_top, modified_left; > > +#ifdef USE_GTK > + { > + int scale = xg_get_scale(f); > + xoff /= scale; > + yoff /= scale; > + } > +#endif > + > if (change_gravity > 0) > { > f->top_pos = yoff; >