828 Commits

Author SHA1 Message Date
Nikos Tsipinakis
ce28250109 Merge pull request #315 from Tadly/master
added body-hyperlinks to capabilities as it is supported
2017-06-15 06:44:52 +03:00
Nikos Tsipinakis
1d0bfb2278 Merge pull request #324 from hobarrera/dont-hardcode-DISPLAY
Tweak systemd.service
2017-05-20 12:14:01 +03:00
Hugo Osvaldo Barrera
94da3eecc5 Install the systemd user service file by default 2017-05-19 13:32:30 -03:00
Hugo Osvaldo Barrera
7c967879e2 Make dunst.service part of graphical-session
Make dunst part of graphical-session.target, so that it exits
immediately when the session exits.
2017-05-19 13:32:10 -03:00
Hugo Osvaldo Barrera
52b08e4f19 Don't hardcode a DISPLAY variable
Hardcoding a DISPLAY variable is a bad idea because it means that dunst
will only run on X11, and only for that specific configuration.

FWIW, this actually applies to any desktop app run via systemd:

1. `DISPLAY` should be set by `systemctl --user set-environment` elsewhere.
2. `DISPLAY=:0` is not universally valid.
3. This breaks dunst if attempting to run wayland, and requires manually
  starting it (eg: not via systemd), or editing the file.
2017-05-10 12:50:11 -03:00
Nikos Tsipinakis
8b74a756c2 Redraw the window after an expose event
Expose events, according to the X11 documentation, signify when the
contents of a window region have been lost but until now we have been
ignoring this event for unknown reasons.

Handle this event by redrawing the window entirely. While this is not a
perfect solution, the optimal one would be to only redraw the
region that was lost, it's simpler to implement currently and better
than losing the contents of the window entirely.
2017-05-04 17:54:06 +03:00
Nikos Tsipinakis
56dfc25baf Add warning if RandR initialization fails
Since currently the multimonitor extension support is a compile-time
argument, there is not much we can do to recover from not being able to
initialize RandR other than print an error and exit.
2017-05-04 17:53:01 +03:00
Nikos Tsipinakis
ce623af5ae Remove unused verbosity variable 2017-05-04 17:49:31 +03:00
tadly
2587173048 added body-hyperlinks to capabilities as it is supported 2017-04-05 16:44:04 +02:00
Nikos Tsipinakis
03c82c22e3 Fix uninitialized class name in dpi handling
Make the class in the XrmGetResource call be the same as the resource
name we are trying to retrieve, "Xft.dpi". Nowhere in the documentation
it is mentioned that the class name can be NULL so it is better to be
cautious and set it to a value that is unlikely to affect anything.
2017-04-02 19:41:36 +03:00
Nikos Tsipinakis
17e1dbf246 Use container-based builds with travis
Since we only use sudo for installing packages, start using the apt
travis addon for the installation in order to allow container-based
builds to be used for testing dunst which should theoretically have a
faster boot time.
2017-04-02 19:41:36 +03:00
Nikos Tsipinakis
06c4cf6d4d Make travis compile and test using all multimon extensions
Even without tests covering the x11 part of dunst, compiling with
different multi-monitor libraries should catch some of the most common
mistakes.
2017-04-02 19:41:36 +03:00
Nikos Tsipinakis
c445d1477c Make travis only notify if the build changes status
Change the behaviour of travis to only notify if the build status
changes. The previous behaviour which was notifying for every build
regardless of status added a lot of unnecessary noise to the IRC
channel.
2017-04-02 19:41:36 +03:00
Nikos Tsipinakis
c9d9046b3e Remove .clang_complete
As far as I can tell it is not being used for anything and has become
out of date so there is no real point in keeping it around.
2017-04-02 19:41:36 +03:00
Nikos Tsipinakis
394ac9b5fe Update readme to reflect the new dependencies
Replace the dependency list in the README to mention libxrandr instead
of libxinerama since that's the default value of the MULTIMON variable
in config.mk
2017-04-02 19:41:36 +03:00
Nikos Tsipinakis
3357743210 Make selecting which multi-monitor selection to use simpler
Use a single MULTIMON variable which can be set to either xrandr,
xinerama or none and replace the previous system which used 2 variables
for each extension which were then added to CFLAGS and instead append
xrandr or xinerama respectively to pkg_config_packs so their
availability can be checked with pkg-config.

