1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2025-01-12 02:59:08 +00:00

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)
This commit is contained in:
Phil Sutter 2009-11-26 00:02:57 +01:00
parent 6004ab961a
commit ef60b7eb8a
3 changed files with 5 additions and 18 deletions

View File

@ -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);

View File

@ -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")

View File

@ -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)