mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 16:20:11 -04:00
windisplay: add a variable to disable Panda's message pump
This is particularly important for Tcl/Tk, which assumes it is in charge of the Windows event loop. Fixes #586
This commit is contained in:
parent
b43b0c9fad
commit
55f624e073
@ -3050,6 +3050,10 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
|
|
||||||
init_app_for_gui()
|
init_app_for_gui()
|
||||||
|
|
||||||
|
# Disable the Windows message loop, since Tcl wants to handle this all
|
||||||
|
# on its own.
|
||||||
|
ConfigVariableBool('disable-message-loop', False).value = True
|
||||||
|
|
||||||
if ConfigVariableBool('tk-main-loop', True):
|
if ConfigVariableBool('tk-main-loop', True):
|
||||||
# Put Tkinter in charge of the main loop. It really
|
# Put Tkinter in charge of the main loop. It really
|
||||||
# seems to like this better; the GUI otherwise becomes
|
# seems to like this better; the GUI otherwise becomes
|
||||||
|
@ -91,6 +91,13 @@ ConfigVariableBool paste_emit_keystrokes
|
|||||||
PRC_DESC("Handle paste events (Ctrl-V) as separate keystroke events for each "
|
PRC_DESC("Handle paste events (Ctrl-V) as separate keystroke events for each "
|
||||||
"pasted character."));
|
"pasted character."));
|
||||||
|
|
||||||
|
ConfigVariableBool disable_message_loop
|
||||||
|
("disable-message-loop", false,
|
||||||
|
PRC_DESC("If this is false, Panda will process messages from the Windows "
|
||||||
|
"message loop, which is required for normal operation. You may set "
|
||||||
|
"this to true if some other UI framework (such as Tcl/Tk) needs "
|
||||||
|
"exclusive ownership of the message loop."));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes the library. This must be called at least once before any of
|
* Initializes the library. This must be called at least once before any of
|
||||||
* the functions or classes in this library can be used. Normally it will be
|
* the functions or classes in this library can be used. Normally it will be
|
||||||
|
@ -32,6 +32,7 @@ extern ConfigVariableBool request_dxdisplay_information;
|
|||||||
extern ConfigVariableBool dpi_aware;
|
extern ConfigVariableBool dpi_aware;
|
||||||
extern ConfigVariableBool dpi_window_resize;
|
extern ConfigVariableBool dpi_window_resize;
|
||||||
extern ConfigVariableBool paste_emit_keystrokes;
|
extern ConfigVariableBool paste_emit_keystrokes;
|
||||||
|
extern ConfigVariableBool disable_message_loop;
|
||||||
|
|
||||||
extern EXPCL_PANDAWIN ConfigVariableBool swapbuffer_framelock;
|
extern EXPCL_PANDAWIN ConfigVariableBool swapbuffer_framelock;
|
||||||
|
|
||||||
|
@ -254,10 +254,12 @@ process_events() {
|
|||||||
|
|
||||||
MSG msg;
|
MSG msg;
|
||||||
|
|
||||||
// Handle all the messages on the queue in a row. Some of these might be
|
if (!disable_message_loop) {
|
||||||
// for another window, but they will get dispatched appropriately.
|
// Handle all the messages on the queue in a row. Some of these might be
|
||||||
while (PeekMessage(&msg, nullptr, 0, 0, PM_NOREMOVE)) {
|
// for another window, but they will get dispatched appropriately.
|
||||||
process_1_event();
|
while (PeekMessage(&msg, nullptr, 0, 0, PM_NOREMOVE)) {
|
||||||
|
process_1_event();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user