From 3b4f6996a8fd521b532eff0f8cbcd282d9a2c5b7 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 12 Oct 2017 14:43:45 +0200 Subject: Fix T52999: floating (popup) panels/menus could jump around screen in some cases. Would happen during panel's refresh drawing, if drawing code had to adjust final panel position compared to the initial one computed based on the mouse coordinates, and user had dragged the floating panel around. Issue fixed by adjusting stored mouse coordinates once final panel position is known, such that they would directly generate those coordinates. that way, the basic offset applied to those stored mouse coordinates during panel dragging is valid, and recreating panel based on those won't make it jump in screen. Note that panel will still jump in case user dragged it partially out of view - we could prevent that, but imho it's better to keep that behavior, since redraw can generate a popup of different size, which could end up with a totally out-of-view one... Hopefully this fix does not break anything else! --- source/blender/editors/interface/interface_regions.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/interface/interface_regions.c') diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 1dffce43a39..71124cf8eb7 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -1869,8 +1869,9 @@ uiBlock *ui_popup_block_refresh( /* defer this until blocks are translated (below) */ block->oldblock = NULL; - if (!block->endblock) - UI_block_end_ex(C, block, handle->popup_create_vars.event_xy); + if (!block->endblock) { + UI_block_end_ex(C, block, handle->popup_create_vars.event_xy, handle->popup_create_vars.event_xy); + } /* if this is being created from a button */ if (but) { -- cgit v1.2.3