74 Commits

Author SHA1 Message Date
GuessWhatBBQ
be8e32098f Add the text_icon_padding feature as per #543 2021-01-26 12:18:04 +06:00
fwsmit
6a6cd6697f Remove unnecesary code. Improve log messages 2021-01-09 21:54:56 +01:00
fwsmit
25e1d0c442 Added option for forcing X11 on wayland.
Also added some more documentation.
2021-01-09 21:48:59 +01:00
fwsmit
e5fec3326e Wayland: optimize by making input code asyncronous 2020-12-28 15:15:59 +01:00
fwsmit
c1caf4bbc7 Set the right window position 2020-12-28 15:15:59 +01:00
Nikos Tsipinakis
0bcc135ffd
Merge pull request #779 from fwSmit/transition-output
Create abstract output and fix wayland bug
2020-11-18 17:44:18 +02:00
fwsmit
58d215ddfe Create abstract output and fix wayland bug
This commit adds an output struct which abstracts the X11 specific
functions and makes it possible to easily create a drop-in wayland
output.

It also fixes a bug in wayland where notifications won't disappear.
This is because wayland doesn't give access to user input when a
client is not in focus. This way it seems like the user is always
idle. The idle functionality is now disabled in Wayland until proper
support is added.
2020-11-18 15:20:06 +01:00
Nikos Tsipinakis
3d3ba4b9c5
Merge pull request #775 from fwSmit/progress-bar
Add progress bar
2020-11-10 11:55:02 +02:00
fwsmit
4f10496123 Add docs, tests and fixes for progress bar 2020-11-10 10:52:26 +01:00
fwsmit
bfcf655b1e Add feature: progress bar 2020-11-06 14:25:04 +01:00
fwsmit
55d700f746 Add filetype to vim modeline 2020-11-02 20:25:26 +01:00
Maxime Wack
6f5f003e2b Fix possible division by zero in radius calculation.
Check all possible causes of division by zero in the
calculation of the radius.
2020-08-15 14:22:23 +02:00
Nikos Tsipinakis
c01f81b692 Fix possible division by 0 in radius calculation 2020-07-18 22:39:40 +03:00
Nikos Tsipinakis
7735c9a4f6 Fix separator not working with frame_width=0
Bug was introduced with 16e38a9a84c46b0cd4fd7b0f2f88e9d8054ccc0b.
2020-05-28 13:00:20 +02:00
Nikita Zlobin
12bea04941 optimization 2020-05-26 22:59:01 +05:00
Nikita Zlobin
6413a4d6f8 Revert "Support arbitrary hex color formats (16/32bits per component)"
This reverts commit 1e36a6b4ac569527981e06db429f3e6cd8ac99b8.
2020-05-26 22:28:05 +05:00
Nikita Zlobin
d110ba93e6 Revert "Floating point color config formats"
This reverts commit 6b28d57730a390264b4d0daea2d765f841ad90d8.
2020-05-26 22:27:31 +05:00
Nikita Zlobin
98debc663a simplify UINT_MAX_N
Probably I was too precatious, not relying to common rule about
unsigned subtraction to minus.
2020-05-26 18:35:37 +05:00
Nikita Zlobin
d45888a785 Don't mix separator with underlying content 2020-05-23 14:14:50 +05:00
Nikita Zlobin
6b28d57730 Floating point color config formats 2020-05-23 14:14:50 +05:00
Nikita Zlobin
1e36a6b4ac Support arbitrary hex color formats (16/32bits per component)
It's unlikely that string_to_color() is faster, but at least is more
flexible. Not sure if 8-digit per channel format is used.
2020-05-23 14:14:50 +05:00
Nikita Zlobin
7226ef2c15 Support for different color config precisions (#RGB format)
Support for #RGB is claimed in docs.
2020-05-23 14:14:50 +05:00
Nikita Zlobin
2e2b3e549f RGBA color support 2020-05-23 14:14:50 +05:00
Nikita Zlobin
9833fbba1f Limit frame stroke area 2020-05-23 14:14:50 +05:00
Nikita Zlobin
8d8e6882e8 style fix 2020-05-23 14:14:50 +05:00
Nikita Zlobin
73b7176e0b Reuse draw_rounded_rect() for xshape drawing 2020-05-20 21:15:01 +05:00
Nikita Zlobin
85ea8b8aa8 Separate some functions 2020-05-20 21:10:45 +05:00
Nikita Zlobin
5fd090e618 Frame internal radius 2020-05-06 22:27:39 +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
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
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
Benedikt Heine
4f510e1703 Query the X11 screen's DPI instead of monitor
When changing the DPI via xrandr --dpi <DPI>, xrandr will send a
RRScreenChangeEvent and the DPI value should get adjusted.

Falsely, we thought randr_update() would catch up and query the right
monitor values. But nothing changes, because we query the
XRRMonitorInfo. The monitor info contains the real physical width and
height of the monitor's screen.

But xrandr --dpi only changes the - let's say - virtual screen size of
the virtual overall screen (and therefore changing the DPI to the
matching value).

Important commands to understand:

- Changes dpi of the virtual screen

    xrandr --dpi

- Gives info about the "virtual" screen size (used by DisplayWidth)

    xdpyinfo | grep -B1 resolution

- Gives info about the "physical" screen size (used by XRRMonitorInfo)

    xrandr -q

I know, that I'm probably not right and might not understand the topic
in its full size yet[0]. But I'm 100% sure, that the terms "monitor",
"screen", "screens", "output" and "display" do not have a consistent
naming scheme.
[0] https://twitter.com/dechampsgu/status/857924498280124416

Fixes #382
2019-03-23 20:01:27 +02:00
Benedikt Heine
f9f5804b08 Remove notification_icon_get wrapper 2019-01-07 17:56:00 +01:00
Benedikt Heine
41ce7cce4a Add string_parse_* functions
Changes all string parsers to have a the almost same interface while
also having a proper return value, which indicates success of the
parsing process.
2019-01-07 15:32:28 +01:00
Benedikt Heine
c3cd623f41 Use notification_colors struct for notification colors 2018-11-26 17:31:46 +01:00
Benedikt Heine
9b45a111f1 Sort includes alphabetically 2018-11-15 15:17:48 +01:00
Benedikt Heine
3b3ed0328e Free layouts inline 2018-10-01 15:05:42 +02:00
Benedikt Heine
476ddc81ff Remove last "color color" 2018-09-16 02:58:40 +02:00
Benedikt Heine
41af2e0a0e Rename variable name color to actual foreground 2018-09-16 02:58:38 +02:00
Benedikt Heine
c712f57ace Reformat ellipsize enum 2018-09-16 02:58:37 +02:00
Benedikt Heine
c5d552856f Reformat icon_position enum 2018-09-16 02:58:35 +02:00
Benedikt Heine
2a5fe938f6 Reformat alignment enum 2018-09-16 02:58:33 +02:00
Benedikt Heine
bbbddad3a7 Use structs for notifications 2018-09-16 02:58:31 +02:00
Benedikt Heine
c944949e36 Pack types from x.c into structs 2018-09-16 02:58:13 +02:00
Benedikt Heine
4c26ab442a Use the first waiting notification to generate xmore
Using the last notification from displayed creates confusion about
nonexisting notifications.
2018-09-13 12:08:41 +02:00
Benedikt Heine
a229363dbd Simplify colored_layout codepaths 2018-07-07 11:54:41 +02:00
Benedikt Heine
d5fd674d2f Simplify corner arcs in cairo 2018-05-28 13:36:45 +03:00