Skip to content

Commit

Permalink
Fix StackOverflow error on synchronous loop execution
Browse files Browse the repository at this point in the history
  • Loading branch information
serenity4 committed Dec 30, 2020
1 parent 3c498a2 commit 636b33d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/window_handler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ XWindowHandler(conn::Connection, windows::Dict{Symbol, XCBWindow}) = XWindowHand
XWindowHandler(conn::Connection, windows::Vector{XCBWindow}) = XWindowHandler(conn, Dict(Symbol.("window_" .* string.(1:length(windows))) .=> windows))

function poll_for_event(handler::XWindowHandler)
event = xcb_poll_for_event(handler.conn)
if event == C_NULL
while true
event = xcb_poll_for_event(handler.conn)
event C_NULL && return event
yield()
poll_for_event(handler::XWindowHandler)
else
event
end
end

Expand Down

0 comments on commit 636b33d

Please sign in to comment.