From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ari Roponen Newsgroups: gmane.emacs.bugs Subject: bug#33442: 26.1.90; Cairo side-by-side windows scrolling fix should be cherry-picked Date: Fri, 30 Nov 2018 14:31:51 +0200 Message-ID: <87wooulpag.fsf@gmail.com> References: <87h8gc412q.fsf@gmail.com> <83wop7ivw2.fsf@gnu.org> <83in0riscq.fsf@gnu.org> <87va4qaorj.fsf@gmail.com> <1bf2b358-3ac2-46bb-f298-5c115149dea0@yandex.ru> <875zwpligs.fsf@gmail.com> <6976af8a-8fbf-da98-d770-55224a7736af@yandex.ru> <871s7dl2xg.fsf@gmail.com> <08133af3-3f70-1634-e162-ae6cfe26767f@yandex.ru> <87mupst6z6.fsf@gmail.com> <83y39cc716.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1543581070 27061 195.159.176.226 (30 Nov 2018 12:31:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 30 Nov 2018 12:31:10 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Robert Pluim , 33442@debbugs.gnu.org, dgutov@yandex.ru To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Nov 30 13:31:05 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1gShwk-0006qP-EI for geb-bug-gnu-emacs@m.gmane.org; Fri, 30 Nov 2018 13:31:02 +0100 Original-Received: from localhost ([::1]:59638 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gShyr-0008D5-1x for geb-bug-gnu-emacs@m.gmane.org; Fri, 30 Nov 2018 07:33:13 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55575) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gShyk-0008Cc-8S for bug-gnu-emacs@gnu.org; Fri, 30 Nov 2018 07:33:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gShyg-0001G0-Nh for bug-gnu-emacs@gnu.org; Fri, 30 Nov 2018 07:33:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51356) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gShyg-0001Fw-Ih for bug-gnu-emacs@gnu.org; Fri, 30 Nov 2018 07:33:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gShyg-0001qu-BE for bug-gnu-emacs@gnu.org; Fri, 30 Nov 2018 07:33:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ari Roponen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 30 Nov 2018 12:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33442 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33442-submit@debbugs.gnu.org id=B33442.15435811235470 (code B ref 33442); Fri, 30 Nov 2018 12:33:02 +0000 Original-Received: (at 33442) by debbugs.gnu.org; 30 Nov 2018 12:32:03 +0000 Original-Received: from localhost ([127.0.0.1]:55614 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gShxi-0001Pv-DO for submit@debbugs.gnu.org; Fri, 30 Nov 2018 07:32:02 -0500 Original-Received: from mail-lf1-f65.google.com ([209.85.167.65]:37158) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gShxg-0001Ka-KH for 33442@debbugs.gnu.org; Fri, 30 Nov 2018 07:32:01 -0500 Original-Received: by mail-lf1-f65.google.com with SMTP id p17so3997615lfh.4 for <33442@debbugs.gnu.org>; Fri, 30 Nov 2018 04:32:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=FOGJEx5XfoJV7GHYzIls7hfJvNSGaCC4ne53vToEu+M=; b=HWXuDufCGe/7jSd+2QCDLySdozVQ+mP8koK8MREXPLndAZVCORdAsBgqW0jNX7B2th 2qp78tebg+iOisEj9WlZjMQ6dID5QPk96lvKiYxlHaP+64C/BcKJQ61FOn7eQ6M196ji p61q/KQv94gdHQyNgJklM0ZWUf4e6XJK35oEhkoZTXIVkNvGmINm8ksrrfAk+4Tkp5/n YsvisAYTYnLP743wmz60pS6vcHoXJPAo3rceWj8+KZ6osBOOPKiwo2zHv5DbkhJE9uXS bweehU5JoPvla6vT6i+828yh91RuWP3WltEToT5qpslZ4oFy4WmkfaiyWrJCVrbCz6F6 WHiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=FOGJEx5XfoJV7GHYzIls7hfJvNSGaCC4ne53vToEu+M=; b=eGCMY/BPQ/XVtN90TMFTlFk1MpT3feOWwXWKbEeLyWyotf24t3LtWNVAIgZDoDq9iU fLGFGi0X9tuke8TPextztMnRvoK7kfs7BU6GHHyRQ5s52BRbjkoHM/wAlnlZCAEZ5B1b SMvnXqMLcL6LP+7/ncCxhTvOjToJL4cP8rRiI8AWZLrGCpiUX0brvtqqvJzUlj9vIYvh IczDTroYAdp9jkCHQgwyQTXon9ZCMcS1tXuL1LUpMWo+vLjOQgZF6oRlF9FI4R4uDZrF F6KGLclulODdCXVEy+MUwfocIuJ99dWBVYPwIizNmSZH/SxtZJyXajrjpKGrqT9JBKZr kJDg== X-Gm-Message-State: AA+aEWbReV75J25UZblTpAJPm65yvZtsfS9b0tKzZuPqkHyWrp6gnn+I e1D96lJ7/g4UxhyAzEFsPQ== X-Google-Smtp-Source: AFSGD/Ue6U/AVDGPYpeLvhfxxys+1/NPj0XSn0nVWlNBaJyE5C73O8jlFixWm0kZUHgxEIzNHeqo+w== X-Received: by 2002:a19:6a13:: with SMTP id u19mr3392903lfu.46.1543581114704; Fri, 30 Nov 2018 04:31:54 -0800 (PST) Original-Received: from arirop ([2001:2003:f7ce:f380:108a:51ca:c7e7:3af4]) by smtp.gmail.com with ESMTPSA id o88sm780445lfk.38.2018.11.30.04.31.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 30 Nov 2018 04:31:53 -0800 (PST) In-Reply-To: <83y39cc716.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 29 Nov 2018 16:06:29 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:152933 Archived-At: Eli Zaretskii writes: >> From: Robert Pluim >> Date: Thu, 29 Nov 2018 14:19:56 +0100 >> Cc: 33442@debbugs.gnu.org, Dmitry Gutov >> >> > With the following patch, GDK_SCALE=2 seems to work for me. >> > >> >> Works for me. Since this is all Cairo-only code, it could even go into >> emacs-26, I think (with a ChangeLog and perhaps some comments). > > OK, let's do that. > The following patch fixes the scaling problem in Cairo builds. The scrolling issue with side-by-side windows is in master branch (commit 6e362a32bc9d21f73a0f29ca6f45481edeea6f29), and can be cherry-picked. >From c76a784f7c345031f9bf1f88d2e4b13e44053638 Mon Sep 17 00:00:00 2001 From: Ari Roponen Date: Fri, 30 Nov 2018 14:09:09 +0200 Subject: [PATCH 1/1] Fix scaling problem in cairo builds * src/xterm.c (x_begin_cr_clip) [USE_GTK]: (x_update_begin) [USE_CAIRO && USE_GTK]: Support scaling. --- src/xterm.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/xterm.c b/src/xterm.c index 3a7e31e712..42ddc4f5b1 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -360,10 +360,15 @@ x_begin_cr_clip (struct frame *f, GC gc) if (! FRAME_CR_SURFACE (f)) { + int scale = 1; +#ifdef USE_GTK + scale = xg_get_scale (f); +#endif + FRAME_CR_SURFACE (f) = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, - FRAME_PIXEL_WIDTH (f), - FRAME_PIXEL_HEIGHT (f)); + scale * FRAME_PIXEL_WIDTH (f), + scale * FRAME_PIXEL_HEIGHT (f)); } cr = cairo_create (FRAME_CR_SURFACE (f)); FRAME_CR_CONTEXT (f) = cr; @@ -999,8 +1004,9 @@ x_update_begin (struct frame *f) if (FRAME_GTK_WIDGET (f)) { GdkWindow *w = gtk_widget_get_window (FRAME_GTK_WIDGET (f)); - width = gdk_window_get_width (w); - height = gdk_window_get_height (w); + int scale = xg_get_scale (f); + width = scale * gdk_window_get_width (w); + height = scale * gdk_window_get_height (w); } else #endif -- 2.19.2