75 Commits

Author SHA1 Message Date
fwsmit
55d700f746 Add filetype to vim modeline 2020-11-02 20:25:26 +01:00
Benedikt Heine
d96a29fed5 Move field definition on top of function (readability) 2018-11-24 15:22:18 +01:00
Benedikt Heine
711b11c92f Merge queue_update and queue_check_timeouts 2018-11-24 15:22:18 +01:00
Benedikt Heine
140278a36f Introduce a status structure 2018-11-24 15:22:18 +01:00
Benedikt Heine
28f30d182b Rename queues teardown function
Make it consistent with the queues_init function
2018-11-23 13:50:46 +01:00
Benedikt Heine
ed341dfca3 Add S2US macro 2018-11-15 15:17:48 +01:00
Benedikt Heine
9b45a111f1 Sort includes alphabetically 2018-11-15 15:17:48 +01:00
Benedikt Heine
feb62a0c4c Remove displaced comment 2018-11-15 15:17:48 +01:00
Benedikt Heine
eba6913faa Test version number in unittests
Enforces a version number as intended in the Makefile. This check is
necessary, as there is no ability to check via Macros for an empty
string.
2018-11-12 15:32:58 +01:00
Benedikt Heine
851f8a7339 Rename dbus methods consistently 2018-10-31 15:19:24 +01:00
Benedikt Heine
08019dc268 Move context_menu into right header 2018-10-31 15:19:24 +01:00
Nikos Tsipinakis
740ebdd5a3
Merge pull request #545 from tsipinakis/bugfix/x11-opt
Draw event optimizations
2018-09-24 20:25:17 +03:00
Nikos Tsipinakis
7ac054b3cc Simplify window showing and hiding
As suggested by @bebehei make x_win_{show,hide} callable at any time and
avoid double checking the queue length.
2018-09-20 10:49:40 +03:00
Benedikt Heine
bbbddad3a7 Use structs for notifications 2018-09-16 02:58:31 +02:00
Nikos Tsipinakis
81fae350c9 Fix draw being called twice when mapping the window 2018-09-13 18:20:06 +03:00
Sascha kruse
e09e29968a draw the window before showing it
Before this commit when using Dunst with multiple displays and
follow mode mouse/keyboard on a new notification (when no other
notifications are shown) a black window flickers up at the screen where
the last notification was shown.

By calling draw() before x_window_show the new window position will be
calculated and the window will be moved there before the window is shown
and thus remove the flickering.
2018-09-13 16:03:26 +02:00
Benedikt Heine
f410f57211 Use g_clear_pointer on fields, which may get reused 2018-07-07 11:53:32 +02:00
Benedikt Heine
0a057450fe Fix typos 2018-06-11 14:10:07 +02:00
Nikos Tsipinakis
4891710af3 Refactor window_x11 struct to be opaque
This removes window accesses from outside the x.c file which will allow
us to abstract the window struct to implement multiple outputs in the
future.
2018-05-14 10:39:46 +03:00
Nikos Tsipinakis
5761ef1c09 Fix segfault with startup_notification
As it currently stands notification_init uses xctx.color to initialize
the notification colors which means that it depends on x11 having been
previously initialized and crashes otherwise. This bug was introduced in
04b327f where draw_setup() was after the startup notification was
created.

As a temporary fix the notification creation was moved under draw_setup
but for a long term solution we should look into removing these xctx
dependencies.
2018-05-14 09:31:53 +03:00
Nikos Tsipinakis
90dd111970 Refactor x11 event source to handle multiple windows
Move the code to register the x11 event source under x_win_create so
multiple windows can be created and be properly registered as the event
source.

One more missing piece is that the callback functions are still using
the global win variable and not getting the window from the source.
2018-05-14 09:31:53 +03:00
Nikos Tsipinakis
72aab3daf4 Refactor window creation and destruction
Move the main window reference from xctx to draw.c and at the same time
make each X11 function that modifies the window require the pointer as a
parameter. This makes it easier to implement features that require
multiple windows.
2018-05-14 09:31:53 +03:00
Nikos Tsipinakis
a2863d5312 Move window-related fields to dedicated struct
The first step in allowing dunst to have multiple windows.
2018-05-14 09:30:42 +03:00
Nikos Tsipinakis
045ec98c0e Setup initial file for draw.c
Setup the initial template for draw.c to be between X11 calls and the
rest of the codebase. This prepares the file to move all the drawing
related function here in the next commit.
2018-05-06 13:47:24 +03:00
Benedikt Heine
ac4a0becd2 Count monotonic time with Linux specific clocks
On Linux, CLOCK_MONOTONIC has got a bug. It does not count
onwards during sleep, albeit required by POSIX. This behavior
is reasoned with the requirement for poll().
Also the GLib people are sticking to this behavior in their
g_get_monotonic_time() function.

