From: 陈宇迪 <jodieydchen@gmail.com>
To: martin rudalics <rudalics@gmx.at>
Cc: Po Lu <luangruo@yahoo.com>,
65183@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>
Subject: bug#65183: 29.1; Child frame moving and resizing problems
Date: Sun, 13 Aug 2023 14:34:15 +0100 [thread overview]
Message-ID: <CACuMiX5YffmXmPqEiLNhQyEB+=27nCFvGdvg_D5bHKAV=V-1Rw@mail.gmail.com> (raw)
In-Reply-To: <4a241eb8-2ac7-78b4-a6ce-bf7b9a1c477b@gmx.at>
[-- Attachment #1: Type: text/plain, Size: 2304 bytes --]
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@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
>
[-- Attachment #2: Type: text/html, Size: 3179 bytes --]
next prev parent reply other threads:[~2023-08-13 13:34 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-09 14:28 bug#65183: 29.1; Child frame moving and resizing problems 陈宇迪
2023-08-10 8:55 ` Eli Zaretskii
[not found] ` <CACuMiX6AnPcrhPOni-jgr5NmJ9-qG5UXCE5cFB_vN8b2OLZcjQ@mail.gmail.com>
2023-08-10 17:31 ` Eli Zaretskii
2023-08-11 7:06 ` martin rudalics
2023-08-11 8:01 ` 陈宇迪
2023-08-11 10:00 ` martin rudalics
2023-08-11 16:09 ` 陈宇迪
2023-08-12 0:13 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-12 7:00 ` martin rudalics
2023-08-12 6:52 ` martin rudalics
2023-08-12 13:55 ` 陈宇迪
2023-08-13 7:21 ` martin rudalics
2023-08-13 13:34 ` 陈宇迪 [this message]
2023-08-15 6:38 ` martin rudalics
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='CACuMiX5YffmXmPqEiLNhQyEB+=27nCFvGdvg_D5bHKAV=V-1Rw@mail.gmail.com' \
--to=jodieydchen@gmail.com \
--cc=65183@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=luangruo@yahoo.com \
--cc=rudalics@gmx.at \
/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).