Mercurial > pidgin
comparison src/idle.c @ 2114:c582116e8463
[gaim-migrate @ 2124]
this might stop the occasional segfault.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Fri, 03 Aug 2001 09:40:13 +0000 |
parents | b66aca8e8dce |
children | 3ce77b547cf2 |
comparison
equal
deleted
inserted
replaced
2113:9f83b7ef1fdc | 2114:c582116e8463 |
---|---|
54 time(&t); | 54 time(&t); |
55 | 55 |
56 | 56 |
57 #ifdef USE_SCREENSAVER | 57 #ifdef USE_SCREENSAVER |
58 if (report_idle == IDLE_SCREENSAVER) { | 58 if (report_idle == IDLE_SCREENSAVER) { |
59 if (!d) | 59 if (d || (d = XOpenDisplay((char *)NULL))) { |
60 d = XOpenDisplay((char *)NULL); | 60 if (mit_info == NULL) { |
61 if (mit_info == NULL) { | 61 mit_info = XScreenSaverAllocInfo(); |
62 mit_info = XScreenSaverAllocInfo(); | 62 } |
63 } | 63 XScreenSaverQueryInfo(d, DefaultRootWindow(d), mit_info); |
64 XScreenSaverQueryInfo(d, DefaultRootWindow(d), mit_info); | 64 idle_time = (mit_info->idle) / 1000; |
65 idle_time = (mit_info->idle) / 1000; | 65 } else |
66 idle_time = 0; | |
66 } else | 67 } else |
67 #endif /* USE_SCREENSAVER */ | 68 #endif /* USE_SCREENSAVER */ |
68 idle_time = t - gc->lastsent; | 69 idle_time = t - gc->lastsent; |
69 | 70 |
70 if ((general_options & OPT_GEN_AUTO_AWAY) && (idle_time > (60 * auto_away)) && | 71 if ((general_options & OPT_GEN_AUTO_AWAY) && (idle_time > (60 * auto_away)) && |