mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-02 17:05:58 +01:00
parent
f21b6fe576
commit
0cb8fbe18e
2 changed files with 10 additions and 6 deletions
|
@ -374,6 +374,7 @@ CConfigManager::CConfigManager() {
|
||||||
m_pConfig->addConfigValue("debug:manual_crash", Hyprlang::INT{0});
|
m_pConfig->addConfigValue("debug:manual_crash", Hyprlang::INT{0});
|
||||||
m_pConfig->addConfigValue("debug:suppress_errors", Hyprlang::INT{0});
|
m_pConfig->addConfigValue("debug:suppress_errors", Hyprlang::INT{0});
|
||||||
m_pConfig->addConfigValue("debug:error_limit", Hyprlang::INT{5});
|
m_pConfig->addConfigValue("debug:error_limit", Hyprlang::INT{5});
|
||||||
|
m_pConfig->addConfigValue("debug:error_position", Hyprlang::INT{0});
|
||||||
m_pConfig->addConfigValue("debug:watchdog_timeout", Hyprlang::INT{5});
|
m_pConfig->addConfigValue("debug:watchdog_timeout", Hyprlang::INT{5});
|
||||||
m_pConfig->addConfigValue("debug:disable_scale_checks", Hyprlang::INT{0});
|
m_pConfig->addConfigValue("debug:disable_scale_checks", Hyprlang::INT{0});
|
||||||
m_pConfig->addConfigValue("debug:colored_stdout_logs", Hyprlang::INT{1});
|
m_pConfig->addConfigValue("debug:colored_stdout_logs", Hyprlang::INT{1});
|
||||||
|
|
|
@ -58,8 +58,11 @@ void CHyprError::createQueued() {
|
||||||
cairo_paint(CAIRO);
|
cairo_paint(CAIRO);
|
||||||
cairo_restore(CAIRO);
|
cairo_restore(CAIRO);
|
||||||
|
|
||||||
const auto LINECOUNT = Hyprlang::INT{1} + std::count(m_szQueued.begin(), m_szQueued.end(), '\n');
|
const auto LINECOUNT = Hyprlang::INT{1} + std::count(m_szQueued.begin(), m_szQueued.end(), '\n');
|
||||||
static auto LINELIMIT = CConfigValue<Hyprlang::INT>("debug:error_limit");
|
static auto LINELIMIT = CConfigValue<Hyprlang::INT>("debug:error_limit");
|
||||||
|
static auto BAR_POSITION = CConfigValue<Hyprlang::INT>("debug:error_position");
|
||||||
|
|
||||||
|
const bool TOPBAR = *BAR_POSITION == 0;
|
||||||
|
|
||||||
const auto VISLINECOUNT = std::min(LINECOUNT, *LINELIMIT);
|
const auto VISLINECOUNT = std::min(LINECOUNT, *LINELIMIT);
|
||||||
const auto EXTRALINES = (VISLINECOUNT < LINECOUNT) ? 1 : 0;
|
const auto EXTRALINES = (VISLINECOUNT < LINECOUNT) ? 1 : 0;
|
||||||
|
@ -68,11 +71,11 @@ void CHyprError::createQueued() {
|
||||||
|
|
||||||
const double PAD = 10 * SCALE;
|
const double PAD = 10 * SCALE;
|
||||||
|
|
||||||
const double X = PAD;
|
|
||||||
const double Y = PAD;
|
|
||||||
const double WIDTH = PMONITOR->vecPixelSize.x - PAD * 2;
|
const double WIDTH = PMONITOR->vecPixelSize.x - PAD * 2;
|
||||||
const double HEIGHT = (FONTSIZE + 2 * (FONTSIZE / 10.0)) * (VISLINECOUNT + EXTRALINES) + 3;
|
const double HEIGHT = (FONTSIZE + 2 * (FONTSIZE / 10.0)) * (VISLINECOUNT + EXTRALINES) + 3;
|
||||||
const double RADIUS = PAD > HEIGHT / 2 ? HEIGHT / 2 - 1 : PAD;
|
const double RADIUS = PAD > HEIGHT / 2 ? HEIGHT / 2 - 1 : PAD;
|
||||||
|
const double X = PAD;
|
||||||
|
const double Y = TOPBAR ? PAD : PMONITOR->vecPixelSize.y - HEIGHT - PAD;
|
||||||
|
|
||||||
m_bDamageBox = {0, 0, (int)PMONITOR->vecPixelSize.x, (int)HEIGHT + (int)PAD * 2};
|
m_bDamageBox = {0, 0, (int)PMONITOR->vecPixelSize.x, (int)HEIGHT + (int)PAD * 2};
|
||||||
|
|
||||||
|
@ -96,9 +99,9 @@ void CHyprError::createQueued() {
|
||||||
cairo_set_font_size(CAIRO, FONTSIZE);
|
cairo_set_font_size(CAIRO, FONTSIZE);
|
||||||
cairo_set_source_rgba(CAIRO, textColor.r, textColor.g, textColor.b, textColor.a);
|
cairo_set_source_rgba(CAIRO, textColor.r, textColor.g, textColor.b, textColor.a);
|
||||||
|
|
||||||
float yoffset = FONTSIZE;
|
float yoffset = TOPBAR ? FONTSIZE : Y - PAD + FONTSIZE;
|
||||||
int renderedcnt = 0;
|
int renderedcnt = 0;
|
||||||
while (m_szQueued != "" && renderedcnt < VISLINECOUNT) {
|
while (!m_szQueued.empty() && renderedcnt < VISLINECOUNT) {
|
||||||
std::string current = m_szQueued.substr(0, m_szQueued.find('\n'));
|
std::string current = m_szQueued.substr(0, m_szQueued.find('\n'));
|
||||||
if (const auto NEWLPOS = m_szQueued.find('\n'); NEWLPOS != std::string::npos)
|
if (const auto NEWLPOS = m_szQueued.find('\n'); NEWLPOS != std::string::npos)
|
||||||
m_szQueued = m_szQueued.substr(NEWLPOS + 1);
|
m_szQueued = m_szQueued.substr(NEWLPOS + 1);
|
||||||
|
|
Loading…
Reference in a new issue