The timeline of this issue is as follows:
In 7a094bc a call to XClearWindow/XFlush was added as part of RGBA
support.
Afterwards, I noticed that there is some noticeable flicker while
redrawing for large notifications, so I foolishly removed both of these
calls without considering the full effects.
As a result when redrawing notifications 'stack up' with each-other.
After a testing it seems that the XFlush call that was causing
the flicker is not necessary and XClearWindow works without it.
Fixes#728
This reverts commit 7a094bc702149104cd4049281a7dd9ed0ab76c89.
This commit caused a flicker effect every time the window was redrawn,
reverting it for now.
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.
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.
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
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.
Just recently, I started using g_return_val_if_fail as a brief assertion
checker. It'll also exit the function with a specified return value.
But actually this introduces some weird behavior. It's configurable by
environment variables and it'll print out a log message, if the
expression didn't validate properly. But some of these assertions are
actually ment to be silent.
Using a simple macro makes it simple to structure the assertions and its
return values in a block at the start of a function or anywhere else.
The xctx color field is a full duplicate of the settings logic.
Only logic included in xctx color fields, are the frame colors, which
fall back to the global frame setting. So, this required to handle it
directly in settings.c
Focus events do not mark any change in state of the notifications so
calling wake_up as a response is a wake of CPU cycles. Instead treat
them like PropertyNotify and only redraw if we need to change monitors.
* Move mouse_left/middle/right_click to global section
* Match the enum value style
* Ignore unknow mouse event
* Split copy-paste code into a function
* Fix typo
All XEvents only got logged with their IDs. It makes more sense to write
out the XEvent's name. Also, writing that we received an XEvent and then
logging again, that we ignored it, makes no sense.
When using round corners, the shape_gc in x_win_round_corners never got
freed. This created a memory leak in x11 itself and let the X process
create more load while becoming sluggish in some situations.
From the docs, XFreeGC actually could return an int and could throw a
BadGC error. Neither of them are important to catch in our situation:
- Having a look into the Xlib sourcecode, XFreeGC returns always 1.
- As we don't overwrite the shape_gc or do any other destoying calls,
the BadGC can't happen in this code.