Skip to content

Commit

Permalink
gtk: check Gtk::Native
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Sep 25, 2024
1 parent 9bd01cf commit 64dfac5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/rabbit/gtk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,15 @@ def call(*args, &block)
end
end

class Widget
unless const_defined?(:Native)
# For GTK 3
unless method_defined?(:surface)
#
# GTK 4 renames Gdk::Window to Gdk::Surface
class Widget
def native
self
end
end

# GTK 4 renames Gdk::Window to Gdk::Surface
unless method_defined?(:surface)
alias_method :surface, :window
end
end
Expand Down

0 comments on commit 64dfac5

Please sign in to comment.