Add missing MAX macros, ensure that i3 can be compiled without pango
This commit is contained in:
parent
d68387bf5d
commit
301320585e
@ -397,9 +397,11 @@ static void draw_text_xcb(const xcb_char2b_t *text, size_t text_len, xcb_drawabl
|
|||||||
void draw_text(i3String *text, xcb_drawable_t drawable, xcb_gcontext_t gc,
|
void draw_text(i3String *text, xcb_drawable_t drawable, xcb_gcontext_t gc,
|
||||||
xcb_visualtype_t *visual, int x, int y, int max_width) {
|
xcb_visualtype_t *visual, int x, int y, int max_width) {
|
||||||
assert(savedFont != NULL);
|
assert(savedFont != NULL);
|
||||||
|
#if PANGO_SUPPORT
|
||||||
if (visual == NULL) {
|
if (visual == NULL) {
|
||||||
visual = root_visual_type;
|
visual = root_visual_type;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (savedFont->type) {
|
switch (savedFont->type) {
|
||||||
case FONT_TYPE_NONE:
|
case FONT_TYPE_NONE:
|
||||||
|
@ -11,6 +11,10 @@
|
|||||||
*/
|
*/
|
||||||
#include "all.h"
|
#include "all.h"
|
||||||
|
|
||||||
|
#ifndef MAX
|
||||||
|
#define MAX(x, y) ((x) > (y) ? (x) : (y))
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Calculates sum of heights and sum of widths of all currently active outputs
|
* Calculates sum of heights and sum of widths of all currently active outputs
|
||||||
*
|
*
|
||||||
|
@ -341,10 +341,12 @@ char *pango_escape_markup(char *input) {
|
|||||||
if (!font_is_pango())
|
if (!font_is_pango())
|
||||||
return input;
|
return input;
|
||||||
|
|
||||||
|
#if PANGO_SUPPORT
|
||||||
char *escaped = g_markup_escape_text(input, -1);
|
char *escaped = g_markup_escape_text(input, -1);
|
||||||
FREE(input);
|
FREE(input);
|
||||||
|
|
||||||
return escaped;
|
return escaped;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
4
src/x.c
4
src/x.c
@ -12,6 +12,10 @@
|
|||||||
*/
|
*/
|
||||||
#include "all.h"
|
#include "all.h"
|
||||||
|
|
||||||
|
#ifndef MAX
|
||||||
|
#define MAX(x, y) ((x) > (y) ? (x) : (y))
|
||||||
|
#endif
|
||||||
|
|
||||||
xcb_window_t ewmh_window;
|
xcb_window_t ewmh_window;
|
||||||
|
|
||||||
/* Stores the X11 window ID of the currently focused window */
|
/* Stores the X11 window ID of the currently focused window */
|
||||||
|
Loading…
Reference in New Issue
Block a user