From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Cl=c3=a9ment_Pit-Claudel?= Newsgroups: gmane.emacs.devel Subject: Re: What is the proper way to scale fringe-bitmaps for high-DPI displays? Date: Wed, 20 Mar 2019 15:34:26 -0400 Message-ID: <59f034d0-3473-0a83-ccf6-1a6fe446964c@gmail.com> References: <4be02093-6e31-bfde-7d11-5900c7e02668@gmail.com> <83pnqlsb8l.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="60989"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Mar 20 20:35:15 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h6gza-000Fl3-D0 for ged-emacs-devel@m.gmane.org; Wed, 20 Mar 2019 20:35:14 +0100 Original-Received: from localhost ([127.0.0.1]:52252 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6gzZ-0001rw-F5 for ged-emacs-devel@m.gmane.org; Wed, 20 Mar 2019 15:35:13 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:35075) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h6gys-0001rb-OF for emacs-devel@gnu.org; Wed, 20 Mar 2019 15:34:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h6gyr-0004cr-VR for emacs-devel@gnu.org; Wed, 20 Mar 2019 15:34:30 -0400 Original-Received: from mail-qt1-x831.google.com ([2607:f8b0:4864:20::831]:40303) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h6gyr-0004an-MR; Wed, 20 Mar 2019 15:34:29 -0400 Original-Received: by mail-qt1-x831.google.com with SMTP id x12so3975793qts.7; Wed, 20 Mar 2019 12:34:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=A4CnDSGICuEnb6KiAyzYeSFQ7/CFQbPVqB0bqQzZVrQ=; b=LS+/qbrjo0HLqs/GPHqEvOMdyxNoXnrTIqH88MBzEckTMbzdtMSwTCxZkZQjaBvIZl ODU7RKB5y1Wz72rIHOXdfAvgHW+IHvVQgHbiuJC88SDrHtiB4DtysBF1utAbdOBdkmki 1ooS/zSg+dTgA9jMN8H9l1p5GTSQqVT/T8jN2s3vbcEiK6Mz7hUlsmEb6OG+1OpwkVuh OPSx3unm2KXaJNEIBvjKkTLCAdDEgq4IOKqgv7Ss42DaPgxl5/OQHm+du1cc2EHnWAoV Ve48IJvatsYahio5pqscAtPngnuNYeWJzmpRcrnXGi9rmIKR93HVoaKBsJyGnWu2WR+/ brtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=A4CnDSGICuEnb6KiAyzYeSFQ7/CFQbPVqB0bqQzZVrQ=; b=R4xPDM//cMSe9pHwSZpyPB8fa2jEiDo0b4HNfnTRF6AX+VY5TEC+9mipu0Wsv277PH 0T2dgEHuAEbqa6weTHBU0Eb+KAfK7u+MwlN1QMdgUBD/e83EId1ukigEl4WQFsERuBAr wVXQ6UUrT+Goz8opq0uip68czcYxhdQq/+psFFjIrLSsAQy0A6L4iWBesllAc++t0Rj0 XScb5jYlRljDMME5bYyfljwrbk4R1t2slR0EoC+P3wYkxok6nbbscLAmDth6UdVg/aoA Ci1ri7VMMmcJlGduZccYrSLNsIVgoxck/CzmvpnH1Xf7+eFcmm0l+k3z87foazAJoUhq AFBg== X-Gm-Message-State: APjAAAXcz8XTlmx8qE6Ji03SwQyBKnwoEU9Gg9ERocKxPH4FMA4cAnfz Bl4DL9Ur/SDQpEYm/QCIr6F4315p X-Google-Smtp-Source: APXvYqy2zrTZLGZFqK9+9gKPqUzM1/97PjLRTDWbq8fk3h/HjBtfi5IWc3dzrC7XB+YWbd1VWla2jA== X-Received: by 2002:ac8:260d:: with SMTP id u13mr4001026qtu.32.1553110468642; Wed, 20 Mar 2019 12:34:28 -0700 (PDT) Original-Received: from [128.30.9.213] (30-9-213.wireless.csail.mit.edu. [128.30.9.213]) by smtp.googlemail.com with ESMTPSA id u57sm2048822qta.12.2019.03.20.12.34.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Mar 2019 12:34:27 -0700 (PDT) In-Reply-To: <83pnqlsb8l.fsf@gnu.org> Content-Language: en-GB X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::831 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:234418 Archived-At: On 2019-03-20 13:32, Eli Zaretskii wrote: >> From: Clément Pit-Claudel >> Date: Wed, 20 Mar 2019 10:55:43 -0400 >> >> Users on Flycheck are complaining about poor readability of our fringe bitmaps on high-DPI monitors, as the bitmaps look tiny on such screens. An easy fix is to double the size of the bitmap, but it leaves users of low-DPI monitors in the cold. A trickier fix would be to dynamically detect the current monitor's density, and pick the appropriate bitmap accordingly, but I'm not entirely sure how to do detect these high-DPI monitors: >> >> - x-display-monitor-attributes-list seems OK, but looks more complex than what we need (based on looking at the C code) — is it OK to call it repeatedly to figure out the current monitor's density for a given frame? > > That'd be very inelegant, IMO. Understood. Thanks for your input! (And for the quick answer) > Instead, I think when a frame is created, we should record its > high-DPI state in the frame structure, or maybe in the frame's > parameters, and then use that when we prepare the fringe bitmaps for > display. That would be nice. In fact, we already have code to detect high-DPI displays in C, in x_get_scale_factor in xterm.c (used to scale wavy underlines). Would the way to go be to record the value returned by this function in the frame's parameters? >> Also, how do applications typically deal with frames being moved from a low-DPI monitor to a high-DPI one? Is that an issue in practice? > > If a frame can be moved from high-DPI to low-DPI, then I guess we will > need to query the low-level interfaces which report that in > update_frame or thereabouts. Got it. Thanks! I guess that another approach would be to support scalable images in the fringe, rather than bitmaps. If the fringe image was SVG instead of a bitmap, for example, we could make it fill the whole width of the fringe. Do you have a sense of how hard that would be? Clément.