Move all id-changing functions out of notification_init and handle this
in queues.c
Also use stack_duplicates in combination with replacement of
notifications correctly. Fixes#404 (issue not found)
After some research, the _GNU_SOURCE does not affect any function call
anymore. To avoid future failures on other systems not using glibc,
_GNU_SOURCE gets removed.
time(NULL) is vulnerable against timeshifts by NTP, timezones,...
g_get_monotonic_time() is not, but counts its in microseconds with the
gint64 datatype. To prevent any conversion bugs, all internal
timeformats are now using a gint64 and only get converted during import
or export (DBus notification arrives, configuration reading, age
threshold display).
It's hard to trace back, which methods in option parser require freeing
the result and which prohibit it. Marking all non-freeable values as
const lets this problem solve the compiler.
Move the iter pointer to the next item before doing any logic that might
result in exiting from the current iteration of the loop since it would
cause the same notification to be processed repeatedly resulting in an
infinite loop.
Fixes 362.
When closing a notification in check_timeouts, iter will get removed
of the list and therefore iter->next is NULL at the end of the
loop. This requires calling check_timeouts again.
Shifting iter to iter->next before removing the notification, we can
avoid recalling check_timeouts and avoid processing the already
processed list again.
Since we are adding Xrandr support to allow for automatic dpi detection,
split screen handling code into a new file as part of the effort to
simplify x.c
x.c has grown into an unmaintainable blob. Moving it in its own
subdirectory is the first step to splitting it into submodules each of
which will have a well defined job so that a lot of the code can be
abstracted to improve readability and make it much easier to maintain.
This process will be done one small part at a time only when we need to
change significantly change a part of the file, there is no need to
break what already works.
It doesn't make much sense to print usage into to stderr. What's more is
that it prevents users from easily piping the output to other
programs(i.e. grep)
Merge the allow_markup and plain_text settings into a single setting.
These 2 settings had a similar function, allow_markup controlled whether
markup was parsed or stripped and plain_text whether the notification
was escaped and displayed as is.
To cover all the possible combinations of the settings mentioned above
`markup` can take the following values:
full: The equivalent of allow_markup yes, plain_text no.
Passes the text straight to pango with minimal parsing. All valid
pango tags will be parsed.
strip: The equivalent of allow_markup no, plain_text no.
Strips the markup using string_strip_delimited. The parsing is
simplistic and if there are any unescaped '<' and/or '>'
characters it might get tripped and strip out actual text.
According to the GNOME notification specification, if a server
doesn't support markup(and we don't advertise that we do if it is
turned off) it should be stripped clientside, so this setting
should rarely be used. It is mainly left in for compatibility
with broken clients that don't follow the specification.
no: The equivalent of allow_markup [yes/no](any value), plain_text
yes.
Makes the notification content be rendered as plain text
regardless if it contains markup. Any Markup will be shown as
regular text.
Markup inside 'format' will still be parsed regardless of what markup is
set to.
Closes#279
notification_create currently simply allocates memory and zeroes it to
properly initialise a notification. Since we currently have at least 2
places in the code that create notifications(startup notification in
dunst.c and notifications from dbus in dbus.c) the creation should be
handled from a central location in case we ever need to change the
creation procedure later on.
Move the main function to main.c in the git root to allow for
alternative main functions to be linked in its place. Specifically this
will be used to link the test runner main to run tests.