Cocoa: cocoa sometimes show a hidden window
Cocoa: cocoa sometimes show a hidden window

If we tell the only window in an app to hide, deactivate the app, and
then activate it again, the window will show on screen (and be
unresponsive). The reason is that cocoa still sees the window as the
main window (and I cannot find a way to tell cocoa otherwise).
This patch works around the problem by hiding the window again if it
becomes main while being hidden.

Reviewed-by: msorvig

pruiz/wkhtmltopdf-qt,pruiz/wkhtmltopdf-qt,igor-sfdc/qt-wk,igor-sfdc/qt-wk,igor-sfdc/qt-wk,igor-sfdc/qt-wk,igor-sfdc/qt-wk,pruiz/wkhtmltopdf-qt,pruiz/wkhtmltopdf-qt,pruiz/wkhtmltopdf-qt,igor-sfdc/qt-wk,igor-sfdc/qt-wk,igor-sfdc/qt-wk,igor-sfdc/qt-wk,pruiz/wkhtmltopdf-qt,pruiz/wkhtmltopdf-qt,igor-sfdc/qt-wk,pruiz/wkhtmltopdf-qt,pruiz/wkhtmltopdf-qt,pruiz/wkhtmltopdf-qt,pruiz/wkhtmltopdf-qt,igor-sfdc/qt-wk