From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#62135: xterm.c: (x_set_offset) Date: Sun, 12 Mar 2023 17:18:35 +0800 Message-ID: <87y1o2ba50.fsf@yahoo.com> References: <20230312.065843.1304315041062918300.enometh@meer.net> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39534"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 62135@debbugs.gnu.org To: Madhu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 12 10:19:17 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1pbHrI-0009zS-Ee for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 12 Mar 2023 10:19:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pbHr6-0005Fu-Mi; Sun, 12 Mar 2023 05:19:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pbHr4-0005FW-Qe for bug-gnu-emacs@gnu.org; Sun, 12 Mar 2023 05:19:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pbHr4-0003lL-Il for bug-gnu-emacs@gnu.org; Sun, 12 Mar 2023 05:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pbHr4-0004V2-8a for bug-gnu-emacs@gnu.org; Sun, 12 Mar 2023 05:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Mar 2023 09:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62135 X-GNU-PR-Package: emacs Original-Received: via spool by 62135-submit@debbugs.gnu.org id=B62135.167861273917286 (code B ref 62135); Sun, 12 Mar 2023 09:19:02 +0000 Original-Received: (at 62135) by debbugs.gnu.org; 12 Mar 2023 09:18:59 +0000 Original-Received: from localhost ([127.0.0.1]:59168 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pbHr1-0004Uj-7P for submit@debbugs.gnu.org; Sun, 12 Mar 2023 05:18:59 -0400 Original-Received: from sonic301-31.consmr.mail.ne1.yahoo.com ([66.163.184.200]:34229) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pbHqz-0004UO-82 for 62135@debbugs.gnu.org; Sun, 12 Mar 2023 05:18:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1678612729; bh=lPftVYhkihbbb4uKnAp/Q9tY3QnG4iVrnKhQQh/DMKs=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=DeJDdypsHXdJtvZ9kkw3FWyP68YgYT1UlLn8dtKTyZRkKXBPqJtM1KdpHAJk+g/lGAQzdty3kZYwTNDyK3J5+gmS3oY5iIcPhEUnQXNZ5xmVsNvnW5uQxRo2LqCoPmW8c0X2Nue+Le1HhUgs1AncSxE6/IWuSazOzCnIb3iChTzR6Yxwj9KKL2DeUbXtxktlB9034rT6vPB44PyGMWb9/74aPo4fsijpMnqX42LyXF3KWqunoTgaVLqFyFnobsuvvfdeYC5IEl+0OWmDAf4W9Dkx8fhrtTk7ANMyeaGg1Zc4ulpbcf3v45JFRe8FyzF4HUCAi0QvFY3knUNacLXBQA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1678612729; bh=EoPy2udH4nRtM/wshlzP3bAmMR6FG070YJgPdln0BEC=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=EB7e7q7ZnqU+Iu2o9GX4RSEz9H+KjxWrcHaRjVozmtLd7LswQ3lEWdaslOsCeWiQ5oI3HKEmt8pkZ4niS/sEuHwfBlOx6WVlfS3Y8lynP10Me6Pc1cxAbhkyeSnR6VZBx73g1NaTYRCOZ7och1pTnK1qyF5yYpuBRdUksceDsasfuE6Pnu1zTCvlpOP5MaE1yIiRqbA34w5sZtN12U4ojEgFS1ANLYTSFuoM6VM2t4bXDRbRgIXJgca6krMvPzFlTf0TlwECFljLjTyytw16xQ4uIZMok+WMw2Q2T1mt0SQKj/Duu765FvhyrJ7jchm6yJFVfKfFciwf7fz0zaG8sA== X-YMail-OSG: aKm1NRQVM1kw89.s12z6D8fHfvy6Jq7XvqQBboD7ixtRHTsqEZYhgdsc3fXd8KF kaa.KngffAca7yxymqij1Y2daFl58L642k3Qi7m_oBo9AOqAb4pNOK0CxiAta9fGqdew1hl8fG5T qp3hJ_IyxPq6ffyMZgLBy4AV30L4vnRQKMwtKW9v19_D5P5NPYc6653CJqCye8PCKSSEjCnhFGkh YIfuh1F9GWkMqr4zFA9XIpfq8I284WmZYrXXG_d11dAbdr3FiREqm2MJLz7GmFjPJ8hd9QraynJi 8FxQt00a4gwWk9uKEYK36sHeoO_7Ng352qrtG5ZfGU.nOoSM5nMmtTt6cLqT542883Ojh1MxSqjP 43eZFjJGUS1UNmjCjzzyYN2mAAYnXyHo96xk2sft6FF1DOqcQaKtgcILCr3WLY6CgyylqbrmYCyo ASbNWDDRbteB4nl3dUP9szbHNYJRHOQjjUos.xspfIv_lYhARjcd4glchlEP46C57r4HsxQ1.fAw XYMJIU8HZgVryTbJWsDoFprus.BbZbpm2snExoeWhQdpSOwyt1.tkoJPZHnARplNX7nut1ys8hFD GSjLO2yqQPmJStGNExpRPqgWIxhFCk9nkLDPOgmc.O4_BSfYXuJlXK0xoBmNScvAD87lq8.ukYkw .5cPEdjyqariLrLu0iO_qwswk099zTzy2xBrr0TTp_2w0L3TviJ.87WiUxSY5ZBEZLDMii9cV3i. CCgqqBR3oUxJOnC44rYkEa6kUXYPx7GHy5jfSBRDUFhPEWhVtYWO26JVLt43xy6bQ.vv_oxWEPSO A1IrX_K5U4ln487OCRr2.XVdun4V.RCn6OQeAy6Okq X-Sonic-MF: X-Sonic-ID: f763e68b-5c99-45b2-a612-0a544b94e228 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.ne1.yahoo.com with HTTP; Sun, 12 Mar 2023 09:18:49 +0000 Original-Received: by hermes--production-sg3-67c57bccff-5hdhr (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 2ef12134fdd75ca614ce5b5232596fbc; Sun, 12 Mar 2023 09:18:42 +0000 (UTC) In-Reply-To: <20230312.065843.1304315041062918300.enometh@meer.net> (Madhu's message of "Sun, 12 Mar 2023 06:58:43 +0530 (IST)") X-Mailer: WebService/1.1.21284 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:257845 Archived-At: Madhu writes: > While investingating some persistent placements at 0x0 by some wm, I was > looking at x-set-offset, (which gets called via x_make_frame_visible). > > In the code below there is a comment that documents the role of the > change_gravity argument. When called from x_make_frame_visible the > parameter is set to 0, so as not to do anything. However lines > 22713-22720 perform an unconditional move window, which happens in > this code path even before the XWindow the mapped. > > 1) Shouldn't these lines be protected by a "if (change_gravity != 0) { > ... }" conditional? > > My surmise is that most wms ignore the call to XMoveWindow because it is > unmapped but at least wayfire (on Xwayland) persistently seems to > position it at 0, 0 as the code calls it. `change_gravity' means the function should update f->top_pos and f->left_pos, then reset the window gravity, as well as move the window to f->top_pos and f->left_pos. `change_gravity' < 0 means to leave f->top_pos and f->left_pos intact. However, at that point, the window's configuration is not guaranteed to have its origin at f->top_pos and f->left_pos, so the window must still be moved over. Thus, the code is correct. The comment above the function is somewhat misleading but still correct. To test out one theory of mine, please say what this does: diff --git a/src/xterm.c b/src/xterm.c index 70bcb67d80d..de5733c8b7c 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -26956,7 +26956,7 @@ x_set_offset (struct frame *f, int xoff, int yoff, int change_gravity) x_calc_absolute_position (f); block_input (); - x_wm_set_size_hint (f, 0, false); + x_wm_set_size_hint (f, 0, true); #ifdef USE_GTK if (x_gtk_use_window_move) > Also the 0x0 placement only happens on non-gtk builds, because I think > there is another bug in lines 22689-22702. x_gtk_use_window_move is > always true and gtk builds exit x_set_offset before reaching that > line. If that is the case, I think we have a bug in the x_gtk_use_window_move code, and another bug (or at least misbehavior) in Wayfire.