From ef60b7eb8a9fbe1281e5f1c698faeb70b4f30f00 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 26 Nov 2009 00:02:57 +0100 Subject: [PATCH] drop update_x11info() instead: - call XDefaultScreen() and XScreenCount() directly from the print callback - have no update callback at all for the desktop objects (seems to work well without) --- src/common.h | 4 ---- src/core.c | 10 +++++----- src/x11.c | 9 --------- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/src/common.h b/src/common.h index 153abecd..a1d14eb4 100644 --- a/src/common.h +++ b/src/common.h @@ -49,10 +49,6 @@ void variable_substitute(const char *s, char *dest, unsigned int n); void format_seconds(char *buf, unsigned int n, long t); void format_seconds_short(char *buf, unsigned int n, long t); -#ifdef X11 -void update_x11info(void); -#endif - int round_to_int_temp(float); unsigned int round_to_int(float); diff --git a/src/core.c b/src/core.c index 2bfa018b..747f7521 100644 --- a/src/core.c +++ b/src/core.c @@ -806,15 +806,15 @@ struct text_object *construct_text_object(const char *s, const char *arg, long parse_mixer_arg(obj, arg); obj->callbacks.iftest = &check_mixer_muted; #ifdef X11 - END OBJ(monitor, &update_x11info) + END OBJ(monitor, 0) obj->callbacks.print = &print_monitor; - END OBJ(monitor_number, &update_x11info) + END OBJ(monitor_number, 0) obj->callbacks.print = &print_monitor_number; - END OBJ(desktop, &update_x11info) + END OBJ(desktop, 0) obj->callbacks.print = &print_desktop; - END OBJ(desktop_number, &update_x11info) + END OBJ(desktop_number, 0) obj->callbacks.print = &print_desktop_number; - END OBJ(desktop_name, &update_x11info) + END OBJ(desktop_name, 0) obj->callbacks.print = &print_desktop_name; #endif END OBJ_ARG(format_time, 0, "format_time needs a pid as argument") diff --git a/src/x11.c b/src/x11.c index 25d9d210..cd8b7e4b 100644 --- a/src/x11.c +++ b/src/x11.c @@ -680,15 +680,6 @@ void get_x11_desktop_info(Display *current_display, Atom atom) } } -void update_x11info(void) -{ - struct information *current_info = &info; - if (!x_initialised == YES) - return; - current_info->x11.monitor.number = XScreenCount(display); - current_info->x11.monitor.current = XDefaultScreen(display); -} - #define NOT_IN_X "Not running in X" void print_monitor(struct text_object *obj, char *p, int p_max_size)