#define PING_TIMEOUT (G_USEC_PER_SEC * 3)
/*! Warn the user after this many PING_TIMEOUT intervals */
#define PING_TIMEOUT (G_USEC_PER_SEC * 3)
/*! Warn the user after this many PING_TIMEOUT intervals */
/* make sure we're not already pinging it */
for (it = ping_targets; it != NULL; it = g_slist_next(it)) {
t = it->data;
/* make sure we're not already pinging it */
for (it = ping_targets; it != NULL; it = g_slist_next(it)) {
t = it->data;
- if (t->sent == timestamp) {
- /*ob_debug("PONG: '%s' (timestamp %lu)\n", t->client->title,
- t->sent);*/
+ if (t->id == id) {
+ /*g_print("-PONG: '%s' (id %u)\n", t->client->title, t->id);*/
if (t->waiting > PING_TIMEOUT_WARN) {
/* we had notified that they weren't responding, so now we
need to notify that they are again */
if (t->waiting > PING_TIMEOUT_WARN) {
/* we had notified that they weren't responding, so now we
need to notify that they are again */
- t->sent = event_get_server_time();
- /*ob_debug("PING: '%s' (timestamp %lu)\n", t->client->title, t->sent);*/
+ t->id = ping_next_id++;
+ /*g_print("+PING: '%s' (id %u)\n", t->client->title, t->id);*/
PROP_MSG_TO(t->client->window, t->client->window, wm_protocols,
PROP_MSG_TO(t->client->window, t->client->window, wm_protocols,
- prop_atoms.net_wm_ping, t->sent, t->client->window, 0, 0,
+ prop_atoms.net_wm_ping, t->id, t->client->window, 0, 0,