diff options
author | Richard Grenville <[email protected]> | 2013-01-30 13:41:08 +0800 |
---|---|---|
committer | Richard Grenville <[email protected]> | 2013-01-30 13:41:08 +0800 |
commit | 646390149399214ca725b93328e04e71361caa02 (patch) | |
tree | a15d118aa7a5a2c325116d46815f0f05ad98faa3 /compton.h | |
parent | e5264dd40304d434585bffa0933ca5fe285035aa (diff) | |
download | tdebase-646390149399214ca725b93328e04e71361caa02.tar.gz tdebase-646390149399214ca725b93328e04e71361caa02.zip |
Improvement #7: Add GLX_OML_sync_control VSync support
- Add "vsync-oml" VSync method, using GLX_OML_sync_control. Untested,
because it's not supported by my driver.
- Unredirect ps->reg_win, because DRI wiki says it's related to the
behavior of OpenGL VSync extensions.
- Add glFlush() and glXWaitX() calls, in hope they are slightly helpful
for VSync.
- Change a few functions to make error handling more graceful. Make some
errors fatal. Code clean-up.
- Add unused function make_text_prop().
Diffstat (limited to 'compton.h')
-rw-r--r-- | compton.h | 33 |
1 files changed, 29 insertions, 4 deletions
@@ -216,6 +216,25 @@ ms_to_tv(int timeout) { }; } +/** + * Create a XTextProperty of a single string. + */ +static inline XTextProperty * +make_text_prop(session_t *ps, char *str) { + XTextProperty *pprop = malloc(sizeof(XTextProperty)); + if (!pprop) + printf_errfq(1, "(): Failed to allocate memory."); + + if (XmbTextListToTextProperty(ps->dpy, &str, 1, XStringStyle, pprop)) { + if (pprop->value) + XFree(pprop->value); + free(pprop); + pprop = NULL; + } + + return pprop; +} + static void run_fade(session_t *ps, win *w, unsigned steps); @@ -685,8 +704,8 @@ ev_window(session_t *ps, XEvent *ev); static void __attribute__ ((noreturn)) usage(void); -static void -register_cm(session_t *ps, bool want_glxct); +static bool +register_cm(session_t *ps, bool glx); inline static void ev_focus_in(session_t *ps, XFocusChangeEvent *ev); @@ -878,9 +897,15 @@ vsync_drm_wait(session_t *ps); static bool vsync_opengl_init(session_t *ps); +static bool +vsync_opengl_oml_init(session_t *ps); + #ifdef CONFIG_VSYNC_OPENGL -static void +static int vsync_opengl_wait(session_t *ps); + +static int +vsync_opengl_oml_wait(session_t *ps); #endif static void @@ -889,7 +914,7 @@ vsync_wait(session_t *ps); static void init_alpha_picts(session_t *ps); -static void +static bool init_dbe(session_t *ps); static void |