summaryrefslogtreecommitdiff
path: root/src/hyprerror
diff options
context:
space:
mode:
Diffstat (limited to 'src/hyprerror')
-rw-r--r--src/hyprerror/HyprError.cpp17
-rw-r--r--src/hyprerror/HyprError.hpp22
2 files changed, 19 insertions, 20 deletions
diff --git a/src/hyprerror/HyprError.cpp b/src/hyprerror/HyprError.cpp
index 16543f9d..169d938a 100644
--- a/src/hyprerror/HyprError.cpp
+++ b/src/hyprerror/HyprError.cpp
@@ -3,7 +3,7 @@
void CHyprError::queueCreate(std::string message, const CColor& color) {
m_szQueued = message;
- m_cQueued = color;
+ m_cQueued = color;
}
void CHyprError::createQueued() {
@@ -32,9 +32,9 @@ void CHyprError::createQueued() {
cairo_rectangle(CAIRO, 0, 0, PMONITOR->vecPixelSize.x, (FONTSIZE + 2 * (FONTSIZE / 10.f)) * LINECOUNT);
// outline
- cairo_rectangle(CAIRO, 0, 0, 1, PMONITOR->vecPixelSize.y); // left
- cairo_rectangle(CAIRO, PMONITOR->vecPixelSize.x - 1, 0, PMONITOR->vecPixelSize.x, PMONITOR->vecPixelSize.y); // right
- cairo_rectangle(CAIRO, 0, PMONITOR->vecPixelSize.y - 1, PMONITOR->vecPixelSize.x, PMONITOR->vecPixelSize.y); // bottom
+ cairo_rectangle(CAIRO, 0, 0, 1, PMONITOR->vecPixelSize.y); // left
+ cairo_rectangle(CAIRO, PMONITOR->vecPixelSize.x - 1, 0, PMONITOR->vecPixelSize.x, PMONITOR->vecPixelSize.y); // right
+ cairo_rectangle(CAIRO, 0, PMONITOR->vecPixelSize.y - 1, PMONITOR->vecPixelSize.x, PMONITOR->vecPixelSize.y); // bottom
cairo_fill(CAIRO);
@@ -46,7 +46,7 @@ void CHyprError::createQueued() {
cairo_set_source_rgba(CAIRO, textColor.r / 255.f, textColor.g / 255.f, textColor.b / 255.f, textColor.a / 255.f);
float yoffset = FONTSIZE;
- while(m_szQueued != "") {
+ while (m_szQueued != "") {
std::string current = m_szQueued.substr(0, m_szQueued.find('\n'));
if (const auto NEWLPOS = m_szQueued.find('\n'); NEWLPOS != std::string::npos)
m_szQueued = m_szQueued.substr(NEWLPOS + 1);
@@ -57,7 +57,6 @@ void CHyprError::createQueued() {
yoffset += FONTSIZE + (FONTSIZE / 10.f);
}
-
cairo_surface_flush(CAIROSURFACE);
// copy the data to an OpenGL texture we have
@@ -79,8 +78,8 @@ void CHyprError::createQueued() {
cairo_surface_destroy(CAIROSURFACE);
m_bIsCreated = true;
- m_szQueued = "";
- m_cQueued = CColor();
+ m_szQueued = "";
+ m_cQueued = CColor();
g_pHyprRenderer->damageMonitor(PMONITOR);
}
@@ -96,7 +95,7 @@ void CHyprError::draw() {
m_bQueuedDestroy = false;
m_tTexture.destroyTexture();
m_bIsCreated = false;
- m_szQueued = "";
+ m_szQueued = "";
g_pHyprRenderer->damageMonitor(g_pCompositor->m_vMonitors.front().get());
return;
}
diff --git a/src/hyprerror/HyprError.hpp b/src/hyprerror/HyprError.hpp
index f09183de..4d01e78d 100644
--- a/src/hyprerror/HyprError.hpp
+++ b/src/hyprerror/HyprError.hpp
@@ -6,18 +6,18 @@
#include <cairo/cairo.h>
class CHyprError {
-public:
- void queueCreate(std::string message, const CColor& color);
- void draw();
- void destroy();
+ public:
+ void queueCreate(std::string message, const CColor& color);
+ void draw();
+ void destroy();
-private:
- void createQueued();
- std::string m_szQueued = "";
- CColor m_cQueued;
- bool m_bQueuedDestroy = false;
- bool m_bIsCreated = false;
- CTexture m_tTexture;
+ private:
+ void createQueued();
+ std::string m_szQueued = "";
+ CColor m_cQueued;
+ bool m_bQueuedDestroy = false;
+ bool m_bIsCreated = false;
+ CTexture m_tTexture;
};
inline std::unique_ptr<CHyprError> g_pHyprError; // This is a full-screen error. Treat it with respect, and there can only be one at a time. \ No newline at end of file