diff --git a/src/images/gif/badapple.gif b/src/images/gif/badapple.gif new file mode 100644 index 0000000..5af0453 Binary files /dev/null and b/src/images/gif/badapple.gif differ diff --git a/src/wm/explorer.c b/src/wm/explorer.c index 1e8c6a2..832aebd 100644 --- a/src/wm/explorer.c +++ b/src/wm/explorer.c @@ -1890,8 +1890,8 @@ Window* explorer_create_window(const char *path) { else explorer_load_directory(win, path); explorer_wins[explorer_win_count++] = win; - wm_add_window(win); - wm_bring_to_front(win); + wm_add_window_locked(win); + // wm_add_window_locked already calls wm_bring_to_front_locked! return win; } diff --git a/src/wm/wm.c b/src/wm/wm.c index 9101d9a..6ee3b97 100644 --- a/src/wm/wm.c +++ b/src/wm/wm.c @@ -1566,13 +1566,17 @@ void wm_bring_to_front(Window *win) { wm_lock_release(rflags); } -void wm_add_window(Window *win) { - uint64_t rflags; - rflags = wm_lock_acquire(); +void wm_add_window_locked(Window *win) { if (window_count < 32) { all_windows[window_count++] = win; wm_bring_to_front_locked(win); // Ensure newly added windows are on top } +} + +void wm_add_window(Window *win) { + uint64_t rflags; + rflags = wm_lock_acquire(); + wm_add_window_locked(win); wm_lock_release(rflags); } diff --git a/src/wm/wm.h b/src/wm/wm.h index a24494a..daf3576 100644 --- a/src/wm/wm.h +++ b/src/wm/wm.h @@ -75,8 +75,10 @@ void wm_handle_click(int x, int y); void wm_handle_right_click(int x, int y); void wm_process_input(void); void wm_process_deferred_thumbs(void); +void wm_add_window_locked(Window *win); void wm_add_window(Window *win); void wm_remove_window(Window *win); +void wm_bring_to_front_locked(Window *win); void wm_bring_to_front(Window *win); Window* wm_find_window_by_title(const char *title);