mirror of
https://github.com/artizirk/wdisplays.git
synced 2026-10-03 12:55:42 +03:00
Report kanshi config errors in the info bar only
This commit is contained in:
+1
-5
@@ -53,11 +53,7 @@ static void config_handle_succeeded(void *data,
|
||||
zwlr_output_configuration_v1_destroy(config);
|
||||
wd_ui_apply_done(pending->state, pending->outputs);
|
||||
#ifdef WITH_KANSHI
|
||||
if (wd_store_config(pending->outputs) == 0)
|
||||
{
|
||||
wd_ui_show_error(pending->state,
|
||||
"Change was applied successfully and config was saved.");
|
||||
}
|
||||
wd_store_config(pending->state, pending->outputs);
|
||||
#endif
|
||||
destroy_pending(pending);
|
||||
}
|
||||
|
||||
+6
-5
@@ -513,7 +513,7 @@ static bool write_config(const char *path, const char *contents,
|
||||
return g_file_set_contents(path, contents, -1, error);
|
||||
}
|
||||
|
||||
int wd_store_config(struct wl_list *outputs) {
|
||||
void wd_store_config(struct wd_state *state, struct wl_list *outputs) {
|
||||
g_autofree char *path = get_config_path();
|
||||
g_autofree char *contents = NULL;
|
||||
g_autofree char *updated = NULL;
|
||||
@@ -529,9 +529,10 @@ int wd_store_config(struct wl_list *outputs) {
|
||||
if (updated == NULL || !write_config(path, updated, &error)) {
|
||||
goto err;
|
||||
}
|
||||
return 0;
|
||||
return;
|
||||
|
||||
err:
|
||||
fprintf(stderr, "Could not save the kanshi config %s: %s\n", path, error->message);
|
||||
return 1;
|
||||
err:;
|
||||
g_autofree char *message = g_strdup_printf(
|
||||
"Could not save the kanshi config %s: %s", path, error->message);
|
||||
wd_ui_show_error(state, message);
|
||||
}
|
||||
|
||||
+1
-1
@@ -349,7 +349,7 @@ void wd_destroy_overlay(struct wd_output *output);
|
||||
/*
|
||||
* Updates kanshi config
|
||||
*/
|
||||
int wd_store_config(struct wl_list *outputs);
|
||||
void wd_store_config(struct wd_state *state, struct wl_list *outputs);
|
||||
#endif
|
||||
// SPDX-SnippetEnd
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user