Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions LuaGObject/override/Gtk3.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ local log = LuaGObject.log.domain('LuaGObject.Gtk3')

assert(Gtk.get_major_version() <= 3)

-- Initialize GTK.
Gtk.disable_setlocale()
if not Gtk.init_check() then
return "gtk_init_check() failed"
-- Initialize GTK, unless a host application already did so.
if not Gdk.Display.get_default() then
Gtk.disable_setlocale()
if not Gtk.init_check() then
return "gtk_init_check() failed"
end
end

-- Gtk.Allocation is just an alias to Gdk.Rectangle.
Expand Down
10 changes: 6 additions & 4 deletions LuaGObject/override/Gtk4.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ local log = LuaGObject.log.domain "LuaGObject.Gtk4"

assert(Gtk.get_major_version() == 4)

-- Initialize GTK.
Gtk.disable_setlocale()
if not Gtk.init_check() then
return "gtk_init_check() failed"
-- Initialize GTK, unless a host application already did so.
if not Gdk.Display.get_default() then
Gtk.disable_setlocale()
if not Gtk.init_check() then
return "gtk_init_check() failed"
end
end

-- Gtk.Allocation overrides --
Expand Down