The main advantage of this is that the extension can now be set from
the command like like so 'MULTIMON=xinerama make'
2017-04-02 19:37:59 +03:00
Nikos Tsipinakis
43b4d4bb41 Add per_monitor_dpi experimental setting
Calculating the screen dpi on a per-monitor basis can cause
inconsistencies if multiple monitors with slightly different dpis are
used and in some cases it might not be the expected behaviour.

As such, the per-monitor dpi calculation was changed from a default
fallback to an opt in experimental feature and the default value of 96
will be used for the dpi if Xft.dpi is not set.

In the future, depending on how we decide to continue, we can either
move this setting in the global configuration section and fall back to
the X11 display dpi as the default or simply always use the per-monitor
dpi calculation. But to preserve backwards compatibility, this decision
can wait until the next major release.
2017-04-02 18:27:12 +03:00
Nikos Tsipinakis
52600cdfb0 Refactor monitor handling to keep track of all screens
Previously, we were getting screen info every time we tried to move the
window. To improve the situation, information about the available
screens is initialised once when dunst starts and further behaviour
depends on the compile-time options used.

If Xrandr is enabled, screen information is updated when an
XRRScreenChangeNotify event is received, meaning only when the screen
layout changes.

If Xinerama is enabled, screen information is only updated on startup.
This behaviour might be changed later.

If none are enabled, then dunst assumes only one screen and ignores all
multi-monitor options.
2017-04-02 18:27:12 +03:00
Nikos Tsipinakis
0a6b105f4a Move screen related code into a new file
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
2017-04-02 18:27:12 +03:00
Nikos Tsipinakis
ebea092ddd Move x.{c,h} to a different subdirectory
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.
2017-04-02 18:27:12 +03:00
Eizen
4dd628ccf4 Add auto-detect dpi method
If Xft.dpi value is not available, auto-detect value based on monitor using randr provided sizes.
Disable Xinerama and enable randr by default.
Also update dpi everytime the monitor changes.
2017-04-02 18:27:12 +03:00
Eizen
cc3a08c1db Add DPI detection method
Use Xft.dpi if available
2017-04-02 18:27:12 +03:00
Nikos Tsipinakis
a6046586a3 Fix minor memory leak
When checking for the markup value in rules, an empty string was
specified as the default value so it can easily be checked if the actual
config value was empty or not. While that string got strdup'ed in the
ini_get_string call, it was only freed if the length > 0, effectively
leaking a tiny amount of memory.

Change that behaviour to use a NULL check instead to avoid leaking
memory.
2017-04-01 22:50:40 +03:00
Nikos Tsipinakis
3c38741e71 Remove unused dependencies
Remove xext and xft as a dependency since they are not currently used
and probably haven't been used a while.

Also remove freetype2 from the pkg-config list, while it is required by
pangocairo it should be included from the pkg-config --cflags call.
2017-04-01 18:52:15 +03:00
Nikos Tsipinakis
259030abe8 Merge pull request #312 from hobarrera/document-actions
Document actions and how to interact with them
2017-04-01 16:56:54 +03:00
Hugo Osvaldo Barrera
f66942549f Document actions and how to interact with them 2017-03-31 11:27:13 -03:00
Nikos Tsipinakis
f6438a1b14 Update changelog to comply with the github markdown spec
The 'Github Flavored Markdown' specification says that headers must be
followed by a space character, update the changelog to respect that
requirement.
2017-03-18 15:57:21 +02:00
Nikos Tsipinakis
96ebb4625a Merge pull request #309 from LukeShu/tidy-markup
Tidy and fix markup handling.
2017-03-15 18:46:50 +02:00
Luke Shumaker
1f77b28691 markup.c: markup_unquote(): Unquote things in the correct order
Because "&" is not the last character to be unescaped, it is possible that
the lines for "<" and ">" expand some things they shouldn't.

For example, "&amp;lt;" should become "&lt;", but instead it becomes ">".
While this is unlikely to appear naturally in a notification, it is wrong.
2017-03-13 16:40:28 -04:00
Luke Shumaker
18c4b4bf7a markup.c: Tidy, expand comments
This turns a hard-to-understand nested if{} chain into a simple switch
statement, and pulls some code out in to utility functions.

