import pygame import sys from multiprocessing import Process, Value import multiprocessing import webview import time import ctypes def hide_show(window, is_exit): window.hide() time.sleep(5) # window.toggle_fullscreen() window.show() is_exit.value = True def test2(is_exit): window = webview.create_window('Full-screen window', 'https://www.ifeng.com/', fullscreen=True) # window.on_top = True webview.start(hide_show, (window, is_exit), gui='cef') if __name__ == '__main__': is_exit = multiprocessing.Manager().Value(ctypes.c_bool, False) pygame.init() # screen = pygame.display.set_mode((600, 400)) screen = pygame.display.set_mode((0, 0), flags=pygame.FULLSCREEN) pygame.display.set_caption("loading...") p = Process(target=test2, args=(is_exit,)) p.start() while not is_exit.value: for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() sys.exit() pygame.display.update() pygame.quit() sys.exit()