From d1fb8649a4e5d2ec165bd4226d53703043678eb2 Mon Sep 17 00:00:00 2001 From: Richard Grenville Date: Thu, 31 Jan 2013 22:53:44 +0800 Subject: 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. --- dbus.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'dbus.c') 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); -- cgit v1.2.1