aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-07-17 23:48:14 +0200
committerdec05eba <dec05eba@protonmail.com>2022-07-17 23:48:14 +0200
commitac823a51f955cbae52ff68271dda9c958d191d8d (patch)
tree20b3d16c673cc22d880cdcce92ceed1c84f019b6
parentec8df1cdb15d1d136407e2943076bfd93a2e52a4 (diff)
Readd bspwm (and i3) fix when changing workspace
-rw-r--r--TODO1
-rw-r--r--src/main.cpp11
2 files changed, 8 insertions, 4 deletions
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..e60dcdc
--- /dev/null
+++ b/TODO
@@ -0,0 +1 @@
+Use libmpv. Make stereo audio follow headset rotation in 180/360 mode (assume facing forward is the default audio mode).
diff --git a/src/main.cpp b/src/main.cpp
index 592e3dd..0278da1 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -256,6 +256,7 @@ private: // X compositor
int x_fixes_event_base;
int x_fixes_error_base;
+ int prev_visibility_state = VisibilityFullyObscured;
GLint pixmap_texture_width = 0;
GLint pixmap_texture_height = 0;
@@ -1059,9 +1060,11 @@ bool CMainApplication::HandleInput()
if(src_window_id) {
if (XCheckTypedWindowEvent(x_display, src_window_id, VisibilityNotify, &xev)) {
- // TODO: Re-enable. This currently spams visibility notify change
- //window_resize_time = SDL_GetTicks();
- //window_resized = true;
+ if((prev_visibility_state == VisibilityFullyObscured && xev.xvisibility.state != VisibilityFullyObscured) || (xev.xvisibility.state == prev_visibility_state)) {
+ window_resize_time = SDL_GetTicks();
+ window_resized = true;
+ }
+ prev_visibility_state = xev.xvisibility.state;
}
if (XCheckTypedWindowEvent(x_display, src_window_id, ConfigureNotify, &xev) && xev.xconfigure.window == src_window_id) {
@@ -1089,7 +1092,7 @@ bool CMainApplication::HandleInput()
}
Uint32 time_now = SDL_GetTicks();
- const int window_resize_timeout = 500; /* 0.5 seconds */
+ const int window_resize_timeout = 1000; /* 1.0 second */
if((focused_window_changed && src_window_id) || (window_resized && time_now - window_resize_time >= window_resize_timeout)) {
XWindowAttributes xwa;
if(!XGetWindowAttributes(x_display, src_window_id, &xwa)) {