611 Commits

Author SHA1 Message Date
Nikos Tsipinakis
289b4f50eb Remove const qualifier in queues_get_displayed
The returned node was theoretically read-only however all the other
nodes accessible do not inherit the qualifier. Since none of the glib
functions use const with Glib, even the read-only ones. There's no use
in having it.

This resolves the warning about g_list_nth_data.
2020-05-05 11:38:48 +02:00
Nikita Zlobin
dcf060effa Fix xshape mask rounding 2020-05-05 11:55:50 +05:00
Nikita Zlobin
d964455d36 oops: Keep ready for possible 32bit color lack 2020-05-05 00:56:19 +05:00
Nikita Zlobin
d3f6c05590 True transparency support 2020-05-04 19:45:02 +05:00
Nikita Zlobin
7a094bc702 Clear window to prevent accumulations 2020-05-04 19:06:53 +05:00
Nikita Zlobin
c09f0f029f style fix 2020-05-04 02:42:18 +05:00
Nikita Zlobin
dbbaecfd1d Fix indentation 2020-05-04 02:35:34 +05:00
Nikita Zlobin
16e38a9a84 Don't draw frame with zero line width 2020-05-03 22:03:47 +05:00
Nikita Zlobin
4c4dc9aa95 Fix ugly rounded corners 2020-05-03 22:03:47 +05:00
mrossinek
cfa8625699
Fix boolean negation 2020-05-02 10:01:51 +02:00
mrossinek
f868f51fcd
Fix embedded XML 2020-05-02 09:19:24 +02:00
mrossinek
0dfcc1420d
Change running to paused state on "server" side
This allows the boolean "inversion" to happen in the C code instead of
post-processing in the dunstctl shell script.
2020-05-01 21:54:53 +02:00
Nikos Tsipinakis
337ff1edb5
Merge pull request #651 from bebehei/dunstctl
Implement a command line control (dunstctl)
2020-05-01 15:38:23 +02:00
Nikos Tsipinakis
a91adf9c80 Implement error handling in NotificationAction call 2020-05-01 15:35:23 +02:00
Nikos Tsipinakis
ec421f1ea1 Properly handle error conditions from dunstctl 2020-05-01 15:35:23 +02:00
Nikos Tsipinakis
9049bf15b2 Remove live status checking (for now) 2020-05-01 15:35:23 +02:00
Nikos Tsipinakis
ee11dfa8fe Don't wake up after doing an action 2020-05-01 15:35:23 +02:00
Nikos Tsipinakis
b1f64b266b Wake up after changing status via dunstctl 2020-05-01 15:35:23 +02:00
Benedikt Heine
7e92619967 Add ability to trigger action of latest notification
Currently triggers only the latest notification. TODO: implement it
either with ActionsAll or more favorable: with an optional paramter,
which should trigger only the action of a single notification.

The problem currently: I have got no ability to check the DBus docs, as
I'm on a bad internet connection.
2020-05-01 15:35:23 +02:00
Chris Down
e8fc45da63 follow=keyboard: Fall back to follow=mouse instead of XDefaultScreen()
In dwm and similar window managers, it's common to often have empty
tags, and navigate to them with the intent to create clients there. If I
navigate to one of those empty tags with a dunst notification visible
and follow=keyboard set, the notification warps over to the default
screen.  If I then open a client, it then warps back, which is pretty
jarring.

This is mostly an artefact of the implementation of follow=keyboard --
if we fail to get a focused window, we use the default screen. However
this case isn't necessarily really a "failure" on window managers like
dwm where it's a common occurrence to end up with no clients on the
screen, whereas that would be significantly rarer on (say) GNOME or KDE.

A guess that's more likely to fit user expectations is falling back to
where the mouse pointer currently is, since this indicates the currently
focused monitor that the window manager would create a client on. This
avoids warping back to that monitor again when a client is created.
2020-04-27 16:34:53 +01:00
Benedikt Heine
a3342d0ced Add debug command 2020-04-10 10:48:47 +02:00
Benedikt Heine
55f4971a92 Add DBus interface to control dunst 2020-04-10 10:47:12 +02:00
Michael Krasnitski
8bcc3070fb Use g_strsplit instead of homebrewing a solution
Lesson: don't reinvent the wheel.
Additionally, changed a `g_malloc` call to `g_malloc_n` for safety.
2020-04-05 19:35:36 -04:00
Michael Krasnitski
506b4f2cfa Allow a mouse button to perform 1 or more actions in series.
The user provides a comma-separated list of valid mouse actions
that will be performed one after another when a notification is
clicked. If any one of the provided actions is invalid, the value
reverts to its default state.
2020-04-05 15:29:24 -04:00
Michael Krasnitski
94be674cf8 Add parsing of comma-separated list options from conf/cmdline. 2020-04-05 12:15:35 -04:00
Nikos Tsipinakis
69e319c729 Invalidate actions after notification is closed 2020-03-31 15:27:16 +02:00
Benedikt Heine
9591af02a8 Retrieve user's home from passwd entry as fallback
For weird reasons, the HOME-variable might not always be set. So we
should fallback on something more reliable.

