From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Madhu Newsgroups: gmane.emacs.bugs Subject: bug#62135: xterm.c: (x_set_offset) Date: Tue, 02 Apr 2024 09:08:09 +0530 Message-ID: References: <20230312.065843.1304315041062918300.enometh@meer.net> <87y1o2ba50.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39851"; mail-complaints-to="usenet@ciao.gmane.io" To: 62135@debbugs.gnu.org Cancel-Lock: sha1:k7IfpRyU7CCYBy8tWQQ5n6MiJ0k= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 02 05:40:29 2024 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 1rrV0f-000AAM-PQ for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 02 Apr 2024 05:40:29 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rrV0F-0002rZ-AB; Mon, 01 Apr 2024 23:40:03 -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 1rrV0A-0002qs-Qg for bug-gnu-emacs@gnu.org; Mon, 01 Apr 2024 23:39:59 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rrV0A-0001tI-Ij for bug-gnu-emacs@gnu.org; Mon, 01 Apr 2024 23:39:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rrV0D-0003PN-P2 for bug-gnu-emacs@gnu.org; Mon, 01 Apr 2024 23:40:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <20230312.065843.1304315041062918300.enometh@meer.net> Resent-From: Madhu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 02 Apr 2024 03:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62135 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.171202919613082 (code B ref -1); Tue, 02 Apr 2024 03:40:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 2 Apr 2024 03:39:56 +0000 Original-Received: from localhost ([127.0.0.1]:52013 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rrV06-0003Ow-J8 for submit@debbugs.gnu.org; Mon, 01 Apr 2024 23:39:56 -0400 Original-Received: from lists.gnu.org ([2001:470:142::17]:53458) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rrV00-0003Oa-DK for submit@debbugs.gnu.org; Mon, 01 Apr 2024 23:39:52 -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 1rrUzr-0002oN-Bb for bug-gnu-emacs@gnu.org; Mon, 01 Apr 2024 23:39:39 -0400 Original-Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rrUzp-0001qO-UP for bug-gnu-emacs@gnu.org; Mon, 01 Apr 2024 23:39:39 -0400 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1rrUzm-0008vp-EN for bug-gnu-emacs@gnu.org; Tue, 02 Apr 2024 05:39:34 +0200 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=geb-bug-gnu-emacs@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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:282492 Archived-At: * Po Lu via <87y1o2ba50.fsf@yahoo.com> : Wrote on Sun, 12 Mar 2023 17:18:35 +0800: > 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. certainly, when called from set-frame-position. > `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. certainly, when change_gravity < 0. But I don't think this statement is true when mapping an unmapped window when change_gravity == 0. does the code in x_set_offset alter top and left positions if change_gravity == 0? unless the function changes the positions a call to XMoveWindow should not be necessary. if an existing frame has been made invisible, the x and y size hints would have been set along with USPosition and the I presume the wm (minus bugs) would use them if needed when mapping the unmapped window. likewise if a new frame is being mapped with top, left, and user-position set (I haven't double-checked this again) the wm hints would be set, and an explicit move would be unnecessary when mapping the new window. In both these cases change_gravity is set to 0, and there should be no need to move the window at this step. > Thus, the code is correct. The comment above the > function is somewhat misleading but still correct.