So we have to use a drop in replacement, which respects CLOCK_BOOTTIME
on Linux, as this is the clock, what would be CLOCK_MONOTONIC on POSIX
systems.
2018-03-20 14:17:03 +01:00
Benedikt Heine
a7bc16874d log wakeup 2018-02-25 20:44:31 +01:00
Benedikt Heine
f89ce8e16f Delay incoming notifications when fullscreens set 2018-02-25 20:18:40 +01:00
Benedikt Heine
280ec456a4 Allow to set the log level via options 2018-02-02 17:29:04 +01:00
Benedikt Heine
38dced7591 Translate last unusual logging calls 2018-02-02 17:29:04 +01:00
Benedikt Heine
2c503c2984 Add option to suppress log output when testing 2018-02-02 17:29:04 +01:00
Benedikt Heine
cad2ac34f9 Add GLib logging capabilities 2018-02-02 17:29:04 +01:00
Benedikt Heine
6424f1a07b Make run static to not export it
This enforces to call wake_up in other files and not run(NULL).
2017-12-22 22:24:21 +01:00
Benedikt Heine
35dbd00611
Merge pull request #428 from bebehei/refactor-notification_init
Refactor notification init
2017-12-18 00:55:59 +01:00
Benedikt Heine
3face4ae72 Split notification assembly into separate method
Handle replaces_id now via n->id
2017-12-15 00:16:31 +01:00
Benedikt Heine
b7b8362175 Remove timeout_cnt
The structure is not needed, as next_timeout gets invalidated via
current time and not the amount of all timeouts.
2017-11-29 12:46:54 +01:00
Benedikt Heine
2a823eb381 Check if next_timeout is in past
When having a long running notification and an additional two shorter
notifications arrive. The short notification, which times out later,
does not timeout correctly and gets flushed only, when the long running
notification is flushed or a Focus* XEvent is sent.
2017-11-29 12:46:54 +01:00
Benedikt Heine
43b9c45cd8 Clearify structures in dunst:run 2017-11-26 21:17:42 +01:00
Benedikt Heine
caa63d6275 Sort includes alphabetically 2017-11-25 01:28:03 +01:00
Benedikt Heine
5f51147263 Prefix urgency enum with URG_ 2017-11-16 17:12:30 +01:00
Benedikt Heine
11af7402fa Use '-1' for undefined progress 2017-10-31 15:58:41 +01:00
Benedikt Heine
a536e3f60b Force management of queues to queues.c 2017-10-29 20:38:40 +01:00
Benedikt Heine
12fa9d6ce1 Move update_lists and check_timeouts to queues.c
Also refactor the names to match the namespace.
2017-10-29 20:38:40 +01:00
Benedikt Heine
c70da444a9 Move pause_display to queues.c
Hint for dbus.c lines (134,138):

pause_display => (displayed->length == 0)
2017-10-29 20:38:40 +01:00
Benedikt Heine
59ac6d0f88 Move get_sleep_time to queues.c 2017-10-29 20:38:40 +01:00
Benedikt Heine
f869175d0d Move id assignment to separate function in queues.c
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)
2017-10-29 20:38:40 +01:00
Benedikt Heine
af9f6b8b7d Move maximum notification display count to x11
Decouple the x11 stuff from dunst.c, to be able to push update_lists to
queues.c in the next commit
2017-10-29 20:38:40 +01:00
Benedikt Heine
7110734b6e Move queue initialization to queues.c 2017-10-29 20:38:40 +01:00
Benedikt Heine
a7003e3616 Refactor: Move queue specific methods to queues.c 2017-10-29 20:38:40 +01:00
Benedikt Heine
2d7dc6fbc5 Make startup notification timeout in 10 seconds 2017-10-22 10:40:39 +02:00
Benedikt Heine
bc3c6466ca Remove LENGTH macro and replace with glib one 2017-10-10 23:11:52 +02:00