GNU bug report logs - #65183
29.1; Child frame moving and resizing problems

Previous Next

Package: emacs;

Reported by: 陈宇迪 <jodieydchen <at> gmail.com>

Date: Wed, 9 Aug 2023 16:37:01 UTC

Severity: normal

Found in version 29.1

Full log


View this message in rfc822 format

From: 陈宇迪 <jodieydchen <at> gmail.com>
To: martin rudalics <rudalics <at> gmx.at>
Cc: Po Lu <luangruo <at> yahoo.com>, 65183 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: bug#65183: 29.1; Child frame moving and resizing problems
Date: Sun, 13 Aug 2023 14:34:15 +0100
[Message part 1 (text/plain, inline)]
Since I'm not familiar with Emacs' source code and the ideas, I find it
difficult
to write the patch code that has fewer duplicates, covers all corner cases,
and is easy to maintain. So, I decided not to write this code.

But I'm sure the resize and move functions can solve the issue that I
mentioned
in my first email, based on my tests.

By the way, I suggest naming the function to add as
`set-frame-position-and-size'
instead of `set-frame-size-and-position', because most underlying APIs are
called
xxx_move_resize_xxx: `gdk_window_move_resize' (GTK), `XMoveResizeWindow'
(X11),
`MoveWindow(hWnd, X, Y, nWidth, nHeight, bRepaint)' (Windows).

martin rudalics <rudalics <at> gmx.at> 于2023年8月13日周日 08:21写道:

>  > But there is one thing that I don't know what the best solution is: how
> to
>  > reuse the code
>  > in the function `adjust_frame_size' (defined in src/frame.c, used by
>  > `set-frame-size')?
>  > I want to add two arguments: `new_x' and `new_y'. When  `new_x' and
> `new_y'
>  > are the
>  > same with the current frame position,
>
> ... with GNOME/mutter it's hard to tell but that shouldn't bother us
> here ...
>
>  > execute the original branch
>  > (`set_window_size_hook'
>  > or `resize_frame_window'); otherwise, call a move and resize function.
>  > But I have to rename this function to `adjust_frame_position_and_size'.
> For
>  > compatibility,
>
> Alternatively you could put new_x and new_y together with an identifier
> (say 'size_and_position') into PARAMETER and extract them before running
> the hook.  INHIBIT would be 1 anyway, so frame_inhibit_resize is of no
> concern here.
>
>  > I will also create a wrapper function called `adjust_frame_size', in
> which
>  > `adjust_frame_position_and_size' is called with the current frame
> position
>  > as the last two args
>
> This is the crucial point - rewriting all those adjust_frame_size calls
> would be a great pain.
>
>  > so that the frame will be only resized but not moved.
>  > Do you think this is an appropriate solution?
>
> I think so, yes.
>
> Before coding other backends of set_window_size_hook make sure that the
> code gives the desired results on your own system to avoid writing them
> without any gain.
>
> martin
>
[Message part 2 (text/html, inline)]

This bug report was last modified 1 year and 364 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.