mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-05 21:07:52 +00:00
Fix building without X11 support broke after commits f1c47e5fc4
and 670e9a0eb1
This commit is contained in:
parent
ba414d8ab8
commit
09d41cb0b6
15
src/conky.c
15
src/conky.c
@ -452,10 +452,10 @@ int check_contains(char *f, char *s)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef X11
|
|
||||||
|
|
||||||
#define SECRIT_MULTILINE_CHAR '\x02'
|
#define SECRIT_MULTILINE_CHAR '\x02'
|
||||||
|
|
||||||
|
#ifdef X11
|
||||||
|
|
||||||
static inline int calc_text_width(const char *s, int l)
|
static inline int calc_text_width(const char *s, int l)
|
||||||
{
|
{
|
||||||
if ((output_methods & TO_X) == 0) {
|
if ((output_methods & TO_X) == 0) {
|
||||||
@ -5858,8 +5858,10 @@ static void generate_text_internal(char *p, int p_max_size,
|
|||||||
if(buf[obj->data.scroll.start] == 0){
|
if(buf[obj->data.scroll.start] == 0){
|
||||||
obj->data.scroll.start = 0;
|
obj->data.scroll.start = 0;
|
||||||
}
|
}
|
||||||
|
#ifdef X11
|
||||||
//reset color when scroll is finished
|
//reset color when scroll is finished
|
||||||
new_fg(p + strlen(p), obj->data.scroll.resetcolor);
|
new_fg(p + strlen(p), obj->data.scroll.resetcolor);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
OBJ(combine) {
|
OBJ(combine) {
|
||||||
char buf[2][max_user_text];
|
char buf[2][max_user_text];
|
||||||
@ -6144,18 +6146,16 @@ static inline int get_string_width(const char *s)
|
|||||||
return strlen(s);
|
return strlen(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef X11
|
||||||
static int get_string_width_special(char *s, int special_index)
|
static int get_string_width_special(char *s, int special_index)
|
||||||
{
|
{
|
||||||
#ifdef X11
|
|
||||||
char *p, *final;
|
char *p, *final;
|
||||||
int idx = 1;
|
int idx = 1;
|
||||||
int width = 0;
|
int width = 0;
|
||||||
long i;
|
long i;
|
||||||
|
|
||||||
if ((output_methods & TO_X) == 0) {
|
if ((output_methods & TO_X) == 0) {
|
||||||
#endif /* X11 */
|
|
||||||
return (s) ? strlen(s) : 0;
|
return (s) ? strlen(s) : 0;
|
||||||
#ifdef X11
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!s) {
|
if (!s) {
|
||||||
@ -6190,10 +6190,8 @@ static int get_string_width_special(char *s, int special_index)
|
|||||||
}
|
}
|
||||||
free(final);
|
free(final);
|
||||||
return width;
|
return width;
|
||||||
#endif /* X11 */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef X11
|
|
||||||
static int text_size_updater(char *s, int special_index);
|
static int text_size_updater(char *s, int special_index);
|
||||||
|
|
||||||
int last_font_height;
|
int last_font_height;
|
||||||
@ -6943,7 +6941,8 @@ static int draw_line(char *s, int special_index)
|
|||||||
if ((output_methods & TO_X) == 0) {
|
if ((output_methods & TO_X) == 0) {
|
||||||
#endif /* X11 */
|
#endif /* X11 */
|
||||||
draw_string(s);
|
draw_string(s);
|
||||||
return 0;
|
//'special_index - special_index' instead of 0 otherwise gcc complains about not using special_index when build without X11
|
||||||
|
return special_index - special_index;
|
||||||
#ifdef X11
|
#ifdef X11
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user