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
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.
`g_option_context_parse` which we use to parse command line arguments
leaves the argument terminator, "--", in the argv under specific
circumstances which can cause inconsistent results.
Credit to Opal Hart for reporting this.
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
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
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
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.
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.
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.
The Xft.dpi value is one way to set the dpi of the X11 display. Querying
this value requires much overhead. Therefore we have to cache this.
Previously we did just query it at the beginning and ignored further
changes.
As there is no native signal to catch a change in its xrdb value, we
have to rely on the root window's PropertyNotify event and filter there
the RESOURCE_MANAGER atom.
This will get hooked up later.
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/857924498280124416Fixes#382
If n < screens_len, screens_len did not get updated. So boundary
checks wouldn't catch, if screens between n and screens_len are
accessed. This will prevent such an error type in the future.
Variables with trailing comments include the spaces leading up to the
comment (https://www.gnu.org/software/make/manual/make.html#Flavors)
so the corresponding install command looked like
"install -Dm644 docs/dunst.1 $(DESTDIR)/usr/share/man /man1/dunst.1"
We currently do not keep track of header files in our Makefile so if one
is changed it can lead to multiple incompatible binary files being
linked. Instead we now create dependency lists for each source file and
recompile them if the need arises.
Fixes#594