mirror of
https://github.com/JannisHeydemann/BoredOS.git
synced 2026-05-30 10:26:59 +00:00
fix wm freeze explorer
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
10
src/wm/wm.c
10
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user