summaryrefslogtreecommitdiff
path: root/src/sxwm.c
diff options
context:
space:
mode:
authorL0Wigh <mathiotthomas@gmail.com>2025-09-11 15:13:48 +0200
committerL0Wigh <mathiotthomas@gmail.com>2025-09-11 15:13:48 +0200
commit360136d0b90ff6f9439c2f3c8c2df4b2e98735ce (patch)
treee0a2af538104669491c78e8d6cc9df105234d9be /src/sxwm.c
parentfaba2d069e4b7bcbfaf70866dc7302ec10db0da5 (diff)
cleaning the code to respect the guideline
Diffstat (limited to 'src/sxwm.c')
-rw-r--r--src/sxwm.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/src/sxwm.c b/src/sxwm.c
index 6cb5007..702313e 100644
--- a/src/sxwm.c
+++ b/src/sxwm.c
@@ -310,23 +310,6 @@ void centre_window(void)
XMoveWindow(dpy, focused->win, x, y);
}
-pid_t get_parent_process(pid_t c)
-{
- unsigned int v = 0;
- FILE *f;
- char buf[256];
-
- snprintf(buf, sizeof(buf) - 1, "/proc/%u/stat", (unsigned)c);
- if (!(f = fopen(buf, "r"))) {
- return 0;
- }
-
- int no_error = fscanf(f, "%*u %*s %*c %u", &v);
- (void)no_error;
- fclose(f);
- return (pid_t)v;
-}
-
void change_workspace(int ws)
{
if (ws >= NUM_WORKSPACES || ws == current_ws) {
@@ -685,6 +668,24 @@ int get_monitor_for(Client *c)
return 0;
}
+pid_t get_parent_process(pid_t c)
+{
+ unsigned int v = 0;
+ FILE *f;
+ char buf[256];
+
+ snprintf(buf, sizeof(buf) - 1, "/proc/%u/stat", (unsigned)c);
+ if (!(f = fopen(buf, "r"))) {
+ return 0;
+ }
+
+ int no_error = fscanf(f, "%*u %*s %*c %u", &v);
+ (void)no_error;
+ fclose(f);
+ return (pid_t)v;
+}
+
+
pid_t get_pid(Window w)
{
pid_t pid = 0;