diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2017-10-12 15:43:45 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2017-10-12 15:50:18 +0300 |
commit | 3b4f6996a8fd521b532eff0f8cbcd282d9a2c5b7 (patch) | |
tree | af95c1c43bdbbd72a42dfee2b18cd4d326cd15db /source/blender/editors/interface/interface_regions.c | |
parent | b29e37ed81fdc4e6213602ca5a9d5095100ee513 (diff) |
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!
Diffstat (limited to 'source/blender/editors/interface/interface_regions.c')
-rw-r--r-- | source/blender/editors/interface/interface_regions.c | 5 |
1 files changed, 3 insertions, 2 deletions
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) { |