Add ignore_dbusclose settings

closes #731
This commit is contained in:
matclab 2020-07-10 14:39:33 +02:00
parent b040fca067
commit 762d37758d
4 changed files with 9 additions and 1 deletions

View File

@ -38,6 +38,7 @@ struct settings defaults = {
.history_length = 20, /* max amount of notifications kept in history */
.show_indicators = true,
.word_wrap = false,
.ignore_dbusclose = false,
.ellipsize = ELLIPSE_MIDDLE,
.ignore_newline = false,
.line_height = 0, /* if line height < font height, it will be raised to font height */

View File

@ -494,7 +494,8 @@ static void dbus_cb_CloseNotification(
{
guint32 id;
g_variant_get(parameters, "(u)", &id);
queues_notification_close_id(id, REASON_SIG);
if (!settings.ignore_dbusclose)
queues_notification_close_id(id, REASON_SIG);
wake_up();
g_dbus_method_invocation_return_value(invocation, NULL);
g_dbus_connection_flush(connection, NULL, NULL, NULL);

View File

@ -176,6 +176,11 @@ void load_settings(char *cmdline_config_path)
"word_wrap", "-word_wrap", defaults.word_wrap,
"Truncating long lines or do word wrap"
);
settings.ignore_dbusclose = option_get_bool(
"global",
"ignore_dbusclose", "-ignore_dbusclose", defaults.ignore_dbusclose,
"Ignore dbus CloseNotification events"
);
{
char *c = option_get_string(

View File

@ -59,6 +59,7 @@ struct settings {
int history_length;
int show_indicators;
int word_wrap;
int ignore_dbusclose;
enum ellipsize ellipsize;
int ignore_newline;
int line_height;