Skip to content

Commit

Permalink
clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
outfoxxed committed Jun 10, 2024
1 parent 0f92514 commit c353f2e
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 38 deletions.
14 changes: 7 additions & 7 deletions src/desktop/LayerSurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "../protocols/LayerShell.hpp"
#include "../protocols/core/Compositor.hpp"
#include "../managers/SeatManager.hpp"
#include "managers/input/InputManager.hpp"

PHLLS CLayerSurface::create(SP<CLayerShellResource> resource) {
PHLLS pLS = SP<CLayerSurface>(new CLayerSurface(resource));
Expand Down Expand Up @@ -211,7 +210,8 @@ void CLayerSurface::onUnmap() {
return;

// refocus if needed
if (WASLASTFOCUS) g_pInputManager->refocusLastWindow(PMONITOR);
if (WASLASTFOCUS)
g_pInputManager->refocusLastWindow(PMONITOR);

CBox geomFixed = {geometry.x + PMONITOR->vecPosition.x, geometry.y + PMONITOR->vecPosition.y, geometry.width, geometry.height};
g_pHyprRenderer->damageBox(&geomFixed);
Expand Down Expand Up @@ -296,11 +296,11 @@ void CLayerSurface::onCommit() {
else if (WASEXCLUSIVE && !ISEXCLUSIVE)
std::erase_if(g_pInputManager->m_dExclusiveLSes, [this](const auto& other) { return !other.lock() || other.lock() == self.lock(); });

// if the surface was focused and interactive but now isn't, refocus
if (WASLASTFOCUS && !layerSurface->current.interactivity) {
g_pInputManager->refocusLastWindow(g_pCompositor->getMonitorFromID(monitorID));
} else if (!WASLASTFOCUS && (ISEXCLUSIVE || (layerSurface->current.interactivity && (g_pSeatManager->mouse.expired() || !g_pInputManager->isConstrained())))) {
// if not focused last and exclusive or accepting input + unconstrained
// if the surface was focused and interactive but now isn't, refocus
if (WASLASTFOCUS && !layerSurface->current.interactivity) {
g_pInputManager->refocusLastWindow(g_pCompositor->getMonitorFromID(monitorID));
} else if (!WASLASTFOCUS && (ISEXCLUSIVE || (layerSurface->current.interactivity && (g_pSeatManager->mouse.expired() || !g_pInputManager->isConstrained())))) {
// if not focused last and exclusive or accepting input + unconstrained
g_pSeatManager->setGrab(nullptr);
g_pInputManager->releaseAllMouseButtons();
g_pCompositor->focusSurface(surface->resource());
Expand Down
50 changes: 25 additions & 25 deletions src/desktop/LayerSurface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,40 +35,40 @@ class CLayerSurface {
wl_list link;

// the header providing the enum type cannot be imported here
int interactivity = 0;
int interactivity = 0;

SP<CWLSurface> surface;
SP<CWLSurface> surface;

bool mapped = false;
uint32_t layer = 0;
bool mapped = false;
uint32_t layer = 0;

int monitorID = -1;
int monitorID = -1;

bool fadingOut = false;
bool readyToDelete = false;
bool noProcess = false;
bool noAnimations = false;
bool fadingOut = false;
bool readyToDelete = false;
bool noProcess = false;
bool noAnimations = false;

bool forceBlur = false;
bool forceBlurPopups = false;
int xray = -1;
bool ignoreAlpha = false;
float ignoreAlphaValue = 0.f;
bool dimAround = false;
bool forceBlur = false;
bool forceBlurPopups = false;
int xray = -1;
bool ignoreAlpha = false;
float ignoreAlphaValue = 0.f;
bool dimAround = false;

std::optional<std::string> animationStyle;
std::optional<std::string> animationStyle;

PHLLSREF self;
PHLLSREF self;

CBox geometry = {0, 0, 0, 0};
Vector2D position;
std::string szNamespace = "";
std::unique_ptr<CPopup> popupHead;
CBox geometry = {0, 0, 0, 0};
Vector2D position;
std::string szNamespace = "";
std::unique_ptr<CPopup> popupHead;

void onDestroy();
void onMap();
void onUnmap();
void onCommit();
void onDestroy();
void onMap();
void onUnmap();
void onCommit();

private:
struct {
Expand Down
4 changes: 2 additions & 2 deletions src/helpers/MiscFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,8 +707,8 @@ int64_t getPPIDof(int64_t pid) {

return 0;
#else
std::string dir = "/proc/" + std::to_string(pid) + "/status";
FILE* infile;
std::string dir = "/proc/" + std::to_string(pid) + "/status";
FILE* infile;

infile = fopen(dir.c_str(), "r");
if (!infile)
Expand Down
6 changes: 3 additions & 3 deletions src/managers/input/InputManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ class CInputManager {
bool isConstrained();

Vector2D getMouseCoordsInternal();
void refocus();
void refocusLastWindow(CMonitor* pMonitor);
void simulateMouseMovement();
void refocus();
void refocusLastWindow(CMonitor* pMonitor);
void simulateMouseMovement();
void sendMotionEventsToFocused();

void setKeyboardLayout();
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/PluginAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ APICALL std::vector<SFunctionMatch> HyprlandAPI::findFunctionsByName(HANDLE hand
const auto FPATH = std::filesystem::canonical(exe);
#elif defined(__OpenBSD__)
// Neither KERN_PROC_PATHNAME nor /proc are supported
const auto FPATH = std::filesystem::canonical("/usr/local/bin/Hyprland");
const auto FPATH = std::filesystem::canonical("/usr/local/bin/Hyprland");
#else
const auto FPATH = std::filesystem::canonical("/proc/self/exe");
#endif
Expand Down

0 comments on commit c353f2e

Please sign in to comment.