This is strictly a code-organization change, and should contain no
functional changes.
2017-03-13 16:40:28 -04:00
Luke Shumaker
c645ba3106 Add tests for markup functions 2017-03-13 16:40:18 -04:00
Luke Shumaker
0c84e53afb Move markup handling into markup.{c,h}
This is strictly a code-organization change, and should contain no
functional changes.
2017-03-09 11:32:06 -05:00
Nikos Tsipinakis
1d4a26c1d0 Merge pull request #303 from LukeShu/fix-warning-msg
option_parser: Fix inconsistent Warning message.
2017-02-26 13:16:42 +02:00
Luke Shumaker
bf01932471 option_parser: Fix inconsistent Warning message.
Usually, it's "Warning: invalid config file at line %d", but in one case
there's a colon after "line".
2017-02-25 21:27:49 -05:00
Nikos Tsipinakis
2126b212f6 Add example for the history_ignore rule to dunstrc
Add example to demonstrate the usage of history_ignore to the default
dunstrc file.

Relevant issue: #302
2017-02-25 15:38:54 +02:00
Nikos Tsipinakis
d8d267e1f0 ASSERT_FALSE(expr == NULL) -> ASSERT(expr)
Simplify assert calls to improve code readability.
2017-02-23 20:45:09 +02:00
Nikos Tsipinakis
c23af0e021 Don't leave zombie processes if dmenu call fails
If dmenu didn't return anything we returned out of the function without
calling `waitpid` to collect the childs exit code, leaving to the child
process to be left as a zombie indefinitely. This commit makes `waitpid`
be called before the return checks are done.
2017-02-23 20:24:45 +02:00
Nikos Tsipinakis
b034d31f80 Merge pull request #299 from LukeShu/fix-nl
Expand "\\n" to "\n" in the format string only; not message text.
2017-02-23 16:24:07 +02:00
Nikos Tsipinakis
375fcad223 Don't unconditionally append to dmenu_input
When generating the list of urls to pass to dmenu, string_append with a
newline as a separator was called unconditionally. This caused a newline
character to be added for each notification even if it didn't contain
any urls, leading to empty items in dmenu.

Fixes #300
2017-02-21 22:43:22 +02:00
Nikos Tsipinakis
f624c42432 Improve dbus error handling
* Improve error reporting to also include the glib error messages
* Call g_error_free after an error to avoid leaking memory.
2017-02-20 18:04:24 +02:00
Nikos Tsipinakis
37628f3dc4 Print errors to stderr
A lot of error reporting used a simple `printf` call which by default
prints to stdout. This was changed so that all error reporting is done
by an `fprintf(stderr, ...)` call.
2017-02-20 17:48:11 +02:00
Nikos Tsipinakis
fccdce0819 Remove shrink the shrink option from the changelog
`shrink` is already in 1.1.0 so it should not be listed as a new
feature.
2017-02-20 17:32:01 +02:00
Nikos Tsipinakis
2d53c898db Print usage information to stdout instead of stderr
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)
2017-02-20 17:28:54 +02:00
Nikos Tsipinakis
92e83a939f Remove a few more leftover memory allocation checks
According to the glib memory allocation documentation, if any memory
allocation calls fail the application will be terminated so there is no
need to check if the call succeeded.
2017-02-20 17:25:59 +02:00
Luke Shumaker
e37bbad2d7 Expand "\\n" to "\n" in the format string only; not message text.
This is consistent with other implementations; neither notification-daemon
or xfce4-notifyd expand "\n" in message text.
2017-02-20 03:48:26 -05:00
Eizen
4df1a4b731 Fix small bug 2017-02-19 17:11:19 -03:00
Nikos Tsipinakis
62fcfa66e8 Merge pull request #297 from Stebalien/dbus
Modernize the systemd unit a bit
2017-02-19 15:18:48 +02:00
Steven Allen
46e0a0e668 Add dunst documentation to the systemd unit. 2017-02-18 14:24:02 -08:00
Steven Allen
3775b44339 Change the systemd unit's WantedBy to default.target
multi-user.target isn't a valid user target and it doesn't make sense to run
dunst as a system service.

Eventually, this unit should probably be converted to use
graphical-session.target but it's a bit unclear how that's supposed to work
right now.
2017-02-18 14:20:40 -08:00
Steven Allen
6f45c6926d Change the systemd service to a dbus unit 2017-02-18 14:17:38 -08:00