Page 1 of 1

[2.1] externalWindowHandle vs parentWindowHandle

Posted: Mon Aug 19, 2019 10:27 am
by gabbsson

As mentioned in my previous post I am currently working on "porting" my project to Windows to make sure it works there.
After some tinkering and fixing some of my bugs that did not cause crashes in Linux I have it running.

However there is one issue regarding the actual window I can't seem to figure out.
Between windows and Linux the external/parent-WindowHandle parameter behaves very differently.

On linux the externalWindowHandle (while deprecated according to the log) works the best.
My app needs to be able to resize and for some reason the parentWindowHandle parameter causes the window to flicker black while resizing.
Other than that they both work fine as far as I can tell.

Meanwhile on windows neither work perfectly. The externalWindowHandle seems to disregard scaling in one of the directions entirely which breaks resizing.
The parentWindowHandle resizes perfectly, does not flicker or anything but instead does not seem to allow my mouse clicks to "pass through" to Qt to allow me to pick up mouse-events, which I use to move the camera. (My window lives inside Qt).

Does anyone know the cause for this or even better how to solve it?
I'm trying to understand the difference between the two parameters but I figured it might be a good idea to ask here as well.

I'm fine with having some Windows/Linux specific code, but as it stands it is more or less broken in Windows OS.

Edit: Mixed up which parameter was which, fixed in the original post.

Re: [2.1] externalWindowHandle vs parentWindowHandle

Posted: Tue Aug 20, 2019 3:14 pm
by gabbsson
I remembered reading that resizing issues can be fixed using "winowMovedOrResized()" which I tried using on linux but it didn't seem to do anything.
Just out of curiosity I tried it on windows, together with "resize(x, y) and reposition(x, y)" which i was using on Linux and it seems to work!

So I am now using externalWindowHandle on both windows and linux.
I read a little in the source for OgreWin32Window and as far as I can tell there is no option to change the DWORD dwExStyle to something that allows mouse-passthrough. So this solution will do!