summaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorRichard Grenville <[email protected]>2013-01-31 22:53:44 +0800
committerRichard Grenville <[email protected]>2013-01-31 22:56:54 +0800
commitd1fb8649a4e5d2ec165bd4226d53703043678eb2 (patch)
tree79baf4b2e997aca97a748fc6e468a6e50e7773c6 /common.h
parent646390149399214ca725b93328e04e71361caa02 (diff)
downloadtdebase-d1fb8649a4e5d2ec165bd4226d53703043678eb2.tar.gz
tdebase-d1fb8649a4e5d2ec165bd4226d53703043678eb2.zip
Improvement: Change VSync mode with D-Bus & Makefile update & Misc
- Add on-the-fly VSync option modification via D-Bus, as requested by kunitoki (#80). Expose parse_vsync(), create vsync_init() and ensure_glx_context(). - Change default value of ps->drm_fd to -1. - Update Makefile. Change the install/uninstall rules and add doc installation, requested by hasufell in #85. - Mark window not damaged in map_win(). It helps in reducing flickering with inverted window color, but I'm not completely sure if it's safe. - Avoid modifying w->invert_color when window is unmapped. - Update documentation. Thanks to hasufell for pointing out.
Diffstat (limited to 'common.h')
-rw-r--r--common.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/common.h b/common.h
index 4bc57bb8f..995553bae 100644
--- a/common.h
+++ b/common.h
@@ -1167,6 +1167,20 @@ normalize_d(double d) {
return normalize_d_range(d, 0.0, 1.0);
}
+/**
+ * Parse a VSync option argument.
+ */
+static inline bool
+parse_vsync(session_t *ps, const char *str) {
+ for (vsync_t i = 0; i < (sizeof(VSYNC_STRS) / sizeof(VSYNC_STRS[0])); ++i)
+ if (!strcasecmp(str, VSYNC_STRS[i])) {
+ ps->o.vsync = i;
+ return true;
+ }
+ printf_errf("(\"%s\"): Invalid vsync argument.", str);
+ return false;
+}
+
timeout_t *
timeout_insert(session_t *ps, time_ms_t interval,
bool (*callback)(session_t *ps, timeout_t *ptmout), void *data);
@@ -1421,6 +1435,9 @@ free_winprop(winprop_t *pprop) {
void
force_repaint(session_t *ps);
+bool
+vsync_init(session_t *ps);
+
#ifdef CONFIG_DBUS
/** @name DBus handling
*/