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: Wed, 22 Jan 2020 10:08:43 +0100 Message-ID: References: <2056a194.3971.16f8d4dd4c5.Coremail.tumashu@163.com> <4fc23d82-7a6a-6011-698a-b4f9d7eb6a53@yandex.ru> <5597826b-98b3-179d-ba9a-2deb314cba44@gmx.at> <2d112f1b-ea8e-ac49-1dac-9218db32f6fc@yandex.ru> <44dfe3ee-5c08-9a60-a642-8411c8e22921@yandex.ru> <35329f93-d7a9-e845-ddb4-9c4edec5fb43@yandex.ru> <53c7798d-3022-d4bd-af56-ea4a5181a887@gmx.at> <15405719-d58d-44db-f1df-ad3bb272b2fc@yandex.ru> <437eae9b-ccc1-3875-86b7-1af0e61b6e15@gmx.at> <710da57c-28dc-fab7-81af-0318a9389d6a@yandex.ru> <0e41cd9e-8be3-f67a-6958-7bad38ee1266@gmx.at> <6c86c25b-22df-2b69-34fe-539605f624ba@yandex.ru> <7dd69fe5-4ef4-782c-2fba-031d475f6406@yandex.ru> <32fb4915-be55-f753-5f6c-423a09030fd6@gmx.at> <8b252ea4-5902-d21e-a0d7-cdb3ddbb4e08@yandex.ru> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------96218FBE0F4298C7A5547DA4" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="36485"; 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 Wed Jan 22 10:11:47 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 1iuC39-0009Rg-9s for ged-emacs-devel@m.gmane-mx.org; Wed, 22 Jan 2020 10:11:47 +0100 Original-Received: from localhost ([::1]:38838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuC38-00067u-4Y for ged-emacs-devel@m.gmane-mx.org; Wed, 22 Jan 2020 04:11:46 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50006) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuC0K-0004k7-5s for emacs-devel@gnu.org; Wed, 22 Jan 2020 04:08:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iuC0J-0008NK-22 for emacs-devel@gnu.org; Wed, 22 Jan 2020 04:08:52 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]:33509) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iuC0I-0008Mu-O4 for emacs-devel@gnu.org; Wed, 22 Jan 2020 04:08:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1579684125; bh=QebrzmxNbjmm7N3e+jO1cItumeGjlAC07tpoPuIOAt8=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=Z6ps1/1rUjBn+eXtBB6LOr0A3OmhfPU0v9DMixZSl3b8lQsXCvEqz5Llh7SYBPRr7 s4ffzcR4ONVc9PCYhkxGdbYbQRSHlU3nY0W/3xUlJ9+wzcOmI+mJpmkFo2dp8tYNm5 h6bpcn5I2UgFUrmNsQHFoMg71GoQEzSUHXrmlpMA= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [192.168.1.101] ([46.125.249.39]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MvsIv-1jn7u72xj5-00swVZ; Wed, 22 Jan 2020 10:08:44 +0100 In-Reply-To: <8b252ea4-5902-d21e-a0d7-cdb3ddbb4e08@yandex.ru> Content-Language: en-US X-Provags-ID: V03:K1:vAxn+kRzsxRCze+onQJMrW7DL8LvCrm7VOttuTvBNGygqLk+H3/ SLxyCe1lnYbWraWxOK6QX0SqThwsKcPcHflKL13Fv3r8YabKbJoK4yQ0HyM07RCG+C9uQxt yl0VV6STVymMqJ93deEhBHU0hhJenq8WVGYRbYu5ONc+VZbA7hZKCezJ1Fj152vetrmNkHc m7RMae6wtmzunYgiyRChw== X-UI-Out-Filterresults: notjunk:1;V03:K0:HyGCr1Zll/8=:1TPRV/NmzD3hh4/35ASuJl /wnqkUJBrc0TT76N8o4cSn+mICiOEaGPzXCwVI1OHqbQ2qI0wR/oiD8JyrPGZsX3BdPNQx23H T7cXQ04RIW7lgv317wIhtprLDpbrhfc45chg+Je14dJvpz9QitV4jEqaM29lUcraaF5dWlaJw b2dZwZdYDthw7sRCxfkHYGiHTjDqrp+LxoH0uDm3BWeiKBBkJ4TTM6RpSbUQoTattfm7jxa/y W/VSZPnRkjiB50Y26pC8O5IKxGM8cJqQtaH9GIubmwIIz5YZpqk42vBzD39qPxk6W9T6roASF 7EHxfWozYDzP0gxLYaMG68OxIOQdN0ZFc3vAJhfsm5qS2jbL5BIlifR8ulYNW4EcpBQYl8Aat 2y/DqHOJxWuVZc+5FDytTbjP3wHllUtkCHsCRqQQmkIGz7mgc5lRB+X/j4T7XSLh4Cfy4fAxT 4t31uPZ6ZeocsOKysBBI++VtIplyaJgVaglrh6l4CoFAvD5OifpOPC0UofBSPcIMgMfbeP1/H QEnJu5qCN/hrF9b+kil9wAZVOs+prkSfkbCBfF9FA19uBo4iJ/4rq72Jw4cE9FHH+5FSos9+x aGd9TBthhSXrebRVT4WjAGgZbfK7E5+UhGM1ONt316Ef29lKmGTMJvRpXIkFvKTWbvpSrlY8A uBkJH1H4WQWA95ZfOetC7sZkj4b9VlcihboQznz79EzKa/z5rOMFmDX/4hYVG44r4VSP1i11z kM1ycII9uZ1xtPP2EIKur0RVJYOTjTHhXE+3La1zrOgsg4GMzsB9zaJwqOjY3V+98+6RBdxc X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.15.15 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:244488 Archived-At: This is a multi-part message in MIME format. --------------96218FBE0F4298C7A5547DA4 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit >> Because the frame has to resize _and_ move. GTK has an internal >> function that moves and resizes a window in one go but I haven't seen an >> external interface to it. > > But I can drag it smoothly (by the mode-line), and I can resize it smoothly. It kind of weird that drag+resize is more than 2x as slow. It's not only weird. IIUC it's also wrong sometimes. I guess parts of Emacs' readjust-positions code get into the way here. > Does building with '-Og' help? It's really fast here, faster than GTK by an order of magnitude (or two). I haven't tried it. What I need is an executable I can debug reliably. >> Next thing to try: Before the >> >> gtk_window_get_size (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), >> &gwidth, &gheight); >> >> lines in xg_frame_set_char_size insert the two lines >> >> if (!gtk_window_get_resizable (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)))) >> gtk_window_set_resizable (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), TRUE); >> >> put a breakpoint on the second one and tell me whether you get a hit. >> Just to make sure ... > > Still no luck (hits line 960, but not 961). So at least no-one interferes with this. Next thing to try is to always run XResizeWindow and XMoveWindow for GTK child windows. This should avoid any GTK related checks for them. The attached patch has three hunks. Try them all first and maybe try to only apply the last one (or the last two) afterwards. Here it breaks my "moving the left or top border of GTK child frames" behavior. martin --------------96218FBE0F4298C7A5547DA4 Content-Type: text/x-patch; name="xterm.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="xterm.diff" diff --git a/src/xterm.c b/src/xterm.c index 21d99f0c7b..02055f133f 100644 =2D-- a/src/xterm.c +++ b/src/xterm.c @@ -10604,9 +10604,13 @@ x_set_offset (struct frame *f, register int xoff,= register int yoff, int change_ } #ifdef USE_GTK - /* Make sure we adjust for possible scaling. */ - gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), - modified_left / scale, modified_top / scale); + if (FRAME_PARENT_FRAME (f)) + XMoveWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), + modified_left, modified_top); + else + /* Make sure we adjust for possible scaling. */ + gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), + modified_left / scale, modified_top / scale); #else XMoveWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f), modified_left, modified_top); @@ -11355,9 +11359,14 @@ x_set_window_size_1 (struct frame *f, bool change= _gravity, int old_height =3D FRAME_PIXEL_HEIGHT (f); Lisp_Object fullscreen =3D get_frame_param (f, Qfullscreen); - if (change_gravity) - f->win_gravity =3D NorthWestGravity; - x_wm_set_size_hint (f, 0, false); + + if (!FRAME_PARENT_FRAME (f)) + { + if (change_gravity) + f->win_gravity =3D NorthWestGravity; + + x_wm_set_size_hint (f, 0, false); + } /* When the frame is fullheight and we only want to change the width or it is fullwidth and we only want to change the height we should @@ -11489,7 +11498,7 @@ x_set_window_size (struct frame *f, bool change_gr= avity, } #ifdef USE_GTK - if (FRAME_GTK_WIDGET (f)) + if (FRAME_GTK_WIDGET (f) && !FRAME_PARENT_FRAME (f)) xg_frame_set_char_size (f, width, height); else x_set_window_size_1 (f, change_gravity, width, height); --------------96218FBE0F4298C7A5547DA4--