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: Sat, 25 Mar 2023 19:50:34 +0530 (IST) Message-ID: <20230325.195034.1474281229503255405.enometh@meer.net> References: <20230312.065843.1304315041062918300.enometh@meer.net> <87y1o2ba50.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6424"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 62135@debbugs.gnu.org To: luangruo@yahoo.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Mar 25 15:22:14 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 1pg4mb-0001Vh-9g for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 25 Mar 2023 15:22:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pg4mS-0002Ju-I8; Sat, 25 Mar 2023 10:22: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 1pg4mQ-0002JN-7n for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2023 10:22: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 1pg4mQ-0004Le-01 for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2023 10:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pg4mP-0008Ma-LI for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2023 10:22:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Madhu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Mar 2023 14:22:01 +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.167975408832089 (code B ref 62135); Sat, 25 Mar 2023 14:22:01 +0000 Original-Received: (at 62135) by debbugs.gnu.org; 25 Mar 2023 14:21:28 +0000 Original-Received: from localhost ([127.0.0.1]:43185 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pg4ls-0008LU-BG for submit@debbugs.gnu.org; Sat, 25 Mar 2023 10:21:28 -0400 Original-Received: from smtp5.ctinetworks.com ([205.166.61.198]:52880) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pg4lq-0008LM-Bp for 62135@debbugs.gnu.org; Sat, 25 Mar 2023 10:21:26 -0400 Original-Received: from localhost (unknown [117.193.4.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: enometh@meer.net) by smtp5.ctinetworks.com (Postfix) with ESMTPSA id 6C9FC173648; Sat, 25 Mar 2023 10:21:22 -0400 (EDT) In-Reply-To: <87y1o2ba50.fsf@yahoo.com> X-Mailer: Mew version 6.9 on Emacs 30.0.50 X-ctinetworks-Information: Please contact the ISP for more information X-ctinetworks-MailScanner-ID: 6C9FC173648.A9A3C X-ctinetworks-VirusCheck: Found to be clean X-ctinetworks-Watermark: 1680618084.76997@CP0QdHyK6AuzKhliH23Kdw 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:258581 Archived-At: * Po Lu <87y1o2ba50.fsf@yahoo.com> Wrote on Sun, 12 Mar 2023 17:18:35 +0800 > `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: > - x_wm_set_size_hint (f, 0, false); > + x_wm_set_size_hint (f, 0, true); Thanks for your note (and apologies for the delay). I think all this does is push all windows to +0+0 all the time. > #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. >From what I see in wayfire's src/view/xwayland.c: (on_configure.callback) ``` if (!is_mapped()) { /* If the view is not mapped yet, let it be configured as it * wishes. We will position it properly in ::map() */ wlr_xwayland_surface_configure(xw, ev->x, ev->y, ev->width, ev->height); if ((ev->mask & XCB_CONFIG_WINDOW_X) && (ev->mask & XCB_CONFIG_WINDOW_Y)) { ``` During make_frame_visible, This gets ev->x == 0 and ev->y == 0 (presumably from the XMoveWindow in x_set_offset) and always pins the geometry of the view at +0+0 because it has got it from the client. It declines to pass the decision to the placement manager to place the window after the window is mapped, even though no geometry was supplied (say through --geometry 80x25+0+0) The x_gtk_use_window_move codepath actually does not call gtk_window_move (because of the change_gravity conditional I mention above) , and so the configure event does not specify values for x, y. and consequently wayfire does not pin x y. however gtk still maps the window at the correct (presumably based on its wm hints) when gtk_widget_show_all is called in x_make_frame_visible, so fortuitously there isn't a problem with gtk. I cant call foul on what wayfire's is doing. would you think otherwise?