lib/rabbit/frame.rb in rabbit-2.1.6 vs lib/rabbit/frame.rb in rabbit-2.1.7

- old
+ new

@@ -115,12 +115,12 @@ true end private def init_window(width, height, window_type=nil) - window_type ||= Gtk::Window::TOPLEVEL - @window = Gtk::Window.new(window_type) + window_type ||= :toplevel + @window = Gtk::ApplicationWindow.new(::Rabbit.application) @window.set_default_size(width, height) @window.parse_geometry(@geometry) if @geometry @window.set_app_paintable(true) set_window_signal setup_dnd @@ -165,21 +165,17 @@ end def set_window_signal_destroy @window.signal_connect("destroy") do @canvas.detach - if main_window? and Gtk.main_level > 0 - Gtk.main_quit - end end end def setup_dnd - Gtk::Drag.dest_set(@window, - Gtk::Drag::DEST_DEFAULT_ALL, - [["text/uri-list", 0, 0], - ["_NETSCAPE_URL", 0, 0]], - Gdk::DragContext::ACTION_COPY) + @window.drag_dest_set(:all, + [["text/uri-list", 0, 0], + ["_NETSCAPE_URL", 0, 0]], + :copy) @window.signal_connect("drag-data-received") do |*args| widget, context, x, y, selection_data, info, time = args uri = selection_data.data.chomp Gtk.idle_add do parse(Source::URI.new(nil, logger, uri))