X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=openbox%2Fframe.c;h=dfb9c49a2e0c586f56f36efe36c08f9bfc770d40;hb=d67b818ae90c5574166d08422d3e9a68d8d65e16;hp=3dbcf1265d6088acb5358d4877f072efb3ade53a;hpb=effa8667e1bcc62361d5d54cd0581e3294203f90;p=chaz%2Fopenbox diff --git a/openbox/frame.c b/openbox/frame.c index 3dbcf126..dfb9c49a 100644 --- a/openbox/frame.c +++ b/openbox/frame.c @@ -1673,11 +1673,13 @@ static gboolean flash_timeout(gpointer data) ObFrame *self = data; GTimeVal now; - g_get_current_time(&now); - if (now.tv_sec > self->flash_end.tv_sec || - (now.tv_sec == self->flash_end.tv_sec && - now.tv_usec >= self->flash_end.tv_usec)) - self->flashing = FALSE; + if (config_frame_flash_duration != 0) { + g_get_current_time(&now); + if (now.tv_sec > self->flash_end.tv_sec || + (now.tv_sec == self->flash_end.tv_sec && + now.tv_usec >= self->flash_end.tv_usec)) + self->flashing = FALSE; + } if (!self->flashing) return FALSE; /* we are done */ @@ -1693,14 +1695,19 @@ static gboolean flash_timeout(gpointer data) void frame_flash_start(ObFrame *self) { + if (config_frame_flash_delay == 0) return; + self->flash_on = self->focused; if (!self->flashing) self->flash_timer = g_timeout_add_full(G_PRIORITY_DEFAULT, - 600, flash_timeout, self, + config_frame_flash_delay, flash_timeout, self, flash_done); - g_get_current_time(&self->flash_end); - g_time_val_add(&self->flash_end, G_USEC_PER_SEC * 5); + + if (config_frame_flash_duration != 0) { + g_get_current_time(&self->flash_end); + g_time_val_add(&self->flash_end, 1000 * config_frame_flash_duration); + } self->flashing = TRUE; }