unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Madhu <enometh@meer.net>
To: luangruo@yahoo.com
Cc: 62135@debbugs.gnu.org
Subject: bug#62135: xterm.c: (x_set_offset)
Date: Sat, 25 Mar 2023 19:50:34 +0530 (IST)	[thread overview]
Message-ID: <20230325.195034.1474281229503255405.enometh@meer.net> (raw)
In-Reply-To: <87y1o2ba50.fsf@yahoo.com>

*  Po Lu <luangruo@yahoo.com> <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?





  reply	other threads:[~2023-03-25 14:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-12  1:28 bug#62135: xterm.c: (x_set_offset) Madhu
2023-03-12  9:18 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-25 14:20   ` Madhu [this message]
2024-04-01 12:41     ` Madhu
2024-04-02  3:38   ` Madhu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230325.195034.1474281229503255405.enometh@meer.net \
    --to=enometh@meer.net \
    --cc=62135@debbugs.gnu.org \
    --cc=luangruo@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).