[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [C source] What is gravity and the change_gravity argument?
From: |
Eli Zaretskii |
Subject: |
Re: [C source] What is gravity and the change_gravity argument? |
Date: |
Fri, 08 Jul 2022 15:52:32 +0300 |
> 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