Commit 07e73896 authored by Guido Gunther's avatar Guido Gunther
Browse files

settings: Drop cursor handling

We'd use GSetting if we want it configured
parent 2753f51b
......@@ -547,16 +547,6 @@ phoc_desktop_constructed (GObject *object)
#ifdef PHOC_XWAYLAND
const char *cursor_default = ROOTS_XCURSOR_DEFAULT;
#endif
struct roots_cursor_config *cc =
roots_config_get_cursor(config, ROOTS_CONFIG_DEFAULT_SEAT_NAME);
if (cc != NULL) {
cursor_theme = cc->theme;
#ifdef PHOC_XWAYLAND
if (cc->default_image != NULL) {
cursor_default = cc->default_image;
}
#endif
}
char cursor_size_fmt[16];
snprintf(cursor_size_fmt, sizeof(cursor_size_fmt),
......
......@@ -96,34 +96,6 @@ static void add_switch_config(struct wl_list *switches, const char *switch_name,
wl_list_insert(switches, &sc->link);
}
static void config_handle_cursor(struct roots_config *config,
const char *seat_name, const char *name, const char *value) {
struct roots_cursor_config *cc;
bool found = false;
wl_list_for_each(cc, &config->cursors, link) {
if (strcmp(cc->seat, seat_name) == 0) {
found = true;
break;
}
}
if (!found) {
cc = calloc(1, sizeof(struct roots_cursor_config));
cc->seat = strdup(seat_name);
wl_list_insert(&config->cursors, &cc->link);
}
if (strcmp(name, "theme") == 0) {
free(cc->theme);
cc->theme = strdup(value);
} else if (strcmp(name, "default-image") == 0) {
free(cc->default_image);
cc->default_image = strdup(value);
} else {
wlr_log(WLR_ERROR, "got unknown cursor config: %s", name);
}
}
static const char *output_prefix = "output:";
static const char *device_prefix = "device:";
static const char *cursor_prefix = "cursor:";
......@@ -232,11 +204,9 @@ static int config_ini_handler(void *user, const char *section, const char *name,
}
}
} else if (strncmp(cursor_prefix, section, strlen(cursor_prefix)) == 0) {
const char *seat_name = section + strlen(cursor_prefix);
config_handle_cursor(config, seat_name, name, value);
g_warning ("Found unused 'cursor:' config section. Please remove");
} else if (strcmp(section, "cursor") == 0) {
config_handle_cursor(config, ROOTS_CONFIG_DEFAULT_SEAT_NAME, name,
value);
g_warning ("Found unused 'cursor' config section. Please remove");
} else if (strncmp(device_prefix, section, strlen(device_prefix)) == 0) {
g_warning ("Found unused 'device:' config section. Please remove");
} else if (strncmp(switch_prefix, section, strlen(switch_prefix)) == 0) {
......@@ -258,7 +228,6 @@ struct roots_config *roots_config_create(const char *config_path) {
config->xwayland = true;
config->xwayland_lazy = true;
wl_list_init(&config->outputs);
wl_list_init(&config->cursors);
wl_list_init(&config->switches);
config->config_path = g_strdup(config_path);
......@@ -307,14 +276,6 @@ void roots_config_destroy(struct roots_config *config) {
free(oc);
}
struct roots_cursor_config *cc, *ctmp = NULL;
wl_list_for_each_safe(cc, ctmp, &config->cursors, link) {
free(cc->seat);
free(cc->theme);
free(cc->default_image);
free(cc);
}
g_object_unref (config->keybindings);
free(config->config_path);
......@@ -337,19 +298,3 @@ struct roots_output_config *roots_config_get_output(struct roots_config *config,
return NULL;
}
struct roots_cursor_config *roots_config_get_cursor(struct roots_config *config,
const char *seat_name) {
if (seat_name == NULL) {
seat_name = ROOTS_CONFIG_DEFAULT_SEAT_NAME;
}
struct roots_cursor_config *cc;
wl_list_for_each(cc, &config->cursors, link) {
if (strcmp(cc->seat, seat_name) == 0) {
return cc;
}
}
return NULL;
}
......@@ -29,13 +29,6 @@ struct roots_output_config {
struct wl_list modes;
};
struct roots_cursor_config {
char *seat;
char *theme;
char *default_image;
struct wl_list link;
};
struct roots_switch_config {
char *name;
enum wlr_switch_type switch_type;
......@@ -51,7 +44,6 @@ struct roots_config {
PhocKeybindings *keybindings;
struct wl_list outputs;
struct wl_list cursors;
struct wl_list switches;
char *config_path;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment