aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/c_src
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2015-11-22 19:36:04 +0100
committerDan Gudmundsson <[email protected]>2015-11-24 14:34:03 +0100
commit617387025b698c7c7b1d102e35234b2c65dda335 (patch)
tree4ec88aa9b97d0d6a6e23aff695d7729dce2e5246 /lib/wx/c_src
parentda4a2d7ca19f967da4561f66659346540d6441c9 (diff)
downloadotp-617387025b698c7c7b1d102e35234b2c65dda335.tar.gz
otp-617387025b698c7c7b1d102e35234b2c65dda335.tar.bz2
otp-617387025b698c7c7b1d102e35234b2c65dda335.zip
wx: Add a command queue check after event sent to erlang
Some events are callbacks inside wxWidgets so idle processing doesn't take place until operation is completed, for instance move/resize window on Windows. This way we get some response while mouse button is pressed.
Diffstat (limited to 'lib/wx/c_src')
-rw-r--r--lib/wx/c_src/gen/wxe_events.cpp5
-rw-r--r--lib/wx/c_src/gen/wxe_funcs.cpp4
-rw-r--r--lib/wx/c_src/wxe_impl.cpp4
3 files changed, 11 insertions, 2 deletions
diff --git a/lib/wx/c_src/gen/wxe_events.cpp b/lib/wx/c_src/gen/wxe_events.cpp
index a532ee985d..4affe2ba53 100644
--- a/lib/wx/c_src/gen/wxe_events.cpp
+++ b/lib/wx/c_src/gen/wxe_events.cpp
@@ -897,6 +897,11 @@ case 235: {// wxMouseCaptureLostEvent
} else {
send_res = rt.send();
if(cb->skip) event->Skip();
+ if(app->recurse_level < 1) {
+ app->recurse_level++;
+ app->dispatch_cmds();
+ app->recurse_level--;
+ }
};
return send_res;
}
diff --git a/lib/wx/c_src/gen/wxe_funcs.cpp b/lib/wx/c_src/gen/wxe_funcs.cpp
index fd1cedd714..4025fb1c16 100644
--- a/lib/wx/c_src/gen/wxe_funcs.cpp
+++ b/lib/wx/c_src/gen/wxe_funcs.cpp
@@ -113,11 +113,15 @@ case 101: { // wxEvtHandler::Disconnect
int eventType = wxeEventTypeFromAtom(bp); bp += *eventTypeLen;
if(eventType > 0) {
+ if(recurse_level > 1) {
+ delayed_delete->Append(Ecmd.Save());
+ } else {
bool Result = This->Disconnect((int) *winid,(int) *lastId,eventType,
(wxObjectEventFunction)(wxEventFunction)
&wxeEvtListener::forward,
NULL, Listener);
rt.addBool(Result);
+ }
} else {
rt.addAtom("badarg");
rt.addAtom("event_type");
diff --git a/lib/wx/c_src/wxe_impl.cpp b/lib/wx/c_src/wxe_impl.cpp
index f81d0bbbd9..c5bad41573 100644
--- a/lib/wx/c_src/wxe_impl.cpp
+++ b/lib/wx/c_src/wxe_impl.cpp
@@ -225,9 +225,9 @@ void handle_event_callback(ErlDrvPort port, ErlDrvTermData process)
if(driver_monitor_process(port, process, &monitor) == 0) {
// Should we be able to handle commands when recursing? probably
// fprintf(stderr, "\r\nCB EV Start %lu \r\n", process);fflush(stderr);
- app->recurse_level++;
+ app->recurse_level += 2;
app->dispatch_cb(wxe_queue, process);
- app->recurse_level--;
+ app->recurse_level -= 2;
// fprintf(stderr, "CB EV done %lu \r\n", process);fflush(stderr);
driver_demonitor_process(port, &monitor);
}