[Bf-blender-cvs] [bfe37b7255e] master: Merge branch 'blender-v3.1-release'
Germano Cavalcante
noreply at git.blender.org
Tue Mar 1 22:35:59 CET 2022
Commit: bfe37b7255e76b7c66e3f9cfd47bd0636ac142cf
Author: Germano Cavalcante
Date: Tue Mar 1 18:25:59 2022 -0300
Branches: master
https://developer.blender.org/rBbfe37b7255e76b7c66e3f9cfd47bd0636ac142cf
Merge branch 'blender-v3.1-release'
===================================================================
===================================================================
diff --cc source/blender/editors/screen/area.c
index a64948b5864,c6834c84794..af84f6f99a9
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@@ -3438,38 -3454,6 +3438,37 @@@ bool ED_area_is_global(const ScrArea *a
return area->global != NULL;
}
+ScrArea *ED_area_find_under_cursor(const bContext *C, int spacetype, const int xy[2])
+{
+ bScreen *screen = CTX_wm_screen(C);
+ wmWindow *win = CTX_wm_window(C);
- wmWindowManager *wm = CTX_wm_manager(C);
+
+ ScrArea *area = NULL;
+
+ if (win->parent) {
+ /* If active window is a child, check itself first. */
+ area = BKE_screen_find_area_xy(screen, spacetype, xy);
+ }
+
+ if (!area) {
+ /* Check all windows except the active one. */
+ int scr_pos[2];
- wmWindow *r_win = WM_window_find_under_cursor(wm, win, win, xy, scr_pos);
- if (r_win) {
++ wmWindow *r_win = WM_window_find_under_cursor(win, xy, scr_pos);
++ if (r_win && r_win != win) {
+ win = r_win;
+ screen = WM_window_get_active_screen(win);
+ area = BKE_screen_find_area_xy(screen, spacetype, scr_pos);
+ }
+ }
+
+ if (!area && !win->parent) {
+ /* If active window is a parent window, check itself last. */
+ area = BKE_screen_find_area_xy(screen, spacetype, xy);
+ }
+
+ return area;
+}
+
ScrArea *ED_screen_areas_iter_first(const wmWindow *win, const bScreen *screen)
{
ScrArea *global_area = win->global_areas.areabase.first;
More information about the Bf-blender-cvs
mailing list