Browse Source

Add ignore_dbusclose settings

closes #731
master^2
matclab 2 years ago
parent
commit
762d37758d
  1. 1
      config.h
  2. 3
      src/dbus.c
  3. 5
      src/settings.c
  4. 1
      src/settings.h

1
config.h

@ -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 */

3
src/dbus.c

@ -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);

5
src/settings.c

@ -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(

1
src/settings.h

@ -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;

Loading…
Cancel
Save