Fix notifiers from window events using the wrong window
The active window in the context may not match the window where GHOST events are generated. Notifiers for new windows would always be ignored with the context's window set to null for example. Noticed while investigating #119871.
This commit is contained in:
parent
2a55aabbd8
commit
e078112a53
|
@ -1487,7 +1487,7 @@ static bool ghost_event_proc(GHOST_EventHandle ghost_event, GHOST_TUserDataPtr C
|
|||
}
|
||||
|
||||
wm_window_make_drawable(wm, win);
|
||||
WM_event_add_notifier(C, NC_WINDOW, nullptr);
|
||||
WM_event_add_notifier_ex(wm, win, NC_WINDOW, nullptr);
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -1502,7 +1502,7 @@ static bool ghost_event_proc(GHOST_EventHandle ghost_event, GHOST_TUserDataPtr C
|
|||
* however this causes window flickering on resize with LIBDECOR under WAYLAND. */
|
||||
wm_window_swap_buffers(win);
|
||||
#else
|
||||
WM_event_add_notifier(C, NC_WINDOW, nullptr);
|
||||
WM_event_add_notifier_ex(wm, win, NC_WINDOW, nullptr);
|
||||
#endif
|
||||
|
||||
break;
|
||||
|
@ -1561,8 +1561,8 @@ static bool ghost_event_proc(GHOST_EventHandle ghost_event, GHOST_TUserDataPtr C
|
|||
|
||||
wm_window_make_drawable(wm, win);
|
||||
BKE_icon_changed(screen->id.icon_id);
|
||||
WM_event_add_notifier(C, NC_SCREEN | NA_EDITED, nullptr);
|
||||
WM_event_add_notifier(C, NC_WINDOW | NA_EDITED, nullptr);
|
||||
WM_event_add_notifier_ex(wm, win, NC_SCREEN | NA_EDITED, nullptr);
|
||||
WM_event_add_notifier_ex(wm, win, NC_WINDOW | NA_EDITED, nullptr);
|
||||
|
||||
#if defined(__APPLE__) || defined(WIN32)
|
||||
/* MACOS and WIN32 don't return to the main-loop while resize. */
|
||||
|
@ -1690,8 +1690,8 @@ static bool ghost_event_proc(GHOST_EventHandle ghost_event, GHOST_TUserDataPtr C
|
|||
|
||||
wm_window_make_drawable(wm, win);
|
||||
|
||||
WM_event_add_notifier(C, NC_SCREEN | NA_EDITED, nullptr);
|
||||
WM_event_add_notifier(C, NC_WINDOW | NA_EDITED, nullptr);
|
||||
WM_event_add_notifier_ex(wm, win, NC_SCREEN | NA_EDITED, nullptr);
|
||||
WM_event_add_notifier_ex(wm, win, NC_WINDOW | NA_EDITED, nullptr);
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue