renderer: Tearing implementation (#3441)

This commit is contained in:
Vaxry
2023-09-28 21:48:33 +01:00
committed by GitHub
parent 1e513e25d5
commit 88b63a00b6
19 changed files with 231 additions and 61 deletions

View File

@@ -11,14 +11,16 @@
#include "macros.hpp"
#include "managers/XWaylandManager.hpp"
enum eIdleInhibitMode {
enum eIdleInhibitMode
{
IDLEINHIBIT_NONE = 0,
IDLEINHIBIT_ALWAYS,
IDLEINHIBIT_FULLSCREEN,
IDLEINHIBIT_FOCUS
};
enum eGroupRules {
enum eGroupRules
{
// effective only during first map, except for _ALWAYS variant
GROUP_NONE = 0,
GROUP_SET = 1 << 0, // Open as new group or add to focused group
@@ -138,6 +140,7 @@ struct SWindowAdditionalConfigData {
CWindowOverridableVar<bool> keepAspectRatio = false;
CWindowOverridableVar<int> xray = -1; // -1 means unset, takes precedence over the renderdata one
CWindowOverridableVar<int> borderSize = -1; // -1 means unset, takes precedence over the renderdata one
CWindowOverridableVar<bool> forceTearing = false;
};
struct SWindowRule {
@@ -317,6 +320,8 @@ class CWindow {
} m_sGroupData;
uint16_t m_eGroupRules = GROUP_NONE;
bool m_bTearingHint = false;
// For the list lookup
bool operator==(const CWindow& rhs) {
return m_uSurface.xdg == rhs.m_uSurface.xdg && m_uSurface.xwayland == rhs.m_uSurface.xwayland && m_vPosition == rhs.m_vPosition && m_vSize == rhs.m_vSize &&
@@ -348,6 +353,7 @@ class CWindow {
Vector2D middle();
bool opaque();
float rounding();
bool canBeTorn();
int getRealBorderSize();
void updateSpecialRenderData();