Skip to content

Commit f2602d1

Browse files
clang-format
1 parent 0268c77 commit f2602d1

File tree

4 files changed

+21
-20
lines changed

4 files changed

+21
-20
lines changed

src/Compositor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,7 @@ PHLWINDOW CCompositor::vectorToWindowUnified(const Vector2D& pos, uint8_t proper
925925
if (w->m_bIsX11 && w->isX11OverrideRedirect() && !w->m_pXWaylandSurface->wantsFocus()) {
926926
// Override Redirect
927927
return g_pCompositor->m_pLastWindow.lock(); // we kinda trick everything here.
928-
// TODO: this is wrong, we should focus the parent, but idk how to get it considering it's nullptr in most cases.
928+
// TODO: this is wrong, we should focus the parent, but idk how to get it considering it's nullptr in most cases.
929929
}
930930

931931
return w;

src/helpers/MiscFunctions.cpp

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -587,20 +587,23 @@ std::vector<pid_t> getAllPIDOf(const std::string& name) {
587587
std::vector<pid_t> results;
588588

589589
#if defined(KERN_PROC_ALL)
590-
int mib[] = {
591-
CTL_KERN, KERN_PROC, KERN_PROC_ALL,
590+
int mib[] = {CTL_KERN,
591+
KERN_PROC,
592+
KERN_PROC_ALL,
592593
#if defined(__NetBSD__) || defined(__OpenBSD__)
593-
0, sizeof(KINFO_PROC), 0
594+
0,
595+
sizeof(KINFO_PROC),
596+
0
594597
#endif
595598
};
596-
u_int miblen = sizeof(mib) / sizeof(mib[0]);
597-
599+
u_int miblen = sizeof(mib) / sizeof(mib[0]);
600+
598601
size_t size = 0;
599602
if (sysctl(mib, miblen, NULL, &size, NULL, 0) == -1)
600603
return results;
601604

602605
std::vector<KINFO_PROC> kprocList(size / sizeof(KINFO_PROC));
603-
606+
604607
if (sysctl(mib, miblen, kprocList.data(), &size, NULL, 0) != -1) {
605608
for (auto& kproc : kprocList) {
606609
#if defined(__DragonFly__)
@@ -625,7 +628,7 @@ std::vector<pid_t> getAllPIDOf(const std::string& name) {
625628
if (!isNumber(dirname))
626629
continue;
627630

628-
const auto pid = std::stoll(dirname);
631+
const auto pid = std::stoll(dirname);
629632
std::string procName = getProcNameOf(pid);
630633

631634
if (procName == name)
@@ -663,14 +666,14 @@ std::string getProcNameOf(pid_t pid) {
663666
return {};
664667
#else
665668
const std::string commPath = "/proc/" + std::to_string(pid) + "/comm";
666-
CFileDescriptor fd{open(commPath.c_str(), O_RDONLY | O_CLOEXEC)};
667-
669+
CFileDescriptor fd{open(commPath.c_str(), O_RDONLY | O_CLOEXEC)};
670+
668671
if (!fd.isValid())
669672
return {};
670673

671-
char buffer[256] = {0};
672-
const auto bytesRead = read(fd.get(), buffer, sizeof(buffer) - 1);
673-
674+
char buffer[256] = {0};
675+
const auto bytesRead = read(fd.get(), buffer, sizeof(buffer) - 1);
676+
674677
if (bytesRead <= 0)
675678
return {};
676679

@@ -682,8 +685,6 @@ std::string getProcNameOf(pid_t pid) {
682685
#endif
683686
}
684687

685-
686-
687688
std::expected<int64_t, std::string> configStringToInt(const std::string& VALUE) {
688689
auto parseHex = [](const std::string& value) -> std::expected<int64_t, std::string> {
689690
try {

src/helpers/MiscFunctions.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ std::optional<std::string> cleanCmdForWorkspace(const std::string&, std
2828
float vecToRectDistanceSquared(const Vector2D& vec, const Vector2D& p1, const Vector2D& p2);
2929
void logSystemInfo();
3030
std::string execAndGet(const char*);
31-
pid_t getPPIDof(pid_t pid);
32-
std::string getProcNameOf(pid_t pid);
33-
std::vector<pid_t> getAllPIDOf(const std::string& name);
31+
pid_t getPPIDof(pid_t pid);
32+
std::string getProcNameOf(pid_t pid);
33+
std::vector<pid_t> getAllPIDOf(const std::string& name);
3434
std::expected<int64_t, std::string> configStringToInt(const std::string&);
3535
Vector2D configStringToVector2D(const std::string&);
3636
std::optional<float> getPlusMinusKeywordResult(std::string in, float relative);

src/managers/KeybindManager.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ class CKeybindManager {
149149
static void moveWindowOutOfGroup(PHLWINDOW pWindow, const std::string& dir = "");
150150
static void moveWindowIntoGroup(PHLWINDOW pWindow, PHLWINDOW pWindowInDirection);
151151
static void switchToWindow(PHLWINDOW PWINDOWTOCHANGETO, bool preserveFocusHistory = false);
152-
static pid_t spawnRawProc(std::string, PHLWORKSPACE pInitialWorkspace);
153-
static pid_t spawnWithRules(std::string, PHLWORKSPACE pInitialWorkspace);
152+
static pid_t spawnRawProc(std::string, PHLWORKSPACE pInitialWorkspace);
153+
static pid_t spawnWithRules(std::string, PHLWORKSPACE pInitialWorkspace);
154154

155155
// -------------- Dispatchers -------------- //
156156
static SDispatchResult closeActive(std::string);

0 commit comments

Comments
 (0)