unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Akib Azmain Turja <akib@disroot.org>
Cc: emacs-devel@gnu.org
Subject: Re: [C source] What is gravity and the change_gravity argument?
Date: Fri, 08 Jul 2022 15:52:32 +0300	[thread overview]
Message-ID: <834jzr4vhr.fsf@gnu.org> (raw)
In-Reply-To: <87wncn3hhr.fsf@disroot.org> (message from Akib Azmain Turja on Fri, 08 Jul 2022 18:40:16 +0600)

> From: Akib Azmain Turja <akib@disroot.org>
> Date: Fri, 08 Jul 2022 18:40:16 +0600
> 
> In src/termhooks.h, I found the following two members of struct
> terminal:
> 
> --8<---------------cut here---------------start------------->8---
>   /* This hook is called to change the size of frame F's native
>    (underlying) window.  If CHANGE_GRAVITY, change to top-left-corner
>    window gravity for this size change and subsequent size changes.
>    Otherwise we leave the window gravity unchanged.  */
>   void (*set_window_size_hook) (struct frame *f, bool change_gravity,
>                                 int width, int height);
> 
>   /* CHANGE_GRAVITY is 1 when calling from Fset_frame_position,
>    to really change the position, and 0 when calling from
>    *_make_frame_visible (in that case, XOFF and YOFF are the current
>    position values).  It is -1 when calling from gui_set_frame_parameters,
>    which means, do adjust for borders but don't change the gravity.  */
> 
>   void (*set_frame_offset_hook) (struct frame *f, register int xoff,
>                                  register int yoff, int change_gravity);
> --8<---------------cut here---------------end--------------->8---
> 
> X and PGTK uses that 'change_gravity' argument, I can't understand what
> they are doing with them.  I searched the internet and found several
> answers[1], but couldn't make any sense.

Try this:

  https://tronche.com/gui/x/xlib/window/attributes/gravity.html



  reply	other threads:[~2022-07-08 12:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-08 12:40 [C source] What is gravity and the change_gravity argument? Akib Azmain Turja
2022-07-08 12:52 ` Eli Zaretskii [this message]
2022-07-08 13:06   ` Po Lu
2022-07-08 13:14   ` Akib Azmain Turja
2022-07-08 13:21     ` Po Lu
2022-07-08 13:05 ` Po Lu
2022-07-08 13:52   ` Akib Azmain Turja

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=834jzr4vhr.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=akib@disroot.org \
    --cc=emacs-devel@gnu.org \
    /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).