X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Ftint.c;h=609a8d7cea645406314785276a21e4367098fbee;hb=d58d40cf86b22fb1339afb8ce9775182462162e5;hp=005be632814999af7ca5f25995643211bc5527a5;hpb=0c7cfd98d5af72893ae326015e7d34555a477b2a;p=chaz%2Ftint2 diff --git a/src/tint.c b/src/tint.c index 005be63..609a8d7 100644 --- a/src/tint.c +++ b/src/tint.c @@ -157,7 +157,7 @@ void cleanup() if (snapshot_path) g_free(snapshot_path); cleanup_server(); - XCloseDisplay(server.dsp); + if (server.dsp) XCloseDisplay(server.dsp); } @@ -801,9 +801,11 @@ int main (int argc, char *argv[]) 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 ) {