high refresh rate movement

This commit is contained in:
jon 2020-07-07 21:26:27 +02:00
parent 5d1276a58a
commit feb9e222e5
4 changed files with 10 additions and 8 deletions

View File

@ -529,6 +529,6 @@ static inline void wintype_arr_enable(bool arr[]) {
} }
/** /**
* Get current system clock in milliseconds. * Get current system clock in 40 microseconds.
*/ */
int64_t get_time_ms(void); int64_t get_time_ms(void);

View File

@ -203,7 +203,7 @@ static void configure_win(session_t *ps, xcb_configure_notify_event_t *ce) {
auto mw = (struct managed_win *)w; auto mw = (struct managed_win *)w;
float t = get_time_ms(); float t = get_time_ms();
if (mw->oldX == -30000 && mw->oldY == -30000 && mw->oldW == 0 && mw->oldH == 0) { if (mw->oldX == -500 && mw->oldY == -500 && mw->oldW == 0 && mw->oldH == 0) {
if (!mw->isOld) { if (!mw->isOld) {
/* mw->isOld = true; */ /* mw->isOld = true; */

View File

@ -124,14 +124,16 @@ static inline void free_xinerama_info(session_t *ps) {
} }
/** /**
* Get current system clock in milliseconds. * Get current system clock in 40micro second accuracy.
*/ */
int64_t get_time_ms(void) { int64_t get_time_ms(void) {
struct timespec tp; struct timespec tp;
clock_gettime(CLOCK_MONOTONIC, &tp); clock_gettime(CLOCK_MONOTONIC, &tp);
return (int64_t)tp.tv_sec * 1000 + (int64_t)tp.tv_nsec / 1000000; /* return (int64_t)tp.tv_sec * 1000 + (int64_t)tp.tv_nsec / 1000000; //ultra high refresh */
return (int64_t)tp.tv_sec * 100 + (int64_t)tp.tv_nsec / 250000; //ultra high refresh
} }
// XXX Move to x.c // XXX Move to x.c
void cxinerama_upd_scrs(session_t *ps) { void cxinerama_upd_scrs(session_t *ps) {
// XXX Consider deprecating Xinerama, switch to RandR when necessary // XXX Consider deprecating Xinerama, switch to RandR when necessary

View File

@ -1191,8 +1191,8 @@ struct win *fill_win(session_t *ps, struct win *w) {
.invert_color = false, .invert_color = false,
.blur_background = false, .blur_background = false,
.oldX = -30000, .oldX = -10000,
.oldY = -30000, .oldY = -10000,
.oldW = 0, .oldW = 0,
.oldH = 0, .oldH = 0,
@ -2088,8 +2088,8 @@ void map_win_start(session_t *ps, struct managed_win *w) {
w->a.map_state = XCB_MAP_STATE_VIEWABLE; w->a.map_state = XCB_MAP_STATE_VIEWABLE;
if (!w->isOld) { if (!w->isOld) {
w->oldX = -10000; w->oldX = -1000;
w->oldY = -10000; w->oldY = -1000;
w->oldW = 0; w->oldW = 0;
w->oldH = 0; w->oldH = 0;
} }