Move w->bounding_shape to local coordinates

This way we don't need to update the bounding region after window moves.

Also add some comments about the coordinate systems in compton.
Also change a few function that takes a `bool global` parameter to
always return region in local coordinates.
This commit is contained in:
Yuxuan Shui
2018-10-13 01:17:59 +01:00
parent 4f071ffc30
commit aa2098eefd
4 changed files with 73 additions and 47 deletions

View File

@ -1028,6 +1028,16 @@ typedef struct session {
#endif
} session_t;
/**
* About coordinate systems
*
* In general, X is the horizontal axis, Y is the vertical axis.
* X goes from left to right, Y goes downwards.
*
* Global: the origin is the top left corner of the Xorg screen.
* Local: the origin is the top left corner of the window, including border.
*/
/// Structure representing a top-level window compton manages.
struct win {
/// Pointer to the next lower window in window stack.
@ -1061,7 +1071,8 @@ struct win {
xcb_damage_damage_t damage;
/// Paint info of the window.
paint_t paint;
/// Bounding shape of the window.
/// Bounding shape of the window. In local coordinates.
/// See above about coordinate systems.
region_t bounding_shape;
/// Window flags. Definitions above.
int_fast16_t flags;