mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-25 10:45:58 +01:00
Fix fallback cairo rect size and ramove do while
This commit is contained in:
parent
377a2e441b
commit
284b90c75f
1 changed files with 7 additions and 11 deletions
|
@ -1723,19 +1723,15 @@ void CHyprOpenGLImpl::createBGTextureForMonitor(CMonitor* pMonitor) {
|
||||||
texName += "2K.png";
|
texName += "2K.png";
|
||||||
}
|
}
|
||||||
|
|
||||||
// goto is banned? ok have a do while.
|
std::string texPath;
|
||||||
std::string texPath = "/usr/share/hyprland/" + texName;
|
auto paths = {"/usr/share/hyprland/", "/usr/local/share/hyprland/", "assets/"};
|
||||||
do {
|
|
||||||
if (std::filesystem::exists(texPath))
|
for (auto& path : paths) {
|
||||||
break;
|
texPath = path + texName;
|
||||||
texPath = "/usr/local/share/hyprland/" + texName;
|
|
||||||
if (std::filesystem::exists(texPath))
|
|
||||||
break;
|
|
||||||
texPath = "assets/" + texName;
|
|
||||||
if (std::filesystem::exists(texPath))
|
if (std::filesystem::exists(texPath))
|
||||||
break;
|
break;
|
||||||
texPath = "";
|
texPath = "";
|
||||||
} while (false);
|
}
|
||||||
|
|
||||||
PTEX->m_vSize = textureSize;
|
PTEX->m_vSize = textureSize;
|
||||||
|
|
||||||
|
@ -1771,7 +1767,7 @@ void CHyprOpenGLImpl::createBGTextureForMonitor(CMonitor* pMonitor) {
|
||||||
|
|
||||||
if (texPath.empty()) {
|
if (texPath.empty()) {
|
||||||
cairo_set_source_rgba(CAIRO, 0.106, 0.106, 0.106, 1.0);
|
cairo_set_source_rgba(CAIRO, 0.106, 0.106, 0.106, 1.0);
|
||||||
cairo_rectangle(CAIRO, 0, 0, box.width, box.height);
|
cairo_rectangle(CAIRO, 0, 0, textureSize.x, textureSize.y);
|
||||||
cairo_fill(CAIRO);
|
cairo_fill(CAIRO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue