main: Use a configuration option for hidding out the cursor
[src/agl-compositor.git] / src / main.c
index 164b45b..590977f 100644 (file)
@@ -1346,7 +1346,7 @@ usage(int error_code)
                "  --log=FILE\t\tLog to the given file\n"
                "  -c, --config=FILE\tConfig file to load, defaults to agl-compositor.ini\n"
                "  --no-config\t\tDo not read agl-compositor.ini\n"
-               "  --debug\t\tEnable debug extension\n"
+               "  --debug\t\tEnable debug extension(s)\n"
                "  -h, --help\t\tThis help message\n"
                "\n");
        exit(error_code);
@@ -1366,6 +1366,7 @@ int main(int argc, char *argv[])
        int help = 0;
        int version = 0;
        int no_config = 0;
+       int debug = 0;
        char *config_file = NULL;
        struct weston_log_context *log_ctx = NULL;
        struct weston_log_subscriber *logger;
@@ -1378,6 +1379,7 @@ int main(int argc, char *argv[])
                { WESTON_OPTION_BOOLEAN, "help", 'h', &help },
                { WESTON_OPTION_BOOLEAN, "version", 0, &version },
                { WESTON_OPTION_BOOLEAN, "no-config", 0, &no_config },
+               { WESTON_OPTION_BOOLEAN, "debug", 0, &debug },
                { WESTON_OPTION_STRING, "config", 'c', &config_file },
        };
 
@@ -1390,6 +1392,7 @@ int main(int argc, char *argv[])
        wl_list_init(&ivi.remote_pending_apps);
        wl_list_init(&ivi.desktop_clients);
 
+
        /* Prevent any clients we spawn getting our stdin */
        os_fd_set_cloexec(STDIN_FILENO);
 
@@ -1428,6 +1431,8 @@ int main(int argc, char *argv[])
                if (!backend)
                        backend = choose_default_backend();
        }
+       /* from [core] */
+       weston_config_section_get_bool(section, "hide-cursor", &ivi.hide_cursor, false);
 
        display = wl_display_create();
        loop = wl_display_get_event_loop(display);
@@ -1469,6 +1474,8 @@ int main(int argc, char *argv[])
        if (ivi_desktop_init(&ivi) < 0)
                goto error_compositor;
 
+       ivi_seat_init(&ivi);
+
        if (ivi_policy_init(&ivi) < 0)
                goto error_compositor;
 
@@ -1493,7 +1500,8 @@ int main(int argc, char *argv[])
 
        ivi_shell_create_global(&ivi);
        ivi_launch_shell_client(&ivi);
-       ivi_screenshooter_create(&ivi);
+       if (debug)
+               ivi_screenshooter_create(&ivi);
        ivi_agl_systemd_notify(&ivi);
 
        wl_display_run(display);