From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: Emacs's set-frame-size can not work well with gnome-shell? Date: Fri, 21 Feb 2020 17:08:17 +0100 Message-ID: References: <2056a194.3971.16f8d4dd4c5.Coremail.tumashu@163.com> <414ade05-1ae6-75c2-9af1-e1eee42799a0@yandex.ru> <44010781-43f0-3bc3-06ed-475c526dee36@gmx.at> <70813591-8c24-cb30-8ecf-0c413a51f472@gmx.at> <81215100-3476-9d2c-f535-f57fbd18fd8b@yandex.ru> <8a485c09-535a-97e6-9817-31e6d2f93adb@gmx.at> <0734f22f-9237-d46a-27d5-016444f48d70@gmx.at> <5e28c37f-95a9-a5ae-d73c-b5bb769154c0@yandex.ru> <4c0993c7-0583-8573-60c5-ab0a92121fd3@gmx.at> <4b114f01-d8d9-2c33-6312-1e2e60a5d462@yandex.ru> <127bb534-e77c-bad0-683b-92c206feeba1@yandex.ru> <2af76486-f976-eef0-683c-45b7ea6c54eb@gmx.at> <090b65ce-f90a-c959-c72b-be73d5a2eb19@yandex.ru> <15b20ca9-b684-1ad5-3a25-822a00736c69@yandex.ru> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------B40E25451E1358C3C5F19560" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="43144"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "emacs-devel@gnu.org" To: Dmitry Gutov , tumashu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Feb 21 17:13:02 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 1j5AvG-000B86-8E for ged-emacs-devel@m.gmane-mx.org; Fri, 21 Feb 2020 17:13:02 +0100 Original-Received: from localhost ([::1]:60600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j5AvF-00061q-10 for ged-emacs-devel@m.gmane-mx.org; Fri, 21 Feb 2020 11:13:01 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44278) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j5Aqq-00028y-G9 for emacs-devel@gnu.org; Fri, 21 Feb 2020 11:08:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j5Aqo-0005yG-Dz for emacs-devel@gnu.org; Fri, 21 Feb 2020 11:08:27 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]:53669) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j5Aqm-0005wg-RI for emacs-devel@gnu.org; Fri, 21 Feb 2020 11:08:25 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1582301298; bh=xkuGynySTe3zXLuyyL9qYzcX+j1tUAEDz3mtGPEMmHI=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=Ryu6gLb2+PyDEii1flMLHJ3zPkxBLZuH29XtbOcEa/mP3qh9jWFSRRfe74aXo7gNB 9YXWqyHSfkAkgiWCXOXAXU1wpDz/x4HwBYLThKSiaF/LFnkRQremhgtINVKHq+DSRZ qgms58+kfK/hkjvFhsziodx9gr4LPhVuj9snEjJU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.101] ([212.95.5.192]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M3lc9-1j60C91hxL-000w0h; Fri, 21 Feb 2020 17:08:18 +0100 In-Reply-To: <15b20ca9-b684-1ad5-3a25-822a00736c69@yandex.ru> Content-Language: en-US X-Provags-ID: V03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detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.19 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:245017 Archived-At: This is a multi-part message in MIME format. --------------B40E25451E1358C3C5F19560 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit >> So it doesn't flicker when the frame doesn't need a resize? Maybe GTK >> catches that. > > Yup. Maybe. In either case I'd have thought that the now attached patch is needed to avoid a flicker when the frame does not need to be resized (and we still would hide the frame and make it visible again) but apparently it's not needed). > The benchmarks that I posted earlier in this discussion did show that Lucid is very fast at resizing. Resizing only, I suppose. We seemed to agree earlier that Lucid is slow at repositioning + resizing. martin --------------B40E25451E1358C3C5F19560 Content-Type: text/x-patch; name="hide-child-frame-during-resize.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="hide-child-frame-during-resize.diff" diff --git a/src/gtkutil.c b/src/gtkutil.c index 6308c38f16..713a46899c 100644 =2D-- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -940,9 +940,8 @@ xg_frame_resized (struct frame *f, int pixelwidth, int= pixelheight) } } -/* Resize the outer window of frame F after changing the height. - COLUMNS/ROWS is the size the edit area shall have after the resize. *= / - +/** Resize the outer window of frame F. WIDTH and HEIGHT are the new + pixel sizes of F's text area. */ void xg_frame_set_char_size (struct frame *f, int width, int height) { @@ -953,6 +952,7 @@ xg_frame_set_char_size (struct frame *f, int width, in= t height) int totalheight =3D pixelheight + FRAME_TOOLBAR_HEIGHT (f) + FRAME_MENUBAR_HEIGHT (f)= ; int totalwidth =3D pixelwidth + FRAME_TOOLBAR_WIDTH (f); + bool was_visible =3D false; if (FRAME_PIXEL_HEIGHT (f) =3D=3D 0) return; @@ -1001,8 +1001,26 @@ xg_frame_set_char_size (struct frame *f, int width,= int height) (f, Qxg_frame_set_char_size_3, width, height, list2i (totalwidth, totalheight)); + if (FRAME_PARENT_FRAME (f) && FRAME_VISIBLE_P (f) + && x_gtk_hide_child_frame_during_resize + && (totalwidth !=3D gwidth || totalheight !=3D gheight)) + { + was_visible =3D true; + block_input (); + gtk_widget_hide (FRAME_GTK_OUTER_WIDGET (f)); + unblock_input (); + } + gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), totalwidth, totalheight); + + if (was_visible) + { + block_input (); + gtk_widget_show_all (FRAME_GTK_OUTER_WIDGET (f)); + unblock_input (); + } + fullscreen =3D Qnil; } @@ -1016,7 +1034,7 @@ xg_frame_set_char_size (struct frame *f, int width, = int height) size as fast as possible. For unmapped windows, we can set rows/cols. When the frame is mapped again we will (hopefully) get the correct size. = */ - if (FRAME_VISIBLE_P (f)) + if (FRAME_VISIBLE_P (f) && !was_visible) { /* Must call this to flush out events */ (void)gtk_events_pending (); diff --git a/src/xterm.c b/src/xterm.c index 21d99f0c7b..95109baf46 100644 =2D-- a/src/xterm.c +++ b/src/xterm.c @@ -13747,4 +13747,9 @@ syms_of_xterm (void) consuming frame position adjustments. In newer versions of GTK, Emacs always uses gtk_window_move and ignores the value of this variable. */); x_gtk_use_window_move =3D true; + + DEFVAR_BOOL ("x-gtk-hide-child-frame-during-resize", x_gtk_hide_child_f= rame_during_resize, + doc: /* Non-nil means hide child frame during resize. +Set this only if your window manager refuses to resize child frames. */)= ; + x_gtk_hide_child_frame_during_resize =3D false; } --------------B40E25451E1358C3C5F19560--