Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def run_message_loop():
# Run message loop for some time.
# noinspection PyTypeChecker
for i in range(MESSAGE_LOOP_RANGE):
cef.MessageLoopWork()
time.sleep(0.01)
subtest_message("cef.MessageLoopWork() ok")
def do_message_loop_work(work_loops):
# noinspection PyTypeChecker
for i in range(work_loops):
cef.MessageLoopWork()
time.sleep(0.01)
def OnTimer(self):
if self.exiting:
return False
cefpython.MessageLoopWork()
return True
def MessageLoopTimer(event):
cefpython.MessageLoopWork()
def on_timer(event):
cef.MessageLoopWork()
def OnTimer(self, event):
self.timerCount += 1
# print("wxpython.py: OnTimer() %d" % self.timerCount)
cefpython.MessageLoopWork()
"unmodified_character": keycode,
"modifiers": cef.EVENTFLAG_NONE
}
browser.SendKeyEvent(key_event)
# Clear the renderer
sdl2.SDL_SetRenderDrawColor(
renderer,
backgroundColour.r,
backgroundColour.g,
backgroundColour.b,
255
)
sdl2.SDL_RenderClear(renderer)
# Tell CEF to update which will trigger the OnPaint
# method of the RenderHandler instance
cef.MessageLoopWork()
# Update display
sdl2.SDL_RenderCopy(
renderer,
renderHandler.texture,
None,
sdl2.SDL_Rect(0, headerHeight, browserWidth, browserHeight)
)
sdl2.SDL_RenderPresent(renderer)
# FPS debug code
frames += 1
if sdl2.timer.SDL_GetTicks() - fpsTime > 1000:
logging.debug("FPS: %d" % frames)
frames = 0
resetFpsTime = True
# regulate frame rate
if sdl2.timer.SDL_GetTicks() - startTime < 1000.0 / frameRate:
def message_loop(self):
self.cefstream.get_logger().info("Calling message loop")
while self.running:
cef.MessageLoopWork()
self.shutdown_cef()
def _message_loop_work(self, *_):
"""Get called every frame."""
self.count += 1
# print(self.count)
cef.MessageLoopWork()
self.on_mouse_move_emulate()
# From Kivy docs:
# Clock.schedule_once(my_callback, 0) # call after the next frame
# Clock.schedule_once(my_callback, -1) # call before the next frame
# When scheduling "after the next frame" Kivy calls _message_loop_work
# in about 13ms intervals. We use a small trick to make this 6ms
# interval by scheduling it alternately before and after the next
# frame. This gives better User Experience when scrolling.
# See Issue #240 for more details on OSR performance.
if self.count % 2 == 0:
Clock.schedule_once(self._message_loop_work, 0)
else:
Clock.schedule_once(self._message_loop_work, -1)
def message_loop_work(self):
cef.MessageLoopWork()
self.after(10, self.message_loop_work)