Changeset View
Changeset View
Standalone View
Standalone View
source/blender/windowmanager/intern/wm_window.c
| Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | |||||
| wmWindow *win = GHOST_GetWindowUserData(ghostwin); | wmWindow *win = GHOST_GetWindowUserData(ghostwin); | ||||
| switch (type) { | switch (type) { | ||||
| case GHOST_kEventWindowDeactivate: | case GHOST_kEventWindowDeactivate: | ||||
| wm_event_add_ghostevent(wm, win, type, data); | wm_event_add_ghostevent(wm, win, type, data); | ||||
| win->active = 0; /* XXX */ | win->active = 0; /* XXX */ | ||||
| /* clear modifiers for inactive windows */ | /* clear modifiers for inactive windows */ | ||||
| win->eventstate->modifier = 0; | win->eventstate->modifier = 0; | ||||
campbellbarton: This should be committed separately with a reason why it's needed.
Noting this since there is… | |||||
| win->eventstate->keymodifier = 0; | win->eventstate->keymodifier = 0; | ||||
| break; | break; | ||||
| case GHOST_kEventWindowActivate: { | case GHOST_kEventWindowActivate: { | ||||
| const int keymodifier = ((query_qual(SHIFT) ? KM_SHIFT : 0) | | const int keymodifier = ((query_qual(SHIFT) ? KM_SHIFT : 0) | | ||||
| (query_qual(CONTROL) ? KM_CTRL : 0) | | (query_qual(CONTROL) ? KM_CTRL : 0) | | ||||
| (query_qual(ALT) ? KM_ALT : 0) | (query_qual(OS) ? KM_OSKEY : 0)); | (query_qual(ALT) ? KM_ALT : 0) | (query_qual(OS) ? KM_OSKEY : 0)); | ||||
| /* Win23/GHOST modifier bug, see T40317 */ | /* Win23/GHOST modifier bug, see T40317 */ | ||||
| #ifndef WIN32 | #ifndef WIN32 | ||||
| //# define USE_WIN_ACTIVATE | # define USE_WIN_ACTIVATE | ||||
| #endif | #endif | ||||
| /* No context change! C->wm->windrawable is drawable, or for area queues. */ | /* No context change! C->wm->windrawable is drawable, or for area queues. */ | ||||
| wm->winactive = win; | wm->winactive = win; | ||||
| win->active = 1; | win->active = 1; | ||||
| // window_handle(win, INPUTCHANGE, win->active); | // window_handle(win, INPUTCHANGE, win->active); | ||||
| ▲ Show 20 Lines • Show All 184 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| wmWindow *win_other = GHOST_GetWindowUserData(ghostwin); | wmWindow *win_other = GHOST_GetWindowUserData(ghostwin); | ||||
| wm_cursor_position_from_ghost_screen_coords(win_other, &tmp[0], &tmp[1]); | wm_cursor_position_from_ghost_screen_coords(win_other, &tmp[0], &tmp[1]); | ||||
| copy_v2_v2_int(r_mval, tmp); | copy_v2_v2_int(r_mval, tmp); | ||||
| return win_other; | return win_other; | ||||
| } | } | ||||
| wmWindow *WM_window_from_area(const wmWindowManager *wm, const ScrArea *area) | |||||
| { | |||||
| if (!area) { | |||||
| return NULL; | |||||
| } | |||||
| LISTBASE_FOREACH (wmWindow *, win, &wm->windows) { | |||||
| bScreen *screen = WM_window_get_active_screen(win); | |||||
| LISTBASE_FOREACH (ScrArea *, area_iter, &screen->areabase) { | |||||
| if (area_iter == area) { | |||||
| return win; | |||||
| } | |||||
| } | |||||
| } | |||||
| return NULL; | |||||
| } | |||||
| void WM_window_pixel_sample_read(const wmWindowManager *wm, | void WM_window_pixel_sample_read(const wmWindowManager *wm, | ||||
| const wmWindow *win, | const wmWindow *win, | ||||
| const int pos[2], | const int pos[2], | ||||
| float r_col[3]) | float r_col[3]) | ||||
| { | { | ||||
| bool setup_context = wm->windrawable != win; | bool setup_context = wm->windrawable != win; | ||||
| if (setup_context) { | if (setup_context) { | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||
This should be committed separately with a reason why it's needed.
Noting this since there is a history of this causing problems, see comments for T40059, unfortunately these issues weren't reported so it's not possible to check if this is still an issue.