lib/rabbit/frame.rb in rabbit-0.6.3 vs lib/rabbit/frame.rb in rabbit-0.6.4

- old
+ new

@@ -25,16 +25,17 @@ def_delegators(:@canvas, :print, :filename=) def_delegators(:@canvas, :output_html=, :output_index_html=) def_delegators(:@canvas, :rss_base_uri=, :use_gl?, :use_gl=) attr_reader :window, :logger - attr_accessor :geometry + attr_accessor :geometry, :force_keep_above def initialize(logger, canvas) @logger = logger @canvas = canvas @geometry = nil + @force_keep_above = nil end def destroyed? @window.nil? or @window.destroyed? end @@ -99,11 +100,15 @@ init_window(width, height, window_type) @fullscreen_toggled = false @fullscreen = false @iconify = false @main_window = main_window - @window.keep_above = true unless @main_window + if @main_window + @window.keep_above = @force_keep_above unless @force_keep_above.nil? + else + @window.keep_above = true + end @window.show @canvas.post_init_gui end def fullscreen_available? @@ -129,19 +134,28 @@ def set_window_signal set_window_signal_window_state_event set_window_signal_destroy end + def update_keep_above(keep_above=nil) + if @main_window + keep_above = @force_keep_above unless @force_keep_above.nil? + @window.keep_above = keep_above unless keep_above.nil? + else + @window.keep_above = true + end + end + def set_window_signal_window_state_event @window.signal_connect("window_state_event") do |widget, event| if event.changed_mask.fullscreen? @fullscreen_toggled = true if fullscreen? @window.keep_above = true @canvas.fullscreened else - @window.keep_above = !@main_window + update_keep_above(false) @canvas.unfullscreened end @window.present elsif event.changed_mask.iconified? if @iconify @@ -233,9 +247,10 @@ end def_null_methods(:icon, :icon=, :set_icon) def_null_methods(:icon_list, :icon_list=, :set_icon_list) def_null_methods(:update_title, :geometry, :geometry=) + def_null_methods(:force_keep_above, :force_keep_above=) def_null_methods(:fullscreen?, :quit) def fullscreen_available? false