# HG changeset patch # User Rob Flynn # Date 972560922 0 # Node ID e4147c8604cc6ec865ace281cf25e953ebaee7b2 # Parent a375efb2884e5932a4719d937b1ab3a1e726e688 [gaim-migrate @ 1038] This is a little more efficient. committer: Tailor Script diff -r a375efb2884e -r e4147c8604cc src/idle.c --- a/src/idle.c Thu Oct 26 11:45:56 2000 +0000 +++ b/src/idle.c Thu Oct 26 11:48:42 2000 +0000 @@ -42,7 +42,7 @@ time_t t; #ifdef USE_SCREENSAVER static XScreenSaverInfo *mit_info = NULL; - Display *d; + static Display *d = NULL; time_t idle_time; #endif @@ -64,13 +64,13 @@ #ifdef USE_SCREENSAVER if (report_idle == IDLE_SCREENSAVER) { - d = XOpenDisplay((char *)NULL); + if (!d) + d = XOpenDisplay((char *)NULL); if (mit_info == NULL) { mit_info = XScreenSaverAllocInfo (); } XScreenSaverQueryInfo (d, DefaultRootWindow(d), mit_info); idle_time = (mit_info->idle)/1000; - XCloseDisplay(d); } else #endif /* USE_SCREENSAVER */ idle_time = t - gc->lastsent;