aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2016-11-22 12:40:46 +0100
committerDan Gudmundsson <[email protected]>2016-11-22 12:40:46 +0100
commit3c5f019a3a69d4d18c40dccaa91f522f85c9c92a (patch)
tree322e43426d4a6cd2a67b157c51d91f378814be51 /lib/wx
parent04729d8bc0347ef9f6e9d55fe2aac8fe0022e6a1 (diff)
downloadotp-3c5f019a3a69d4d18c40dccaa91f522f85c9c92a.tar.gz
otp-3c5f019a3a69d4d18c40dccaa91f522f85c9c92a.tar.bz2
otp-3c5f019a3a69d4d18c40dccaa91f522f85c9c92a.zip
wx: Do not dispatch commands after frequent events
The user app may want to handle several mouse motion events before drawing new data for example.
Diffstat (limited to 'lib/wx')
-rw-r--r--lib/wx/api_gen/wx_gen_cpp.erl3
-rw-r--r--lib/wx/c_src/gen/wxe_events.cpp2
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/wx/api_gen/wx_gen_cpp.erl b/lib/wx/api_gen/wx_gen_cpp.erl
index 0a0b1f9209..d4b6db8153 100644
--- a/lib/wx/api_gen/wx_gen_cpp.erl
+++ b/lib/wx/api_gen/wx_gen_cpp.erl
@@ -1316,7 +1316,8 @@ encode_events(Evs) ->
w(" } else {~n"),
w(" send_res = rt.send();~n"),
w(" if(cb->skip) event->Skip();~n"),
- w(" if(app->recurse_level < 1) {~n"),
+ #class{id=MouseId} = lists:keyfind("wxMouseEvent", #class.name, Evs),
+ w(" if(app->recurse_level < 1 && Etype->cID != ~p) {~n", [MouseId]),
w(" app->recurse_level++;~n"),
w(" app->dispatch_cmds();~n"),
w(" app->recurse_level--;~n"),
diff --git a/lib/wx/c_src/gen/wxe_events.cpp b/lib/wx/c_src/gen/wxe_events.cpp
index b6d3c2db18..01787c8a64 100644
--- a/lib/wx/c_src/gen/wxe_events.cpp
+++ b/lib/wx/c_src/gen/wxe_events.cpp
@@ -910,7 +910,7 @@ case 238: {// wxDropFilesEvent
} else {
send_res = rt.send();
if(cb->skip) event->Skip();
- if(app->recurse_level < 1) {
+ if(app->recurse_level < 1 && Etype->cID != 168) {
app->recurse_level++;
app->dispatch_cmds();
app->recurse_level--;