Clean up options/config file parsing

* Pass a options_t, not session_t
* Slightly improve error handling when setting vsync method via dbus

The goal here is to limit the scope of what a given function can access.
And session_t contains basically everything, so don't pass it around.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2018-12-21 16:25:28 +00:00
parent ee2be09958
commit cb7d852b0f
12 changed files with 729 additions and 609 deletions

View File

@ -230,6 +230,11 @@ glx_init(session_t *ps, bool need_render) {
}
}
if (ps->o.glx_swap_method > CGLX_MAX_BUFFER_AGE) {
log_error("glx-swap-method is too big");
goto glx_init_end;
}
// Get XVisualInfo
pvis = get_visualinfo_from_visual(ps, ps->vis);
if (!pvis) {
@ -436,7 +441,7 @@ glx_destroy(session_t *ps) {
glDeleteProgram(ppass->prog);
}
glx_free_prog_main(ps, &ps->o.glx_prog_win);
glx_free_prog_main(ps, &ps->glx_prog_win);
glx_check_err(ps);