diff options
| author | end-4 <97237370+end-4@users.noreply.github.com> | 2023-06-12 00:30:31 +0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-11 19:30:31 +0200 |
| commit | e1edfde539557d175f8c48d94996469426da7c47 (patch) | |
| tree | b14dd7f02cb6c06a26ec1a72c5cb34b353dc15c6 /src/render/OpenGL.hpp | |
| parent | 10fd75c8335736b1a0dcb3830a5b8c2367a02e61 (diff) | |
Allow setting alpha value for ignorezero layer rule (#2477)
* rename ignorezero to ignorealpha
* allow setting ignorealpha value
This commit allows setting a float value (0-1) for the ignorealpha layer rule.
Does not yet have error handling; invalid ignorealpha layer rule will crash Hyprland.
* add brackets i forgot to add
* prevent crash with invalid ignorealpha value
prevents hyprland from immediately crashing with invalid ignorealpha layer rule
does not log
* don't try to set ignoreAlphaValue if alpha value not specified
* add catch to try, reintroduce ignorezero
- added catch after try cuz i was an idiot
- re-add ignorezero as an alternative to ignorealpha to not introduce a breaking change
* add logging for failed ignorealpha layer rule
* fix get ignorealpha's get VALUE
* check npos and use empty()
* rename VALUE cuz no longer const
* format Shader.hpp
Diffstat (limited to 'src/render/OpenGL.hpp')
| -rw-r--r-- | src/render/OpenGL.hpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/render/OpenGL.hpp b/src/render/OpenGL.hpp index 1b61887e..36aa612c 100644 --- a/src/render/OpenGL.hpp +++ b/src/render/OpenGL.hpp @@ -24,8 +24,8 @@ inline const float fullVerts[] = { inline const float fanVertsFull[] = {-1.0f, -1.0f, 1.0f, -1.0f, 1.0f, 1.0f, -1.0f, 1.0f}; enum eDiscardMode { - DISCARD_OPAQUE = 1, - DISCARD_ALPHAZERO = 1 << 1 + DISCARD_OPAQUE = 1, + DISCARD_ALPHA = 1 << 1 }; struct SRenderModifData { @@ -35,8 +35,8 @@ struct SRenderModifData { struct SMonitorRenderData { CFramebuffer primaryFB; - CFramebuffer mirrorFB; // these are used for some effects, - CFramebuffer mirrorSwapFB; // etc + CFramebuffer mirrorFB; // these are used for some effects, + CFramebuffer mirrorSwapFB; // etc CFramebuffer monitorMirrorFB; // used for mirroring outputs @@ -83,7 +83,8 @@ struct SCurrentRenderData { wlr_box clipBox = {}; - uint32_t discardMode = DISCARD_OPAQUE; + uint32_t discardMode = DISCARD_OPAQUE; + float discardOpacity = 0.f; }; class CGradientValueData; @@ -138,9 +139,9 @@ class CHyprOpenGLImpl { bool m_bReloadScreenShader = true; // at launch it can be set - CWindow* m_pCurrentWindow = nullptr; // hack to get the current rendered window + CWindow* m_pCurrentWindow = nullptr; // hack to get the current rendered window - pixman_region32_t m_rOriginalDamageRegion; // used for storing the pre-expanded region + pixman_region32_t m_rOriginalDamageRegion; // used for storing the pre-expanded region std::unordered_map<CWindow*, CFramebuffer> m_mWindowFramebuffers; std::unordered_map<SLayerSurface*, CFramebuffer> m_mLayerFramebuffers; |
