summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;