From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: emacs-27 c49d379: Fix some problems with moving and resizing child frames Date: Wed, 8 Apr 2020 06:33:52 +0300 Message-ID: References: <20200406072405.19842.29678@vcs0.savannah.gnu.org> <20200406072406.9C05720A26@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------D9A8CC4736F1FE22FEEF7261" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="129193"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 To: emacs-devel@gnu.org, Martin Rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Apr 08 05:34:38 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jM1U6-000XVX-NV for ged-emacs-devel@m.gmane-mx.org; Wed, 08 Apr 2020 05:34:38 +0200 Original-Received: from localhost ([::1]:55592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jM1U5-0006c6-P4 for ged-emacs-devel@m.gmane-mx.org; Tue, 07 Apr 2020 23:34:37 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41177) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jM1TR-0006Ck-9C for emacs-devel@gnu.org; Tue, 07 Apr 2020 23:33:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jM1TQ-0007My-5W for emacs-devel@gnu.org; Tue, 07 Apr 2020 23:33:57 -0400 Original-Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:33844) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jM1TP-0007M1-S7 for emacs-devel@gnu.org; Tue, 07 Apr 2020 23:33:56 -0400 Original-Received: by mail-wr1-x436.google.com with SMTP id 65so6171412wrl.1 for ; Tue, 07 Apr 2020 20:33:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=TqTKIJr4u/6RVoWt2n9PzAK8YNBPnlH+sAnf0yOlK/s=; b=Vx6L6i1ywIXrEWlvJyxf5zwSv/4kgJvl6/pJgu0XPtQ0w7HI9dy3ewt23hgvkP8fGn +gQWXeaSiR2qWwQhJkwN88TDfnt5CznMCCgmeIOuTmLPkuIDklZZ2RsJx2INf6XSqVCa DbxTmk3jb1UmI6CjcnYUmavCP+9GVbgPHWtiMGLikldnqjo79E1rv126e6rIhP7aN9IJ y7U4f5fw/KjWEQUsF70t0BAzV2IVmBCVQdAUgbPvwyGcvN3Mbw4OT0JD55/R2R7SoPAu +VWrTxiDqlvXa3Zr7R0K7bAkVBqJR7/nzR13Cv/3G5CrdjrPI6ilMKnv8uvN0UsGWq1w qcUw== 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:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language; bh=TqTKIJr4u/6RVoWt2n9PzAK8YNBPnlH+sAnf0yOlK/s=; b=rU++JlS+WwjwdGzl2a8HU2ElF2WsXbYO8Gk80t+7Vswh2Eqy1Crhx2y3UD0AeSPF8W G6LmcFvNcULhz67oCcgWkB67ZWkwHdS3iII31OgSnPf0nACxo6xAQq1IGVsCK+/WRmq5 v4/0zu0WFD1TED5fsqd1ZAyQUqBl6HNOIsDyQk1YNTy8rd9LDGGxC1oSbbEGfduWiqS1 0tRb2HPox0DA2/ikf0MSJr+7CdLyvOtl27l+WTEg/F6lbhm9Xv6IUhxaNB0+wyLCwmYd QyjLADEs0/i0pGm0GXIAutAoWsB1HBoEFMwTa/BPKvF20QQJlpBtwz1XhJyHUNzT07xv oUtg== X-Gm-Message-State: AGi0PuaChved0l6meLn7lhel2URUpWBijQ43tnu/WVTgQ7Xd3UnMNcGf QZXBfmnZ7Fn9l26qfnthBmI= X-Google-Smtp-Source: APiQypIJ2NZAupInxL24U7loSB22RAOnsu4FKPS2ge1AZmU+88OgLzgLrMssVIwJCGMi1nWoGcY/Vw== X-Received: by 2002:adf:f0d0:: with SMTP id x16mr6079874wro.308.1586316834823; Tue, 07 Apr 2020 20:33:54 -0700 (PDT) Original-Received: from [192.168.0.2] ([66.205.73.129]) by smtp.googlemail.com with ESMTPSA id c12sm31892627wrw.90.2020.04.07.20.33.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Apr 2020 20:33:53 -0700 (PDT) In-Reply-To: <20200406072406.9C05720A26@vcs0.savannah.gnu.org> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::436 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:246633 Archived-At: This is a multi-part message in MIME format. --------------D9A8CC4736F1FE22FEEF7261 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi Martin, On 06.04.2020 10:24, Martin Rudalics wrote: > + > + if (totalwidth != gwidth || totalheight != gheight) > + { Speaking of this optimization, can we make it apply to 'resize-mode' child frames too? I've been doing some testing, and in certain situations, the value 'hide' actually seems more performant when the size doesn't need to be changed. This largely makes a difference when, at random times, the child frame takes ~100ms to resize (which corresponds to the value of x-wait-for-event-timeout). The attached patch seems to help. --------------D9A8CC4736F1FE22FEEF7261 Content-Type: text/x-patch; charset=UTF-8; name="speedup_childframe_resizing.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="speedup_childframe_resizing.diff" diff --git a/src/gtkutil.c b/src/gtkutil.c index e374bdbe03..9fcaeed097 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -954,6 +954,7 @@ xg_frame_set_char_size (struct frame *f, int width, int height) = pixelheight + FRAME_TOOLBAR_HEIGHT (f) + FRAME_MENUBAR_HEIGHT (f); int totalwidth = pixelwidth + FRAME_TOOLBAR_WIDTH (f); bool was_visible = false; + bool hide_child_frame = false; if (FRAME_PIXEL_HEIGHT (f) == 0) return; @@ -996,26 +997,33 @@ xg_frame_set_char_size (struct frame *f, int width, int height) gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), totalwidth, gheight); } - else if (FRAME_PARENT_FRAME (f) && FRAME_VISIBLE_P (f) - && EQ (x_gtk_resize_child_frames, Qhide)) + else if (FRAME_PARENT_FRAME (f) && FRAME_VISIBLE_P (f)) { was_visible = true; + hide_child_frame = EQ (x_gtk_resize_child_frames, Qhide); if (totalwidth != gwidth || totalheight != gheight) { frame_size_history_add (f, Qxg_frame_set_char_size_4, width, height, list2i (totalwidth, totalheight)); - block_input (); - gtk_widget_hide (FRAME_GTK_OUTER_WIDGET (f)); - unblock_input (); + + if (hide_child_frame) + { + block_input (); + gtk_widget_hide (FRAME_GTK_OUTER_WIDGET (f)); + unblock_input (); + } gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), totalwidth, totalheight); - block_input (); - gtk_widget_show_all (FRAME_GTK_OUTER_WIDGET (f)); - unblock_input (); + if (hide_child_frame) + { + block_input (); + gtk_widget_show_all (FRAME_GTK_OUTER_WIDGET (f)); + unblock_input (); + } fullscreen = Qnil; } --------------D9A8CC4736F1FE22FEEF7261--