Fixes #693
2020-03-10 16:29:20 +01:00
chronus
4c09883ef6 adding changes according to review
- adding default to config.h#defaults
- changing naming from content_* to vertical_*
- replacing switch-case with if-else-if
2020-01-29 23:02:00 +01:00
chronus
f9b6f6a066 fixing comparison issue in bottom alignment 2020-01-25 16:43:42 +01:00
chronus
89d7a81b9c Adding vertical content alignment control.
This adds the option `content_alignment`, which allows the user to set
the vertical alignment of the notification's content (i.e. icon and
text) to either top (`CONTENT_TOP`), center (`CONTENT_CENTER`, default),
or bottom (`CONTENT_BOT`). The default preserves current behaviour,
while the other options fulfill #486.
2020-01-25 16:35:38 +01:00
Jonas Berlin
03253e82f7 [ReviewFix] Remove bogous g_error_free() cal 2019-12-05 20:12:07 +02:00
Jonas Berlin
667503ef7d Cleanup, documentation 2019-12-04 21:01:29 +02:00
Jonas Berlin
39c97e28f6 [ReviewFix] get_pixbuf_from_file: Free memory on error return 2019-12-03 20:27:31 +02:00
Jonas Berlin
364bce1ed0 Scale icons during loading to get best quality for e.g. vector images 2019-11-29 21:28:22 +02:00
Jonas Berlin
ab3b5c2805 Implement #392 2019-11-29 21:14:57 +02:00
Benedikt Heine
53e7f3d16a
Merge pull request #650 from tsipinakis/bugfix/parse-empty
option_parser: Fail early when parsing empty string
2019-08-10 20:06:11 +02:00
Nikos Tsipinakis
f37a5d1c64 option_parser: Fail early when parsing empty string
Sometimes these parse functions can have other side-effects such as the
sepcolor one which defaults to a custom color string if the value is
unknown. If the string is empty all of these functions should fail to
allow for the default to be used.

See #649 for details
2019-08-10 19:47:30 +03:00
Benedikt Heine
52a8489043 Don't overflow when passing INT_MAX on DBus wire 2019-08-09 14:41:37 +02:00
Nikos Tsipinakis
ac94eca79e Recheck fullscreen status on ConfigureNotify
IceWM does not send PropertyNotify when exiting fullscreen. As a
band-aid solution also re-check the fullscreen status on ConfigureNotify
events. We're receiving them already so a few extra checks should not be
noticeable in any case.

Fixes #613
2019-06-20 15:25:54 +03:00
Nikos Tsipinakis
69a682ce34 Fix call to draw when no notifications are available
Draw should not be called when there are no notifications in the queue.
This for unknown reasons causes a crash the next time we attempt to get
the currently active window with a BadValue error from
XGetWindowProperty.

Fixes #630.
2019-06-19 11:02:46 +03:00
Nikos Tsipinakis
700a3225f2 Increase notification character limit
Fixes #636
2019-06-18 14:16:32 +03:00
Nikos Tsipinakis
264df67a63 Fix negative width being ignored
In `x_parse_geometry` we modified the global settings struct for
negative width instead of updating it in the struct that is currently
being constructed.

As a result the negative_width field was always false as it was being
overwritten by the struct assignment after the functions return.

Fixes #628
2019-05-02 12:34:25 +03:00
Nikos Tsipinakis
d6bd506669 Fix parsing of comments after a quoted string in the config
Quoted values can still have a trailing comment that we need to remove
before calling `add_value`. Otherwise, when trying to strip the quotes
from the value `string_strip_quotes` only looks at the end which
is inside the comment and so it won't find a matching end quote to
strip.

Fixes #626
2019-04-27 10:30:02 +03:00
Dmitri Goutnik
6e8de70c82 Make extract_urls regex more portable 2019-04-08 09:15:59 -05:00
Nikos Tsipinakis
dda26bfbe9 Fix dynamic width check
The width_set field is true if the width is set in the geometry setting,
in other words if a specific (or dynamic) width is set or we want the
notification to cover the whole screen.
In order to check if a specific width is chosen we need to also exclude
dynamic width, meaning the width field has to be non 0;

Fixes #614
2019-04-02 11:34:27 +03:00
Nikos Tsipinakis
1bc3237a35 Subscribe to PropertyChangeMask regardless of follow_mode
PropertyNotify events are used primarily to detect active screen changes
when follow mode is used but now we also need them to receive resource
manager events in order to update the dpi value.
2019-03-23 20:01:27 +02:00
Benedikt Heine
812d5a3b84 Replace the xresources DB on PropertyNotify
When changing values with xrdb on the command line, an XEvent is
triggered on the "RESOURCE_MANAGER" atom.

But xlib just doesn't care. XResourceManagerString() will still report
the old values. Also XrmGetDatabase() won't help out.

So, when we receive a PropertyNotify for the resource manager atom, we
have to manually query its contents, convert it to a DB and replace it
in the display object.

This allows, that any method just can call XrmGetDatabase() and get the
latest values.
2019-03-23 20:01:27 +02:00
Benedikt Heine
4b06d67605 Initialize xrm during init
Initializing xrm is required only once. Everything else would be
overhead.
2019-03-23 20:01:27 +02:00
Benedikt Heine
9961efd10c Copy the database from the display connection
This allows to update the DB on the xctx.dpy object. Crawling the string
from xctx.dpy will always return the xdefaults string, which represents
the defaults from the initialisation, but not with any other updates.
2019-03-23 20:01:27 +02:00
Benedikt Heine
e9e199c4ec Pass pointer to check_screen_event 2019-03-23 20:01:27 +02:00