Skip to content

Commit

Permalink
SQUASH
Browse files Browse the repository at this point in the history
  • Loading branch information
somiaj committed Apr 7, 2024
1 parent 2f73b63 commit e331142
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions modules/FvwmPager/x_pager.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ static void fvwmrec_to_pager(rectangle *, bool, struct fpmonitor *);
static void pagerrec_to_fvwm(rectangle *, bool, struct fpmonitor *);
static char *GetBalloonLabel(const PagerWindow *pw,const char *fmt);
static int is_window_visible(PagerWindow *t);
static void draw_grid_label(char *label, char *small, int desk,
static void draw_grid_label(const char *label, const char *small, int desk,
int x, int y, int width, int height, bool hilight);

#define MAX_UNPROCESSED_MESSAGES 1
Expand Down Expand Up @@ -1826,15 +1826,16 @@ void ReConfigureAll(void)
* Draw grid lines for desk #i
*
*/
void draw_grid_label(char *label, char *small, int desk,
void draw_grid_label(const char *label, const char *small, int desk,
int x, int y, int width, int height, bool hilight)
{
int w, cs;
char *str = label;
char *str = fxstrdup(label);

w = FlocaleTextWidth(Ffont, str, strlen(label));
if (w > width) {
str = small;
free(str);
str = fxstrdup(small);
w = FlocaleTextWidth(Ffont, str, strlen(str));
}

Expand Down Expand Up @@ -1865,6 +1866,7 @@ void draw_grid_label(char *label, char *small, int desk,
FlocaleDrawString(dpy, Ffont, FwinString, 0);
}

free(str);
return;
}

Expand Down Expand Up @@ -2002,7 +2004,7 @@ void DrawGrid(int desk, Window ew, XRectangle *r)

snprintf(str, sizeof(str), "%d", loop + 1);
draw_grid_label(
(char *)tm->m->si->name, str,
tm->m->si->name, str,
desk, loop * label_width, y_loc,
label_width, height,
!(CurrentDeskPerMonitor &&
Expand Down

0 comments on commit e331142

Please sign in to comment.