mirror of
https://github.com/hyprwm/Hyprland.git
synced 2024-10-29 21:41:37 +00:00
style/ci: apply clang-format and verify it in ci (#4039)
* style: apply clang-format * ci: add new clang-format job to CI
This commit is contained in:
parent
5489f9f07a
commit
4a42344e97
1
.clang-format-ignore
Normal file
1
.clang-format-ignore
Normal file
@ -0,0 +1 @@
|
|||||||
|
subprojects/**/*
|
29
.github/workflows/ci.yaml
vendored
29
.github/workflows/ci.yaml
vendored
@ -106,3 +106,32 @@ jobs:
|
|||||||
run: mkdir -p build && cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DNO_XWAYLAND:STRING=true -H./ -B./build -G Ninja
|
run: mkdir -p build && cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DNO_XWAYLAND:STRING=true -H./ -B./build -G Ninja
|
||||||
- name: Compile
|
- name: Compile
|
||||||
run: make release
|
run: make release
|
||||||
|
|
||||||
|
clang-format:
|
||||||
|
name: "Code Style (Arch)"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: archlinux
|
||||||
|
steps:
|
||||||
|
- name: Download dependencies
|
||||||
|
run: |
|
||||||
|
sed -i 's/SigLevel = Required DatabaseOptional/SigLevel = Optional TrustAll/' /etc/pacman.conf
|
||||||
|
pacman --noconfirm --noprogressbar -Syyu
|
||||||
|
pacman --noconfirm --noprogressbar -Sy glslang libepoxy libfontenc libxcvt libxfont2 libxkbfile vulkan-headers vulkan-validation-layers git go clang lld libc++ pkgconf meson ninja wayland wayland-protocols libinput libxkbcommon pixman glm libdrm libglvnd cairo pango systemd scdoc base-devel seatd cmake jq python libliftoff tomlplusplus
|
||||||
|
- name: Set up user
|
||||||
|
run: |
|
||||||
|
useradd -m githubuser
|
||||||
|
echo -e "root ALL=(ALL:ALL) ALL\ngithubuser ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers
|
||||||
|
- name: Install libdisplay-info from the AUR
|
||||||
|
run: |
|
||||||
|
su githubuser -c "cd ~ && git clone https://aur.archlinux.org/libdisplay-info.git && cd ./libdisplay-info && makepkg -si --skippgpcheck --noconfirm --noprogressbar"
|
||||||
|
- name: Checkout Hyprland
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- name: Configure
|
||||||
|
run: |
|
||||||
|
meson obj-x86_64-pc-linux-gnu \
|
||||||
|
-Ddefault_library=static
|
||||||
|
- name: clang-format check
|
||||||
|
run: ninja -C obj-x86_64-pc-linux-gnu clang-format-check
|
||||||
|
@ -29,8 +29,7 @@
|
|||||||
#include "plugins/PluginSystem.hpp"
|
#include "plugins/PluginSystem.hpp"
|
||||||
#include "helpers/Watchdog.hpp"
|
#include "helpers/Watchdog.hpp"
|
||||||
|
|
||||||
enum eManagersInitStage
|
enum eManagersInitStage {
|
||||||
{
|
|
||||||
STAGE_PRIORITY = 0,
|
STAGE_PRIORITY = 0,
|
||||||
STAGE_LATE
|
STAGE_LATE
|
||||||
};
|
};
|
||||||
|
@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
#include "helpers/Vector2D.hpp"
|
#include "helpers/Vector2D.hpp"
|
||||||
|
|
||||||
enum eIcons
|
enum eIcons {
|
||||||
{
|
|
||||||
ICON_WARNING = 0,
|
ICON_WARNING = 0,
|
||||||
ICON_INFO,
|
ICON_INFO,
|
||||||
ICON_HINT,
|
ICON_HINT,
|
||||||
@ -13,8 +12,7 @@ enum eIcons
|
|||||||
ICON_NONE
|
ICON_NONE
|
||||||
};
|
};
|
||||||
|
|
||||||
enum eRenderStage
|
enum eRenderStage {
|
||||||
{
|
|
||||||
RENDER_PRE = 0, /* Before binding the gl context */
|
RENDER_PRE = 0, /* Before binding the gl context */
|
||||||
RENDER_BEGIN, /* Just when the rendering begins, nothing has been rendered yet. Damage, current render data in opengl valid. */
|
RENDER_BEGIN, /* Just when the rendering begins, nothing has been rendered yet. Damage, current render data in opengl valid. */
|
||||||
RENDER_PRE_WINDOWS, /* Pre windows, post bottom and overlay layers */
|
RENDER_PRE_WINDOWS, /* Pre windows, post bottom and overlay layers */
|
||||||
|
@ -11,16 +11,14 @@
|
|||||||
#include "macros.hpp"
|
#include "macros.hpp"
|
||||||
#include "managers/XWaylandManager.hpp"
|
#include "managers/XWaylandManager.hpp"
|
||||||
|
|
||||||
enum eIdleInhibitMode
|
enum eIdleInhibitMode {
|
||||||
{
|
|
||||||
IDLEINHIBIT_NONE = 0,
|
IDLEINHIBIT_NONE = 0,
|
||||||
IDLEINHIBIT_ALWAYS,
|
IDLEINHIBIT_ALWAYS,
|
||||||
IDLEINHIBIT_FULLSCREEN,
|
IDLEINHIBIT_FULLSCREEN,
|
||||||
IDLEINHIBIT_FOCUS
|
IDLEINHIBIT_FOCUS
|
||||||
};
|
};
|
||||||
|
|
||||||
enum eGroupRules
|
enum eGroupRules {
|
||||||
{
|
|
||||||
// effective only during first map, except for _ALWAYS variant
|
// effective only during first map, except for _ALWAYS variant
|
||||||
GROUP_NONE = 0,
|
GROUP_NONE = 0,
|
||||||
GROUP_SET = 1 << 0, // Open as new group or add to focused group
|
GROUP_SET = 1 << 0, // Open as new group or add to focused group
|
||||||
|
@ -75,10 +75,9 @@ std::string monitorsRequest(std::string request, HyprCtl::eHyprCtlOutputFormat f
|
|||||||
"vrr": {},
|
"vrr": {},
|
||||||
"activelyTearing": {}
|
"activelyTearing": {}
|
||||||
}},)#",
|
}},)#",
|
||||||
m->ID, escapeJSONStrings(m->szName), escapeJSONStrings(m->szDescription), (m->output->make ? m->output->make : ""),
|
m->ID, escapeJSONStrings(m->szName), escapeJSONStrings(m->szDescription), (m->output->make ? m->output->make : ""), (m->output->model ? m->output->model : ""),
|
||||||
(m->output->model ? m->output->model : ""), (m->output->serial ? m->output->serial : ""), (int)m->vecPixelSize.x, (int)m->vecPixelSize.y, m->refreshRate,
|
(m->output->serial ? m->output->serial : ""), (int)m->vecPixelSize.x, (int)m->vecPixelSize.y, m->refreshRate, (int)m->vecPosition.x, (int)m->vecPosition.y,
|
||||||
(int)m->vecPosition.x, (int)m->vecPosition.y, m->activeWorkspace,
|
m->activeWorkspace, (m->activeWorkspace == -1 ? "" : escapeJSONStrings(g_pCompositor->getWorkspaceByID(m->activeWorkspace)->m_szName)), m->specialWorkspaceID,
|
||||||
(m->activeWorkspace == -1 ? "" : escapeJSONStrings(g_pCompositor->getWorkspaceByID(m->activeWorkspace)->m_szName)), m->specialWorkspaceID,
|
|
||||||
escapeJSONStrings(getWorkspaceNameFromSpecialID(m->specialWorkspaceID)), (int)m->vecReservedTopLeft.x, (int)m->vecReservedTopLeft.y,
|
escapeJSONStrings(getWorkspaceNameFromSpecialID(m->specialWorkspaceID)), (int)m->vecReservedTopLeft.x, (int)m->vecReservedTopLeft.y,
|
||||||
(int)m->vecReservedBottomRight.x, (int)m->vecReservedBottomRight.y, m->scale, (int)m->transform, (m.get() == g_pCompositor->m_pLastMonitor ? "true" : "false"),
|
(int)m->vecReservedBottomRight.x, (int)m->vecReservedBottomRight.y, m->scale, (int)m->transform, (m.get() == g_pCompositor->m_pLastMonitor ? "true" : "false"),
|
||||||
(m->dpmsStatus ? "true" : "false"), (m->output->adaptive_sync_status == WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED ? "true" : "false"),
|
(m->dpmsStatus ? "true" : "false"), (m->output->adaptive_sync_status == WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED ? "true" : "false"),
|
||||||
@ -93,17 +92,17 @@ std::string monitorsRequest(std::string request, HyprCtl::eHyprCtlOutputFormat f
|
|||||||
if (!m->output || m->ID == -1ull)
|
if (!m->output || m->ID == -1ull)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
result += std::format(
|
result +=
|
||||||
"Monitor {} (ID {}):\n\t{}x{}@{:.5f} at {}x{}\n\tdescription: {}\n\tmake: {}\n\tmodel: {}\n\tserial: {}\n\tactive workspace: {} ({})\n\tspecial "
|
std::format("Monitor {} (ID {}):\n\t{}x{}@{:.5f} at {}x{}\n\tdescription: {}\n\tmake: {}\n\tmodel: {}\n\tserial: {}\n\tactive workspace: {} ({})\n\tspecial "
|
||||||
"workspace: {} ({})\n\treserved: {} "
|
"workspace: {} ({})\n\treserved: {} "
|
||||||
"{} {} {}\n\tscale: {:.2f}\n\ttransform: "
|
"{} {} {}\n\tscale: {:.2f}\n\ttransform: "
|
||||||
"{}\n\tfocused: {}\n\tdpmsStatus: {}\n\tvrr: {}\n\tactivelyTearing: {}\n\n",
|
"{}\n\tfocused: {}\n\tdpmsStatus: {}\n\tvrr: {}\n\tactivelyTearing: {}\n\n",
|
||||||
m->szName, m->ID, (int)m->vecPixelSize.x, (int)m->vecPixelSize.y, m->refreshRate, (int)m->vecPosition.x, (int)m->vecPosition.y,
|
m->szName, m->ID, (int)m->vecPixelSize.x, (int)m->vecPixelSize.y, m->refreshRate, (int)m->vecPosition.x, (int)m->vecPosition.y, m->szDescription,
|
||||||
m->szDescription, (m->output->make ? m->output->make : ""), (m->output->model ? m->output->model : ""),
|
(m->output->make ? m->output->make : ""), (m->output->model ? m->output->model : ""), (m->output->serial ? m->output->serial : ""), m->activeWorkspace,
|
||||||
(m->output->serial ? m->output->serial : ""), m->activeWorkspace, (m->activeWorkspace == -1 ? "" : g_pCompositor->getWorkspaceByID(m->activeWorkspace)->m_szName),
|
(m->activeWorkspace == -1 ? "" : g_pCompositor->getWorkspaceByID(m->activeWorkspace)->m_szName), m->specialWorkspaceID,
|
||||||
m->specialWorkspaceID, getWorkspaceNameFromSpecialID(m->specialWorkspaceID), (int)m->vecReservedTopLeft.x, (int)m->vecReservedTopLeft.y,
|
getWorkspaceNameFromSpecialID(m->specialWorkspaceID), (int)m->vecReservedTopLeft.x, (int)m->vecReservedTopLeft.y, (int)m->vecReservedBottomRight.x,
|
||||||
(int)m->vecReservedBottomRight.x, (int)m->vecReservedBottomRight.y, m->scale, (int)m->transform, (m.get() == g_pCompositor->m_pLastMonitor ? "yes" : "no"),
|
(int)m->vecReservedBottomRight.y, m->scale, (int)m->transform, (m.get() == g_pCompositor->m_pLastMonitor ? "yes" : "no"), (int)m->dpmsStatus,
|
||||||
(int)m->dpmsStatus, (int)(m->output->adaptive_sync_status == WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED), m->tearingState.activelyTearing);
|
(int)(m->output->adaptive_sync_status == WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED), m->tearingState.activelyTearing);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,8 +19,7 @@ namespace HyprCtl {
|
|||||||
|
|
||||||
inline int iSocketFD = -1;
|
inline int iSocketFD = -1;
|
||||||
|
|
||||||
enum eHyprCtlOutputFormat
|
enum eHyprCtlOutputFormat {
|
||||||
{
|
|
||||||
FORMAT_NORMAL = 0,
|
FORMAT_NORMAL = 0,
|
||||||
FORMAT_JSON
|
FORMAT_JSON
|
||||||
};
|
};
|
||||||
|
@ -10,16 +10,15 @@
|
|||||||
|
|
||||||
#include <cairo/cairo.h>
|
#include <cairo/cairo.h>
|
||||||
|
|
||||||
enum eIconBackend
|
enum eIconBackend {
|
||||||
{
|
|
||||||
ICONS_BACKEND_NONE = 0,
|
ICONS_BACKEND_NONE = 0,
|
||||||
ICONS_BACKEND_NF,
|
ICONS_BACKEND_NF,
|
||||||
ICONS_BACKEND_FA
|
ICONS_BACKEND_FA
|
||||||
};
|
};
|
||||||
|
|
||||||
static const std::array<std::array<std::string, ICON_NONE + 1>, 3 /* backends */> ICONS_ARRAY = {
|
static const std::array<std::array<std::string, ICON_NONE + 1>, 3 /* backends */> ICONS_ARRAY = {
|
||||||
std::array<std::string, ICON_NONE + 1>{"[!]", "[i]", "[Hint]", "[Err]", "[?]", "[ok]", ""}, std::array<std::string, ICON_NONE + 1>{"", "", "", "", "", "", ""},
|
std::array<std::string, ICON_NONE + 1>{"[!]", "[i]", "[Hint]", "[Err]", "[?]", "[ok]", ""},
|
||||||
std::array<std::string, ICON_NONE + 1>{"", "", "", "", "", ""}};
|
std::array<std::string, ICON_NONE + 1>{"", "", "", "", "", "", ""}, std::array<std::string, ICON_NONE + 1>{"", "", "", "", "", ""}};
|
||||||
static const std::array<CColor, ICON_NONE + 1> ICONS_COLORS = {CColor{255.0 / 255.0, 204 / 255.0, 102 / 255.0, 1.0},
|
static const std::array<CColor, ICON_NONE + 1> ICONS_COLORS = {CColor{255.0 / 255.0, 204 / 255.0, 102 / 255.0, 1.0},
|
||||||
CColor{128 / 255.0, 255 / 255.0, 255 / 255.0, 1.0},
|
CColor{128 / 255.0, 255 / 255.0, 255 / 255.0, 1.0},
|
||||||
CColor{179 / 255.0, 255 / 255.0, 204 / 255.0, 1.0},
|
CColor{179 / 255.0, 255 / 255.0, 204 / 255.0, 1.0},
|
||||||
|
@ -10,8 +10,7 @@
|
|||||||
#define LOGMESSAGESIZE 1024
|
#define LOGMESSAGESIZE 1024
|
||||||
#define ROLLING_LOG_SIZE 4096
|
#define ROLLING_LOG_SIZE 4096
|
||||||
|
|
||||||
enum LogLevel
|
enum LogLevel {
|
||||||
{
|
|
||||||
NONE = -1,
|
NONE = -1,
|
||||||
LOG = 0,
|
LOG = 0,
|
||||||
WARN,
|
WARN,
|
||||||
|
@ -8,16 +8,14 @@
|
|||||||
#include "../macros.hpp"
|
#include "../macros.hpp"
|
||||||
#include "../debug/Log.hpp"
|
#include "../debug/Log.hpp"
|
||||||
|
|
||||||
enum ANIMATEDVARTYPE
|
enum ANIMATEDVARTYPE {
|
||||||
{
|
|
||||||
AVARTYPE_INVALID = -1,
|
AVARTYPE_INVALID = -1,
|
||||||
AVARTYPE_FLOAT,
|
AVARTYPE_FLOAT,
|
||||||
AVARTYPE_VECTOR,
|
AVARTYPE_VECTOR,
|
||||||
AVARTYPE_COLOR
|
AVARTYPE_COLOR
|
||||||
};
|
};
|
||||||
|
|
||||||
enum AVARDAMAGEPOLICY
|
enum AVARDAMAGEPOLICY {
|
||||||
{
|
|
||||||
AVARDAMAGE_NONE = -1,
|
AVARDAMAGE_NONE = -1,
|
||||||
AVARDAMAGE_ENTIRE = 0,
|
AVARDAMAGE_ENTIRE = 0,
|
||||||
AVARDAMAGE_BORDER,
|
AVARDAMAGE_BORDER,
|
||||||
|
@ -28,8 +28,7 @@ typedef struct {
|
|||||||
} xcb_size_hints_t;
|
} xcb_size_hints_t;
|
||||||
typedef unsigned int xcb_window_t;
|
typedef unsigned int xcb_window_t;
|
||||||
|
|
||||||
typedef enum xcb_stack_mode_t
|
typedef enum xcb_stack_mode_t {
|
||||||
{
|
|
||||||
XCB_STACK_MODE_ABOVE = 0,
|
XCB_STACK_MODE_ABOVE = 0,
|
||||||
XCB_STACK_MODE_BELOW = 1,
|
XCB_STACK_MODE_BELOW = 1,
|
||||||
XCB_STACK_MODE_TOP_IF = 2,
|
XCB_STACK_MODE_TOP_IF = 2,
|
||||||
|
@ -15,8 +15,7 @@ struct SLayoutMessageHeader {
|
|||||||
|
|
||||||
enum eFullscreenMode : int8_t;
|
enum eFullscreenMode : int8_t;
|
||||||
|
|
||||||
enum eRectCorner
|
enum eRectCorner {
|
||||||
{
|
|
||||||
CORNER_NONE = 0,
|
CORNER_NONE = 0,
|
||||||
CORNER_TOPLEFT,
|
CORNER_TOPLEFT,
|
||||||
CORNER_TOPRIGHT,
|
CORNER_TOPRIGHT,
|
||||||
@ -24,8 +23,7 @@ enum eRectCorner
|
|||||||
CORNER_BOTTOMLEFT
|
CORNER_BOTTOMLEFT
|
||||||
};
|
};
|
||||||
|
|
||||||
enum eDirection
|
enum eDirection {
|
||||||
{
|
|
||||||
DIRECTION_DEFAULT = -1,
|
DIRECTION_DEFAULT = -1,
|
||||||
DIRECTION_UP = 0,
|
DIRECTION_UP = 0,
|
||||||
DIRECTION_RIGHT,
|
DIRECTION_RIGHT,
|
||||||
|
@ -63,9 +63,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define FORMAT_FLAG(spec__, flag__) \
|
#define FORMAT_FLAG(spec__, flag__) \
|
||||||
case spec__: \
|
case spec__: (flag__) = true; break;
|
||||||
(flag__) = true; \
|
|
||||||
break;
|
|
||||||
|
|
||||||
#define FORMAT_NUMBER(buf__) \
|
#define FORMAT_NUMBER(buf__) \
|
||||||
case '0': \
|
case '0': \
|
||||||
@ -77,9 +75,7 @@
|
|||||||
case '6': \
|
case '6': \
|
||||||
case '7': \
|
case '7': \
|
||||||
case '8': \
|
case '8': \
|
||||||
case '9': \
|
case '9': (buf__).push_back(*it); break;
|
||||||
(buf__).push_back(*it); \
|
|
||||||
break;
|
|
||||||
|
|
||||||
#if ISDEBUG
|
#if ISDEBUG
|
||||||
#define UNREACHABLE() \
|
#define UNREACHABLE() \
|
||||||
|
@ -20,6 +20,7 @@ class CEventManager {
|
|||||||
void startThread();
|
void startThread();
|
||||||
|
|
||||||
std::thread m_tThread;
|
std::thread m_tThread;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void flushEvents();
|
void flushEvents();
|
||||||
|
|
||||||
|
@ -29,8 +29,7 @@ struct SKeybind {
|
|||||||
bool shadowed = false;
|
bool shadowed = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
enum eFocusWindowMode
|
enum eFocusWindowMode {
|
||||||
{
|
|
||||||
MODE_CLASS_REGEX = 0,
|
MODE_CLASS_REGEX = 0,
|
||||||
MODE_TITLE_REGEX,
|
MODE_TITLE_REGEX,
|
||||||
MODE_ADDRESS,
|
MODE_ADDRESS,
|
||||||
|
@ -7,14 +7,12 @@
|
|||||||
#include "../../helpers/Timer.hpp"
|
#include "../../helpers/Timer.hpp"
|
||||||
#include "InputMethodRelay.hpp"
|
#include "InputMethodRelay.hpp"
|
||||||
|
|
||||||
enum eClickBehaviorMode
|
enum eClickBehaviorMode {
|
||||||
{
|
|
||||||
CLICKMODE_DEFAULT = 0,
|
CLICKMODE_DEFAULT = 0,
|
||||||
CLICKMODE_KILL
|
CLICKMODE_KILL
|
||||||
};
|
};
|
||||||
|
|
||||||
enum eMouseBindMode
|
enum eMouseBindMode {
|
||||||
{
|
|
||||||
MBIND_INVALID = -1,
|
MBIND_INVALID = -1,
|
||||||
MBIND_MOVE = 0,
|
MBIND_MOVE = 0,
|
||||||
MBIND_RESIZE = 1,
|
MBIND_RESIZE = 1,
|
||||||
@ -22,8 +20,7 @@ enum eMouseBindMode
|
|||||||
MBIND_RESIZE_FORCE_RATIO = 3
|
MBIND_RESIZE_FORCE_RATIO = 3
|
||||||
};
|
};
|
||||||
|
|
||||||
enum eBorderIconDirection
|
enum eBorderIconDirection {
|
||||||
{
|
|
||||||
BORDERICON_NONE,
|
BORDERICON_NONE,
|
||||||
BORDERICON_UP,
|
BORDERICON_UP,
|
||||||
BORDERICON_DOWN,
|
BORDERICON_DOWN,
|
||||||
|
@ -251,11 +251,9 @@ void CInputManager::onSwipeUpdate(wlr_pointer_swipe_update_event* e) {
|
|||||||
g_pHyprRenderer->damageMonitor(m_sActiveSwipe.pMonitor);
|
g_pHyprRenderer->damageMonitor(m_sActiveSwipe.pMonitor);
|
||||||
|
|
||||||
if (VERTANIMS)
|
if (VERTANIMS)
|
||||||
m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.setValueAndWarp(
|
m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.setValueAndWarp(Vector2D(0, ((-m_sActiveSwipe.delta) / *PSWIPEDIST) * YDISTANCE));
|
||||||
Vector2D(0, ((-m_sActiveSwipe.delta) / *PSWIPEDIST) * YDISTANCE));
|
|
||||||
else
|
else
|
||||||
m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.setValueAndWarp(
|
m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.setValueAndWarp(Vector2D(((-m_sActiveSwipe.delta) / *PSWIPEDIST) * XDISTANCE, 0));
|
||||||
Vector2D(((-m_sActiveSwipe.delta) / *PSWIPEDIST) * XDISTANCE, 0));
|
|
||||||
|
|
||||||
g_pCompositor->updateWorkspaceWindowDecos(m_sActiveSwipe.pWorkspaceBegin->m_iID);
|
g_pCompositor->updateWorkspaceWindowDecos(m_sActiveSwipe.pWorkspaceBegin->m_iID);
|
||||||
return;
|
return;
|
||||||
@ -277,15 +275,11 @@ void CInputManager::onSwipeUpdate(wlr_pointer_swipe_update_event* e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (VERTANIMS) {
|
if (VERTANIMS) {
|
||||||
PWORKSPACE->m_vRenderOffset.setValueAndWarp(Vector2D(
|
PWORKSPACE->m_vRenderOffset.setValueAndWarp(Vector2D(0, ((-m_sActiveSwipe.delta) / *PSWIPEDIST) * YDISTANCE - YDISTANCE));
|
||||||
0, ((-m_sActiveSwipe.delta) / *PSWIPEDIST) * YDISTANCE - YDISTANCE));
|
m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.setValueAndWarp(Vector2D(0, ((-m_sActiveSwipe.delta) / *PSWIPEDIST) * YDISTANCE));
|
||||||
m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.setValueAndWarp(
|
|
||||||
Vector2D(0, ((-m_sActiveSwipe.delta) / *PSWIPEDIST) * YDISTANCE));
|
|
||||||
} else {
|
} else {
|
||||||
PWORKSPACE->m_vRenderOffset.setValueAndWarp(Vector2D(
|
PWORKSPACE->m_vRenderOffset.setValueAndWarp(Vector2D(((-m_sActiveSwipe.delta) / *PSWIPEDIST) * XDISTANCE - XDISTANCE, 0));
|
||||||
((-m_sActiveSwipe.delta) / *PSWIPEDIST) * XDISTANCE - XDISTANCE, 0));
|
m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.setValueAndWarp(Vector2D(((-m_sActiveSwipe.delta) / *PSWIPEDIST) * XDISTANCE, 0));
|
||||||
m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.setValueAndWarp(
|
|
||||||
Vector2D(((-m_sActiveSwipe.delta) / *PSWIPEDIST) * XDISTANCE, 0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
g_pCompositor->updateWorkspaceWindowDecos(workspaceIDLeft);
|
g_pCompositor->updateWorkspaceWindowDecos(workspaceIDLeft);
|
||||||
@ -297,11 +291,9 @@ void CInputManager::onSwipeUpdate(wlr_pointer_swipe_update_event* e) {
|
|||||||
g_pHyprRenderer->damageMonitor(m_sActiveSwipe.pMonitor);
|
g_pHyprRenderer->damageMonitor(m_sActiveSwipe.pMonitor);
|
||||||
|
|
||||||
if (VERTANIMS)
|
if (VERTANIMS)
|
||||||
m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.setValueAndWarp(
|
m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.setValueAndWarp(Vector2D(0, ((-m_sActiveSwipe.delta) / *PSWIPEDIST) * YDISTANCE));
|
||||||
Vector2D(0, ((-m_sActiveSwipe.delta) / *PSWIPEDIST) * YDISTANCE));
|
|
||||||
else
|
else
|
||||||
m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.setValueAndWarp(
|
m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.setValueAndWarp(Vector2D(((-m_sActiveSwipe.delta) / *PSWIPEDIST) * XDISTANCE, 0));
|
||||||
Vector2D(((-m_sActiveSwipe.delta) / *PSWIPEDIST) * XDISTANCE, 0));
|
|
||||||
|
|
||||||
g_pCompositor->updateWorkspaceWindowDecos(m_sActiveSwipe.pWorkspaceBegin->m_iID);
|
g_pCompositor->updateWorkspaceWindowDecos(m_sActiveSwipe.pWorkspaceBegin->m_iID);
|
||||||
return;
|
return;
|
||||||
@ -323,15 +315,11 @@ void CInputManager::onSwipeUpdate(wlr_pointer_swipe_update_event* e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (VERTANIMS) {
|
if (VERTANIMS) {
|
||||||
PWORKSPACE->m_vRenderOffset.setValueAndWarp(Vector2D(
|
PWORKSPACE->m_vRenderOffset.setValueAndWarp(Vector2D(0, ((-m_sActiveSwipe.delta) / *PSWIPEDIST) * YDISTANCE + YDISTANCE));
|
||||||
0, ((-m_sActiveSwipe.delta) / *PSWIPEDIST) * YDISTANCE + YDISTANCE));
|
m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.setValueAndWarp(Vector2D(0, ((-m_sActiveSwipe.delta) / *PSWIPEDIST) * YDISTANCE));
|
||||||
m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.setValueAndWarp(
|
|
||||||
Vector2D(0, ((-m_sActiveSwipe.delta) / *PSWIPEDIST) * YDISTANCE));
|
|
||||||
} else {
|
} else {
|
||||||
PWORKSPACE->m_vRenderOffset.setValueAndWarp(Vector2D(
|
PWORKSPACE->m_vRenderOffset.setValueAndWarp(Vector2D(((-m_sActiveSwipe.delta) / *PSWIPEDIST) * XDISTANCE + XDISTANCE, 0));
|
||||||
((-m_sActiveSwipe.delta) / *PSWIPEDIST) * XDISTANCE + XDISTANCE, 0));
|
m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.setValueAndWarp(Vector2D(((-m_sActiveSwipe.delta) / *PSWIPEDIST) * XDISTANCE, 0));
|
||||||
m_sActiveSwipe.pWorkspaceBegin->m_vRenderOffset.setValueAndWarp(
|
|
||||||
Vector2D(((-m_sActiveSwipe.delta) / *PSWIPEDIST) * XDISTANCE, 0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
g_pCompositor->updateWorkspaceWindowDecos(workspaceIDRight);
|
g_pCompositor->updateWorkspaceWindowDecos(workspaceIDRight);
|
||||||
|
@ -53,7 +53,9 @@ void CFractionalScaleProtocolManager::bindManager(wl_client* client, void* data,
|
|||||||
static void handleDestroyScaleAddon(wl_client* client, wl_resource* resource);
|
static void handleDestroyScaleAddon(wl_client* client, wl_resource* resource);
|
||||||
//
|
//
|
||||||
|
|
||||||
static const struct wp_fractional_scale_v1_interface fractionalScaleAddonImpl { .destroy = handleDestroyScaleAddon };
|
static const struct wp_fractional_scale_v1_interface fractionalScaleAddonImpl {
|
||||||
|
.destroy = handleDestroyScaleAddon
|
||||||
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
SFractionalScaleAddon* addonFromResource(wl_resource* resource) {
|
SFractionalScaleAddon* addonFromResource(wl_resource* resource) {
|
||||||
|
@ -10,8 +10,7 @@
|
|||||||
|
|
||||||
class CMonitor;
|
class CMonitor;
|
||||||
|
|
||||||
enum eClientOwners
|
enum eClientOwners {
|
||||||
{
|
|
||||||
CLIENT_SCREENCOPY = 0,
|
CLIENT_SCREENCOPY = 0,
|
||||||
CLIENT_TOPLEVEL_EXPORT
|
CLIENT_TOPLEVEL_EXPORT
|
||||||
};
|
};
|
||||||
|
@ -30,8 +30,7 @@ inline const float fullVerts[] = {
|
|||||||
};
|
};
|
||||||
inline const float fanVertsFull[] = {-1.0f, -1.0f, 1.0f, -1.0f, 1.0f, 1.0f, -1.0f, 1.0f};
|
inline const float fanVertsFull[] = {-1.0f, -1.0f, 1.0f, -1.0f, 1.0f, 1.0f, -1.0f, 1.0f};
|
||||||
|
|
||||||
enum eDiscardMode
|
enum eDiscardMode {
|
||||||
{
|
|
||||||
DISCARD_OPAQUE = 1,
|
DISCARD_OPAQUE = 1,
|
||||||
DISCARD_ALPHA = 1 << 1
|
DISCARD_ALPHA = 1 << 1
|
||||||
};
|
};
|
||||||
|
@ -13,23 +13,20 @@
|
|||||||
struct SMonitorRule;
|
struct SMonitorRule;
|
||||||
|
|
||||||
// TODO: add fuller damage tracking for updating only parts of a window
|
// TODO: add fuller damage tracking for updating only parts of a window
|
||||||
enum DAMAGETRACKINGMODES
|
enum DAMAGETRACKINGMODES {
|
||||||
{
|
|
||||||
DAMAGE_TRACKING_INVALID = -1,
|
DAMAGE_TRACKING_INVALID = -1,
|
||||||
DAMAGE_TRACKING_NONE = 0,
|
DAMAGE_TRACKING_NONE = 0,
|
||||||
DAMAGE_TRACKING_MONITOR,
|
DAMAGE_TRACKING_MONITOR,
|
||||||
DAMAGE_TRACKING_FULL
|
DAMAGE_TRACKING_FULL
|
||||||
};
|
};
|
||||||
|
|
||||||
enum eRenderPassMode
|
enum eRenderPassMode {
|
||||||
{
|
|
||||||
RENDER_PASS_ALL = 0,
|
RENDER_PASS_ALL = 0,
|
||||||
RENDER_PASS_MAIN,
|
RENDER_PASS_MAIN,
|
||||||
RENDER_PASS_POPUP
|
RENDER_PASS_POPUP
|
||||||
};
|
};
|
||||||
|
|
||||||
enum eRenderMode
|
enum eRenderMode {
|
||||||
{
|
|
||||||
RENDER_MODE_NORMAL = 0,
|
RENDER_MODE_NORMAL = 0,
|
||||||
RENDER_MODE_FULL_FAKE = 1,
|
RENDER_MODE_FULL_FAKE = 1,
|
||||||
RENDER_MODE_TO_BUFFER = 2,
|
RENDER_MODE_TO_BUFFER = 2,
|
||||||
|
@ -2,8 +2,7 @@
|
|||||||
|
|
||||||
#include "../defines.hpp"
|
#include "../defines.hpp"
|
||||||
|
|
||||||
enum TEXTURETYPE
|
enum TEXTURETYPE {
|
||||||
{
|
|
||||||
TEXTURE_INVALID, // Invalid
|
TEXTURE_INVALID, // Invalid
|
||||||
TEXTURE_RGBA, // 4 channels
|
TEXTURE_RGBA, // 4 channels
|
||||||
TEXTURE_RGBX, // discard A
|
TEXTURE_RGBX, // discard A
|
||||||
|
@ -9,14 +9,12 @@
|
|||||||
class CWindow;
|
class CWindow;
|
||||||
class IHyprWindowDecoration;
|
class IHyprWindowDecoration;
|
||||||
|
|
||||||
enum eDecorationPositioningPolicy
|
enum eDecorationPositioningPolicy {
|
||||||
{
|
|
||||||
DECORATION_POSITION_ABSOLUTE = 0, /* Decoration wants absolute positioning */
|
DECORATION_POSITION_ABSOLUTE = 0, /* Decoration wants absolute positioning */
|
||||||
DECORATION_POSITION_STICKY, /* Decoration is stuck to some edge of a window */
|
DECORATION_POSITION_STICKY, /* Decoration is stuck to some edge of a window */
|
||||||
};
|
};
|
||||||
|
|
||||||
enum eDecorationEdges
|
enum eDecorationEdges {
|
||||||
{
|
|
||||||
DECORATION_EDGE_TOP = 1 << 0,
|
DECORATION_EDGE_TOP = 1 << 0,
|
||||||
DECORATION_EDGE_BOTTOM = 1 << 1,
|
DECORATION_EDGE_BOTTOM = 1 << 1,
|
||||||
DECORATION_EDGE_LEFT = 1 << 2,
|
DECORATION_EDGE_LEFT = 1 << 2,
|
||||||
|
@ -4,24 +4,21 @@
|
|||||||
#include "../../helpers/Region.hpp"
|
#include "../../helpers/Region.hpp"
|
||||||
#include "DecorationPositioner.hpp"
|
#include "DecorationPositioner.hpp"
|
||||||
|
|
||||||
enum eDecorationType
|
enum eDecorationType {
|
||||||
{
|
|
||||||
DECORATION_NONE = -1,
|
DECORATION_NONE = -1,
|
||||||
DECORATION_GROUPBAR,
|
DECORATION_GROUPBAR,
|
||||||
DECORATION_SHADOW,
|
DECORATION_SHADOW,
|
||||||
DECORATION_CUSTOM
|
DECORATION_CUSTOM
|
||||||
};
|
};
|
||||||
|
|
||||||
enum eDecorationLayer
|
enum eDecorationLayer {
|
||||||
{
|
|
||||||
DECORATION_LAYER_BOTTOM = 0, /* lowest. */
|
DECORATION_LAYER_BOTTOM = 0, /* lowest. */
|
||||||
DECORATION_LAYER_UNDER, /* under the window, but above BOTTOM */
|
DECORATION_LAYER_UNDER, /* under the window, but above BOTTOM */
|
||||||
DECORATION_LAYER_OVER, /* above the window, but below its popups */
|
DECORATION_LAYER_OVER, /* above the window, but below its popups */
|
||||||
DECORATION_LAYER_OVERLAY /* above everything of the window, including popups */
|
DECORATION_LAYER_OVERLAY /* above everything of the window, including popups */
|
||||||
};
|
};
|
||||||
|
|
||||||
enum eDecorationFlags
|
enum eDecorationFlags {
|
||||||
{
|
|
||||||
DECORATION_ALLOWS_MOUSE_INPUT = 1 << 0, /* this decoration accepts mouse input */
|
DECORATION_ALLOWS_MOUSE_INPUT = 1 << 0, /* this decoration accepts mouse input */
|
||||||
DECORATION_PART_OF_MAIN_WINDOW = 1 << 1, /* this decoration is a *seamless* part of the main window, so stuff like shadows will include it */
|
DECORATION_PART_OF_MAIN_WINDOW = 1 << 1, /* this decoration is a *seamless* part of the main window, so stuff like shadows will include it */
|
||||||
DECORATION_NON_SOLID = 1 << 2, /* this decoration is not solid. Other decorations should draw on top of it. Example: shadow */
|
DECORATION_NON_SOLID = 1 << 2, /* this decoration is not solid. Other decorations should draw on top of it. Example: shadow */
|
||||||
|
Loading…
Reference in New Issue
Block a user