Skip to content

Commit e67181b

Browse files
committed
Revert changes from #1926 & #1877
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
1 parent 8e36363 commit e67181b

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/conky.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -858,13 +858,13 @@ void update_text_area() {
858858
if (fixed_size == 0)
859859
#endif
860860
{
861-
text_size = conky::vec2i(minimum_width.get(*state), 0);
861+
text_size = conky::vec2i(dpi_scale(minimum_width.get(*state)), 0);
862862
last_font_height = font_height();
863863
for_each_line(text_buffer, text_size_updater);
864864
text_size += conky::vec2i::UnitX();
865865

866866
text_size.max(conky::vec2i(text_size.x(), minimum_height.get(*state)));
867-
int mw = maximum_width.get(*state);
867+
int mw = dpi_scale(maximum_width.get(*state));
868868
if (mw > 0) text_size.min(conky::vec2i(mw, text_size.y()));
869869
}
870870

@@ -983,7 +983,7 @@ static int text_size_updater(char *s, int special_index) {
983983
w += get_string_width(s);
984984

985985
if (w > text_size.x()) { text_size.set_x(w); }
986-
int mw = maximum_width.get(*state);
986+
int mw = dpi_scale(maximum_width.get(*state));
987987
if (mw > 0) { text_size.set_x(std::min(mw, text_size.x())); }
988988

989989
text_size += conky::vec2i(0, last_font_height);
@@ -1047,7 +1047,7 @@ static void draw_string(const char *s) {
10471047
}
10481048
#ifdef BUILD_GUI
10491049
if (display_output() && display_output()->graphical()) {
1050-
int mw = maximum_width.get(*state);
1050+
int mw = dpi_scale(maximum_width.get(*state));
10511051
if (text_size.x() == mw) {
10521052
/* this means the text is probably pushing the limit,
10531053
* so we'll chop it */
@@ -1106,7 +1106,7 @@ int draw_each_line_inner(char *s, int special_index, int last_special_applied) {
11061106
#ifdef BUILD_GUI
11071107
int font_h = 0;
11081108
int cur_y_add = 0;
1109-
int mw = maximum_width.get(*state);
1109+
int mw = dpi_scale(maximum_width.get(*state));
11101110
#endif /* BUILD_GUI */
11111111
char *p = s;
11121112
int orig_special_index = special_index;

src/display-wayland.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ bool display_output_wayland::main_loop_wait(double t) {
661661
text_size.y() + 2 * border_total != height || scale_changed)) {
662662
/* clamp text_width to configured maximum */
663663
if (maximum_width.get(*state)) {
664-
int mw = maximum_width.get(*state);
664+
int mw = global_window->scale * maximum_width.get(*state);
665665
if (mw > 0) { text_size.set_x(std::min(mw, text_size.x())); }
666666
}
667667

src/display-x11.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ bool handle_event<x_event_handler::CONFIGURE>(
665665
text_size = window.geometry.size() - border_total;
666666

667667
// don't apply dpi scaling to max pixel size
668-
int mw = maximum_width.get(*state);
668+
int mw = dpi_scale(maximum_width.get(*state));
669669
if (mw > 0) { text_size.set_x(std::min(mw, text_size.x())); }
670670
}
671671

0 commit comments

Comments
 (0)