if (snapshot_path) g_free(snapshot_path);
cleanup_server();
- XCloseDisplay(server.dsp);
+ if (server.dsp) XCloseDisplay(server.dsp);
}
default:
if (e.type == XDamageNotify+damage_event) {
+ // union needed to avoid strict-aliasing warnings by gcc
+ union { XEvent e; XDamageNotifyEvent de; } event_union = {.e=e};
TrayWindow *traywin;
GSList *l;
- XDamageNotifyEvent* de = (XDamageNotifyEvent*)&e;
+ XDamageNotifyEvent* de = &event_union.de;
for (l = systray.list_icons; l ; l = l->next) {
traywin = (TrayWindow*)l->data;
if ( traywin->id == de->drawable && !de->more ) {