threedeyes / qthaikuplugins

Qt5 plugins for haiku platform
GNU General Public License v3.0
13 stars 4 forks source link

QPA: Fix first RefsReceived call being ignored #14

Closed phw closed 4 years ago

phw commented 4 years ago

This fixes an issue with RefsReceived always ignoring the first received message.

Without this change my application will never receive the first file dropped on the deskbar icon. Only after dropping a second time it works.

I am not entirely sure about the need RefHandled and the waiting for it getting set in the loop at line 175 following, with that argv, argc trickery happening. This looks to me like a workaround for some specific issue, but I don't know enough about Haiku to say if this is really still needed.

phw commented 4 years ago

Just to clarify this: Without this patch "Open with" basically works in my PyQt5 application, but the first B_REF_RECEIVED is always ignored because for the first message RefHandled is always false and hence it does not trigger a QFileOpenEvent.

When I select multiple files and use "Open with" all will be opened in the application except the first one.

phw commented 4 years ago

See also discussion at https://discuss.haiku-os.org/t/open-with-in-qt5-application/9132