Drop down menu not visible in Writer & Calc

During editing text or spreadsheet in Writer or Calc it happens to me that text in the menus is not visible anymore. The menus simplpy open with blank content. Also pop up messages are without buttons, therefore I am not able to save my work.
This normally happens when I switch windows between Firefox and Thunderbird. When I return into Libre office, menus are no longer visible sometimes.
Please help as it is very unpleasant and unpredictable.

Version is 5.2.2.2 for Xubuntu 16.10.