Improvement: border_size & ConfigureNotify & VSync changes

- Run XSync() before the final paint to catch VBlank better. Stolen from
  Xfwm4 VSync patch.

- Add --vsync-aggressive that sends out the final painting request
  earlier, simulating xfwm4 VSync patch. But this thing does have the
  possibility of breaking VSync, I think...

- Change handling of ConfigureNotify to avoid freeing w->extents and
  w->border_size if possible.

- Change logic in paint_prepreprocess() to use win_get_region() for
  border_size generation instead of border_size() if the window is not
  shaped to try to avoid some BadRegion error messages when a window
  loses its border_size then is unmapped, about which Adys complained in
  #25.

- Detect if w->border_size is None before using it in various places.
  Practically the effect is pretty limited because
  XFixesCreateRegionFromWindow() usually returns an invalid X ID instead
  of None on error.

- Fix a bug that rounded corner detection could fail if the window size
  is changed by a ConfigureNotify immediately.
This commit is contained in:
Richard Grenville
2012-11-01 10:43:15 +08:00
parent 35c9e44de2
commit fb2ca16cb8
2 changed files with 63 additions and 15 deletions

View File

@ -115,6 +115,8 @@ extern struct timeval time_start;
// Window size is changed
#define WFLAG_SIZE_CHANGE 0x0001
// Window size/position is changed
#define WFLAG_POS_CHANGE 0x0002
/**
* Types
@ -280,7 +282,7 @@ typedef struct _win {
struct _win *prev_trans;
} win;
typedef enum _vsync_t {
typedef enum {
VSYNC_NONE,
VSYNC_DRM,
VSYNC_OPENGL,
@ -317,6 +319,8 @@ typedef struct _options {
vsync_t vsync;
/// Whether to enable double buffer.
Bool dbe;
/// Whether to do VSync aggressively.
Bool vsync_aggressive;
// Shadow
Bool wintype_shadow[NUM_WINTYPES];