-
-
Notifications
You must be signed in to change notification settings - Fork 626
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Remove dpi scaling of maximum width #1877
Conversation
Set workspace dimensions from WL output_geometry Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
✅ Deploy Preview for conkyweb canceled.
|
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
11e4d54
to
5051e0a
Compare
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
// Extend lua package.path so scripts can use relative paths | ||
{ | ||
struct stat file_stat {}; | ||
|
||
std::string path_ext; | ||
|
||
// add XDG directory to lua path | ||
auto xdg_path = | ||
std::filesystem::path(to_real_path(XDG_CONFIG_FILE)).parent_path(); | ||
if (stat(xdg_path.c_str(), &file_stat) == 0) { | ||
path_ext.push_back(';'); | ||
path_ext.append(xdg_path); | ||
path_ext.append("/?.lua"); | ||
} | ||
|
||
auto parent_path = current_config.parent_path(); | ||
if (xdg_path != parent_path && stat(path_ext.c_str(), &file_stat) == 0) { | ||
path_ext.push_back(';'); | ||
path_ext.append(parent_path); | ||
path_ext.append("/?.lua"); | ||
} | ||
|
||
l.getglobal("package"); | ||
l.getfield(-1, "path"); | ||
|
||
auto path = l.tostring(-1); | ||
path.append(path_ext); | ||
l.pop(); | ||
l.pushstring(path.c_str()); | ||
|
||
l.setfield(-2, "path"); | ||
l.pop(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding $HOME/.config/conky
and config parent directory to lua path before loading the script.
if (use_xft.get(*state) && xft_dpi > 0) { | ||
return (value * xft_dpi + (value > 0 ? 48 : -48)) / PIXELS_PER_INCH; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe (value > 0 ? 48 : -48)
was rounding the result for int
values before, so I replaced it with ceil
and floor
in new code. PIXELS_PER_INCH
is 96.
// TODO: Add support for proper output management through: | ||
// - xdg-output-unstable-v1 | ||
// Maybe also support (if XDG protocol not reported): | ||
// - kde-output-management(-v2) | ||
// - wlr-output-management-unstable-v1 | ||
workarea[0] = x; // TODO: use xdg_output.logical_position | ||
workarea[1] = y; | ||
workarea[2] = physical_width; | ||
workarea[3] = physical_height; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the workarea change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable.
@@ -275,7 +276,7 @@ int text_width = 1, | |||
struct information info; | |||
|
|||
/* path to config file */ | |||
std::string current_config; | |||
std::filesystem::path current_config; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
This was left over from #1877. Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
This was left over from #1877.
Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
This PR removes
dpi_scale
ing of maximum width setting.This seems incorrect because I expect maximum width to use absolute pixel value, otherwise meaning of
maximum_width
setting changes with DPI:NOTE: Height difference is caused by font height, conky height can't be limited.
This fixes #1528.
This PR also fixes a regression introduced in #1841, where I incorrectly assumed templated base class function would be overriden by display outputs so DPI scaling was completely disabled.
Other changes
This PR also:
workspace
dimensions from WLoutput_geometry
because workspace is used for some calculations inconky.cc
.Testing
use_xft = true
breaks window sizing #1528 works better with/without this PR.