Need help overlaying an application window over camera screen

I made a python code where it will launch the pi camera and I can use buttons to record a video for 30 seconds or take pictures. In this python code, I mixed in another python script where I can launch a thermal imaging window with the press of a button and close it with a press of a button. The code works fine, but I am having trouble seeing the thermal imaging window ‘overlaying’ the camera screen, whenever I launched it, it doesn’t want to overlay on the camera screen rather it will just sit behind the screen.


I took a screenshot of my pi screen through SSH and as you can see that thermal imaging window is not overlaying the camera screen(I made it non full screen for demonstration)

Here is my code

#!/usr/bin/env python
import RPi.GPIO as GPIO

import time
import os

os.system('python3 /home/pi/Desktop/ &')#The Night camera 

GPIO.setup(16, GPIO.IN, pull_up_down=GPIO.PUD_UP)#To turn on Thermal 
GPIO.setup(5, GPIO.IN, pull_up_down=GPIO.PUD_UP)#To turn off Thermal 

while True:
 input_state = GPIO.input(16)#Open thermal
 if input_state == False:
    print('Thermal ON')
    os.system ('python3 /home/pi/Desktop/ &')

 input_state = GPIO.input(5)#Close thermal
 if input_state == False:
        print('Thermal OFF')
        os.system('pkill -f &')


I have tried searching online for solutions, but so far came empty handed. I just want the application window to appear over the camera screen whenever I pressed the button.

So is there a way to make that thermal imager window to display on top of the camera screen? also I made this code for my final year project where I have to present it on 5 December, any help is appreciated 😀

Source: Python-3x Questions