summaryrefslogtreecommitdiffstats
path: root/dbus.c
diff options
context:
space:
mode:
authorRichard Grenville <pyxlcy@gmail.com>2013-01-31 22:53:44 +0800
committerRichard Grenville <pyxlcy@gmail.com>2013-01-31 22:56:54 +0800
commitd1fb8649a4e5d2ec165bd4226d53703043678eb2 (patch)
tree79baf4b2e997aca97a748fc6e468a6e50e7773c6 /dbus.c
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 'dbus.c')
-rw-r--r--dbus.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/dbus.c b/dbus.c
index 44f1369d7..39e4cf3ad 100644
--- a/dbus.c
+++ b/dbus.c
@@ -952,6 +952,25 @@ cdbus_process_opts_set(session_t *ps, DBusMessage *msg) {
}
goto cdbus_process_opts_set_success;
}
+
+ // vsync
+ if (!strcmp("vsync", target)) {
+ const char * val = NULL;
+ if (!cdbus_msg_get_arg(msg, 1, DBUS_TYPE_STRING, &val))
+ return false;
+ if (!parse_vsync(ps, val)) {
+ printf_errf("(): " CDBUS_ERROR_BADARG_S, 1, "Value invalid.");
+ cdbus_reply_err(ps, msg, CDBUS_ERROR_BADARG, CDBUS_ERROR_BADARG_S, 1, "Value invalid.");
+ }
+ else if (!vsync_init(ps)) {
+ printf_errf("(): " CDBUS_ERROR_CUSTOM_S, "Failed to initialize specified VSync method.");
+ cdbus_reply_err(ps, msg, CDBUS_ERROR_CUSTOM, CDBUS_ERROR_CUSTOM_S, "Failed to initialize specified VSync method.");
+ }
+ else
+ goto cdbus_process_opts_set_success;
+ return true;
+ }
+
#undef cdbus_m_opts_set_do
printf_errf("(): " CDBUS_ERROR_BADTGT_S, target);