aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/src/wxe_server.erl
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2015-12-04 12:10:04 +0100
committerDan Gudmundsson <[email protected]>2015-12-04 12:10:04 +0100
commit7a13283ac6f4a7738dbe2a2ccfce392a820dca2a (patch)
treec9c8735eef6ff80854c2814010f54b30f3d7f50d /lib/wx/src/wxe_server.erl
parent7b57b86a78f668747cc28e1820a0e6e8474111ea (diff)
parent80483dcb40c382e38405204370dfac7a8b6513aa (diff)
downloadotp-7a13283ac6f4a7738dbe2a2ccfce392a820dca2a.tar.gz
otp-7a13283ac6f4a7738dbe2a2ccfce392a820dca2a.tar.bz2
otp-7a13283ac6f4a7738dbe2a2ccfce392a820dca2a.zip
Merge branch 'dgud/wx/rewrite-cmd-loop/OTP-13160' into maint
* dgud/wx/rewrite-cmd-loop/OTP-13160: wx: Fix some function specifications wx: Remove call to disconnect_impl from server wx: Add a command queue check after event sent to erlang wx: Make wxPostScriptDC optional wx: Add wxOverlay wx: Use only one ring buffer for command queue
Diffstat (limited to 'lib/wx/src/wxe_server.erl')
-rw-r--r--lib/wx/src/wxe_server.erl21
1 files changed, 2 insertions, 19 deletions
diff --git a/lib/wx/src/wxe_server.erl b/lib/wx/src/wxe_server.erl
index cc253b1143..ae9440f890 100644
--- a/lib/wx/src/wxe_server.erl
+++ b/lib/wx/src/wxe_server.erl
@@ -352,25 +352,8 @@ handle_disconnect(Object, Evh = #evh{cb=Fun}, From,
State0 = #state{users=Users0, cb=Callbacks}) ->
#user{events=Evs0} = gb_trees:get(From, Users0),
FunId = gb_trees:lookup(Fun, Callbacks),
- case find_handler(Evs0, Object, Evh#evh{cb=FunId}) of
- [] ->
- {reply, false, State0};
- Handlers ->
- case disconnect(Object,Handlers) of
- #evh{} -> {reply, true, State0};
- Result -> {reply, Result, State0}
- end
- end.
-
-disconnect(Object,[Ev|Evs]) ->
- try wxEvtHandler:disconnect_impl(Object,Ev) of
- true -> Ev;
- false -> disconnect(Object, Evs);
- Error -> Error
- catch _:_ ->
- false
- end;
-disconnect(_, []) -> false.
+ Handlers = find_handler(Evs0, Object, Evh#evh{cb=FunId}),
+ {reply, {try_in_order, Handlers}, State0}.
find_handler([{Object,Evh}|Evs], Object, Match) ->
case match_handler(Match, Evh) of