Actually I didn't explain well the case where the raise didn't worked for me as I expected. When you have two windows, with the first one locked and the second unlocked. If the raise function is called for the second unlocked window, it doesn't go on top of the first locked window.
For those who might interest, I found a simple solution. You need to temporarily lock the window, call the raise function then unlock the window.
Thank you Stephane for your quick answer !