Conversation
Set workspace dimensions from WL output_geometry Signed-off-by: Tin Švagelj <[email protected]>
✅ Deploy Preview for conkyweb canceled.
|
Signed-off-by: Tin Švagelj <[email protected]>
11e4d54 to
5051e0a
Compare
Signed-off-by: Tin Švagelj <[email protected]>
Signed-off-by: Tin Švagelj <[email protected]>
Signed-off-by: Tin Švagelj <[email protected]>
Caellian
commented
Apr 30, 2024
Comment on lines
+1965
to
+1997
| // 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(); | ||
| } |
Collaborator
Author
There was a problem hiding this comment.
Adding $HOME/.config/conky and config parent directory to lua path before loading the script.
Caellian
commented
Apr 30, 2024
| float display_output_x11::get_dpi_scale() { | ||
| #ifdef BUILD_XFT | ||
| if (use_xft.get(*state) && xft_dpi > 0) { | ||
| return (value * xft_dpi + (value > 0 ? 48 : -48)) / PIXELS_PER_INCH; |
Collaborator
Author
There was a problem hiding this comment.
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.
Caellian
commented
Apr 30, 2024
Comment on lines
+304
to
+312
| // 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; |
Collaborator
Author
There was a problem hiding this comment.
This is the workarea change.
brndnmtthws
approved these changes
Apr 30, 2024
|
|
||
| /* path to config file */ | ||
| std::string current_config; | ||
| std::filesystem::path current_config; |
Caellian
added a commit
that referenced
this pull request
May 18, 2024
This was left over from #1877. Signed-off-by: Tin Švagelj <[email protected]>
This was referenced May 18, 2024
Caellian
added a commit
that referenced
this pull request
May 22, 2024
This was left over from #1877.
Caellian
added a commit
that referenced
this pull request
May 30, 2024
Signed-off-by: Tin Švagelj <[email protected]>
Caellian
added a commit
that referenced
this pull request
Jun 1, 2024
Signed-off-by: Tin Švagelj <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR removes
dpi_scaleing of maximum width setting.This seems incorrect because I expect maximum width to use absolute pixel value, otherwise meaning of
maximum_widthsetting 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:
workspacedimensions from WLoutput_geometrybecause workspace is used for some calculations inconky.cc.Testing
use_xft = truebreaks window sizing #1528 works better with/without this PR.