Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into revert/dpi-changes
Browse files Browse the repository at this point in the history
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
  • Loading branch information
Caellian committed Jun 1, 2024
2 parents e67181b + c8b127d commit 2ca9093
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmake/Conky.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ endif(OS_HAIKU)
# Do version stuff
set(VERSION_MAJOR "1")
set(VERSION_MINOR "21")
set(VERSION_PATCH "2")
set(VERSION_PATCH "3")

find_program(APP_AWK awk)

Expand Down
5 changes: 2 additions & 3 deletions src/conky.cc
Original file line number Diff line number Diff line change
Expand Up @@ -861,11 +861,10 @@ void update_text_area() {
text_size = conky::vec2i(dpi_scale(minimum_width.get(*state)), 0);
last_font_height = font_height();
for_each_line(text_buffer, text_size_updater);
text_size += conky::vec2i::UnitX();

text_size.max(conky::vec2i(text_size.x(), minimum_height.get(*state)));
text_size = text_size.max(conky::vec2i(text_size.x() + 1, minimum_height.get(*state)));
int mw = dpi_scale(maximum_width.get(*state));
if (mw > 0) text_size.min(conky::vec2i(mw, text_size.y()));
if (mw > 0) text_size = text_size.min(conky::vec2i(mw, text_size.y()));
}

alignment align = text_alignment.get(*state);
Expand Down
6 changes: 3 additions & 3 deletions src/scroll.cc
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,11 @@ void print_scroll(struct text_object *obj, char *p, unsigned int p_max_size) {
}

int pwithcolors_len = strlen(p) + 4 + colorchanges - visibcolorchanges;
char *pwithcolors = static_cast<char *>(malloc(pwithcolors_len));
char *pwithcolors = new char[pwithcolors_len];

for (j = 0; j < frontcolorchanges; j++) { pwithcolors[j] = SPECIAL_CHAR; }
pwithcolors[j] = 0;
strncat(pwithcolors, p, pwithcolors_len);
strcat(pwithcolors, p);
unsigned int strend = strlen(pwithcolors);
// and place the colorchanges not in front or in the visible part behind the
// visible part
Expand All @@ -284,7 +284,7 @@ void print_scroll(struct text_object *obj, char *p, unsigned int p_max_size) {
}
pwithcolors[strend + j] = 0;
strncpy(p, pwithcolors, p_max_size);
free(pwithcolors);
delete[] pwithcolors;

// scroll
if (sd->direction == SCROLL_LEFT) {
Expand Down

0 comments on commit 2ca9093

Please sign in to comment.