fix(xcb): Use xcb_rectangle for monitor bounds

This commit is contained in:
Michael Carlberg
2016-06-24 01:42:58 +02:00
parent cc9d385b6f
commit 718cfd294d
3 changed files with 10 additions and 18 deletions

View File

@ -86,14 +86,14 @@ Bar::Bar() : config_path(config::get_bar_path()), opts(std::make_unique<Options>
auto height = config::get<std::string>(this->config_path, "height", "30");
if (width.find("%") != std::string::npos) {
this->opts->width = this->opts->monitor->width * (std::atoi(width.c_str()) / 100.0) + 0.5;
this->opts->width = this->opts->monitor->bounds.width * (std::atoi(width.c_str()) / 100.0) + 0.5;
this->opts->width -= this->opts->offset_x * 2;
} else {
this->opts->width = std::atoi(width.c_str());
}
if (height.find("%") != std::string::npos) {
this->opts->height = this->opts->monitor->height * (std::atoi(height.c_str()) / 100.0) + 0.5;
this->opts->height = this->opts->monitor->bounds.height * (std::atoi(height.c_str()) / 100.0) + 0.5;
this->opts->width -= this->opts->offset_y * 2;
} else {
this->opts->height = std::atoi(height.c_str());