aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-05-31 09:09:47 +0200
committerdec05eba <dec05eba@protonmail.com>2021-05-31 09:09:47 +0200
commitfcb76d37cd37c0762fcecb4c761a6218d11e3b3f (patch)
tree81aa4d4e1e4b38214af83c7f696e7860ffe859c6
parent9d6ea5100b404ae777d7a45fc7c3e0892d06b7ba (diff)
Fix after xfixes update, cleanup x11 cursor
-rw-r--r--project.conf2
-rw-r--r--src/main.cpp11
-rw-r--r--src/window_manager.c5
3 files changed, 15 insertions, 3 deletions
diff --git a/project.conf b/project.conf
index e2a591e..7440d6d 100644
--- a/project.conf
+++ b/project.conf
@@ -14,4 +14,4 @@ sdl2 = "2"
openvr = "1"
xrandr = "1"
xi = "1"
-xfixes = "5"
+xfixes = ">=5"
diff --git a/src/main.cpp b/src/main.cpp
index 1d184aa..d14e3b5 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -632,6 +632,9 @@ bool CMainApplication::BInit()
return false;
}
+ auto standing_pos = m_pHMD->GetSeatedZeroPoseToStandingAbsoluteTrackingPose();
+ hmd_pos += glm::vec3(standing_pos.m[0][3], standing_pos.m[1][3], standing_pos.m[2][3]);
+
x_display = XOpenDisplay(nullptr);
if (!x_display)
{
@@ -1276,9 +1279,14 @@ bool CMainApplication::CreateAllShaders()
}
bool CMainApplication::SetCursorFromX11CursorImage(XFixesCursorImage *x11_cursor_image) {
- if(!x11_cursor_image || !x11_cursor_image->pixels)
+ if(!x11_cursor_image)
return false;
+ if(!x11_cursor_image->pixels) {
+ XFree(x11_cursor_image);
+ return false;
+ }
+
cursor_offset_x = x11_cursor_image->xhot;
cursor_offset_y = x11_cursor_image->yhot;
glBindTexture(GL_TEXTURE_2D, arrow_image_texture_id);
@@ -1325,6 +1333,7 @@ bool CMainApplication::SetCursorFromX11CursorImage(XFixesCursorImage *x11_cursor
glUseProgram( m_unSceneProgramID );
glUniform2fv(m_nArrowSizeLocation, 1, &cursor_scale_uniform[0]);
glUseProgram( 0 );
+ XFree(x11_cursor_image);
return true;
}
diff --git a/src/window_manager.c b/src/window_manager.c
index 3adb005..a2285e0 100644
--- a/src/window_manager.c
+++ b/src/window_manager.c
@@ -31,7 +31,8 @@ static char *const menu_args[] = { "rofi", "-modi", "window,drun,combi", "-show"
/* TODO: Pipe stdout and stderr to /dev/null. Right now the output is seen in the window manager log */
static void spawn(Display *dpy, char *const args[]) {
- if(fork() == 0) {
+ pid_t pid = fork();
+ if(pid == 0) { /* child */
if (dpy)
close(ConnectionNumber(dpy));
setsid();
@@ -46,6 +47,8 @@ static void spawn(Display *dpy, char *const args[]) {
} else if(second_child != -1) {
_exit(0);
}
+ } else if(pid != -1) { /* parent */
+ waitpid(pid, NULL, 0);
}
}