Skip to content

Commit

Permalink
handle case when gdk_get_monitor_at_surface returns NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
jwahlstrand committed May 6, 2023
1 parent 0e46ba8 commit 7125ac3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Gtk4"
uuid = "9db2cae5-386f-4011-9d63-a5602296539b"
version = "0.3.4"
version = "0.3.5"

[deps]
BitFlags = "d1d4a3ce-64b1-5f1a-9ba4-7e7e69966f35"
Expand Down
8 changes: 7 additions & 1 deletion src/base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,13 @@ function monitor(w::GtkWidget)
tl = toplevel(w)
tl === nothing && return nothing
s = G_.get_surface(GtkNative(tl))
G_.get_monitor_at_surface(d,s)
# sometimes `get_monitor_at_surface` returns NULL when it shouldn't
# should be unnecessary in a future version of GTK4_jll: https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/4917
try
G_.get_monitor_at_surface(d,s)
catch e
nothing
end
end

"""
Expand Down

0 comments on commit 7125ac3

Please sign in to comment.