From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Akib Azmain Turja Newsgroups: gmane.emacs.devel Subject: [C source] What is gravity and the change_gravity argument? Date: Fri, 08 Jul 2022 18:40:16 +0600 Message-ID: <87wncn3hhr.fsf@disroot.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5884"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jul 08 14:41:51 2022 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 1o9nIt-0001Km-Ch for ged-emacs-devel@m.gmane-mx.org; Fri, 08 Jul 2022 14:41:51 +0200 Original-Received: from localhost ([::1]:55214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o9nIr-0005JC-Q0 for ged-emacs-devel@m.gmane-mx.org; Fri, 08 Jul 2022 08:41:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51386) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o9nHz-0004U6-Gy for emacs-devel@gnu.org; Fri, 08 Jul 2022 08:40:56 -0400 Original-Received: from knopi.disroot.org ([178.21.23.139]:34674) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o9nHx-0007rF-0Y for emacs-devel@gnu.org; Fri, 08 Jul 2022 08:40:54 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 93A9240F1C for ; Fri, 8 Jul 2022 14:40:50 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Original-Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RoeFUfAI94IK for ; Fri, 8 Jul 2022 14:40:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1657284049; bh=JRzFB4wHK1bkm1/G3mH0CPjejHkSRXe6NRtcQG5YL4s=; h=From:To:Subject:Date; b=jssNrJ8kp/kG/DXBq0mNuzlHF1ngTEgdMne7a3OYvueKE5z41d7eOf+bozfrRiC3M NxBvUqzq9jPXNFrrXRvXWgH6msgqoaEzQ9OZdWdUHCTRukFJWr8GHN4zJ1gJJ8OrkR poBI0ivyFffkGDV8FapqEjUObcHCv0hknMP4TD+1DKpNf+IcvSocr6nO0ZJ1bLIuCz RwERTq1YUuHl5dXV49hfUutdq+xv76aJGuwGIQPHAB/NZbx2RIntt0x0pgWKOSjDkF 41WuJxykq8CToDahqTIHP7za26UE770zTXdJjkTQ0Yny5qVxIKiL1e6U51u21FTR61 ow48lIeCl83Kg== Received-SPF: pass client-ip=178.21.23.139; envelope-from=akib@disroot.org; helo=knopi.disroot.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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:291952 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable In src/termhooks.h, I found the following two members of struct terminal: =2D-8<---------------cut here---------------start------------->8--- /* This hook is called to change the size of frame F's native (underlying) window. If CHANGE_GRAVITY, change to top-left-corner window gravity for this size change and subsequent size changes. Otherwise we leave the window gravity unchanged. */ void (*set_window_size_hook) (struct frame *f, bool change_gravity, int width, int height); /* CHANGE_GRAVITY is 1 when calling from Fset_frame_position, to really change the position, and 0 when calling from *_make_frame_visible (in that case, XOFF and YOFF are the current position values). It is -1 when calling from gui_set_frame_parameters, which means, do adjust for borders but don't change the gravity. */ void (*set_frame_offset_hook) (struct frame *f, register int xoff, register int yoff, int change_gravity); =2D-8<---------------cut here---------------end--------------->8--- X and PGTK uses that 'change_gravity' argument, I can't understand what they are doing with them. I searched the internet and found several answers[1], but couldn't make any sense. Footnotes: [1] https://stackoverflow.com/q/3482742/11819469 =2D-=20 Akib Azmain Turja This message is signed by me with my GnuPG key. It's fingerprint is: 7001 8CE5 819F 17A3 BBA6 66AF E74F 0EFA 922A E7F5 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEyVTKmrtL6kNBe3FRVTX89U2IYWsFAmLIJbAACgkQVTX89U2I YWs7PRAA6inTW9oQmg18afKprHvHdC1bWeOwoBNGk1GfzhUUuB9i6beJJ8gWHoVc WvTUEblmuFdchtXqamdJ7m/mMFwh+Pqsxa83El/2RgUtxOu3lSOb4uafqmuWIhR9 dY7443gxyJlx0L/DpzBC6ApNvQ22L8MwnWoYdS862bZZMqjYaXSUOZ4zsgJmuDwV yqofCLIUaziLl0nTzlXyg7O2GnAWpZEUVrNq05XTNxe2o4P4Cak6iJH6WYf1aM7Q 6pLYCGMCRXVUaXonblLDLv7i8HBeeM1f5ajJRqpJ1dllDhAccyL/mBt+kktJMxCg oK80M5W0RMNuTHG5LR1OcAMdkiCidywqEHZQTzpU/heQMskB8JwucBWmYybsn96/ bapWLxMmC3S4f/IXfQ+UWk77VNFeVLN6vsr3jOuWKD2rtGUcAV1tygygJSvq3gsN 2Da9YEvhyuhtrLCILZAgvvTec9m6UVPKrSy44S28hzK0o2lIun85BCX48ynmJd6v aptZ9x4UOBnj4asfmiKDLhxlSBC2wNz0C5AiKkXDTTMe0Eyk0+8HznMp57sQ8A4Q Q3xY5s0FcckKD3CXwcWrAfHIKrAA3e+cEZ4GxNiynKtB50b+MrBzDuE0EEqPYNtr 1ZgNDxd5JcSBVvkDAllmm3GHc1Mgg8/a4HY4bDduTRJ7o0F4sKo= =HC9F -----END PGP SIGNATURE----- --=-=-=--