• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javaandroidc++objective-ccocoa誰得c#linuxgamebathyscaphephp翻訳qtpythonrubycwindowsomegattwitterguiframeworkbtronarduinovb.netdirectxtestゲームエンジンdom計画中(planning stage)previewer

ninix-aya(git://git.osdn.net/gitroot/ninix-aya/ruby-gtk3.git)のfork


コミットメタ情報

リビジョン91777c6f6d203af69ea20e1a61895a48d577acdf (tree)
日時2017-08-16 13:53:41
作者Shyouzou Sugitani <shy@user...>
コミッターShyouzou Sugitani

ログメッセージ

misc fixes

変更サマリ

差分

--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
1+Wed August 16 2017 Shyouzou Sugitani <shy@users.osdn.me>
2+ * deprecatedになっているメソッドを使用しないようにした.
3+ (Gtk::Menu.popup)
4+ * 「きのこ」互換機能ウインドウの重なり状態制御方法を変更した.
5+ * 「猫どりふ」互換機能のマウスボタンイベント処理を修正した.
6+ * バルーンとサーフェスの重なり状態制御方法を変更した.
7+ * SSTPControlerクラスがHolonクラスを継承するようにした.
8+
19 Sat August 12 2017 Shyouzou Sugitani <shy@users.osdn.me>
210 * バージョン5.0.4リリース.
311 * Ruby-GNOME2 3.1.2対応.
--- a/lib/ninix/kinoko.rb
+++ b/lib/ninix/kinoko.rb
@@ -56,10 +56,10 @@ module Kinoko
5656 @parent = parent
5757 end
5858
59- def popup(button)
59+ def popup()
6060 skin_list = @parent.handle_request('GET', 'get_skin_list')
6161 set_skin_menu(skin_list)
62- @__popup_menu.popup(nil, nil, button, Gtk.current_event_time())
62+ @__popup_menu.popup_at_pointer(nil)
6363 end
6464
6565 def set_skin_menu(list)
@@ -112,6 +112,7 @@ module Kinoko
112112 when 'set position', 'set surface'
113113 @skin.set_position()
114114 @skin.show()
115+ @skin.reset_z_order()
115116 when 'set scale'
116117 scale = @target.get_surface_scale()
117118 @skin.set_scale(scale)
@@ -122,14 +123,17 @@ module Kinoko
122123 @skin.hide()
123124 when 'deiconified'
124125 @skin.show()
126+ @skin.reset_z_order()
125127 when 'finalize'
126128 finalize()
127129 when 'move surface'
128130 side, xoffset, yoffset = args
129131 @skin.set_position(:xoffset => xoffset, :yoffset => yoffset) if side.zero? # sakura side
132+ @skin.reset_z_order()
130133 when 'raise'
131134 side = args[0]
132135 @skin.set_position() if side.zero? # sakura side
136+ @skin.reset_z_order()
133137 else
134138 Logging::Logging.debug('OBSERVER(kinoko): ignore - ' + event)
135139 end
@@ -309,13 +313,8 @@ module Kinoko
309313 end
310314 @window.update_size(@w, @h)
311315 set_position()
312- target_window = @parent.handle_request('GET', 'get_target_window')
313- if @data['ontop']
314- @window.set_transient_for(target_window)
315- else
316- target_window.set_transient_for(@window)
317- end
318316 show()
317+ reset_z_order()
319318 @seriko.reset(self, '') # XXX
320319 @seriko.start(self)
321320 @seriko.invoke_kinoko(self)
@@ -340,6 +339,16 @@ module Kinoko
340339 @__shown = false
341340 end
342341
342+ def reset_z_order
343+ return unless @__shown
344+ target_window = @parent.handle_request('GET', 'get_target_window')
345+ if @data['ontop']
346+ @window.window.restack(target_window.window, true)
347+ else
348+ target_window.window.restack(@window.window, true)
349+ end
350+ end
351+
343352 def append_actor(frame, actor)
344353 @seriko.append_actor(frame, actor)
345354 end
@@ -472,7 +481,7 @@ module Kinoko
472481 end
473482 button = event.button
474483 if button == 3 and click == 1
475- @__menu.popup(button)
484+ @__menu.popup()
476485 end
477486 return true
478487 end
--- a/lib/ninix/menu.rb
+++ b/lib/ninix/menu.rb
@@ -388,7 +388,7 @@ module Menu
388388 end
389389 end
390390
391- def popup(button, side)
391+ def popup(side)
392392 @__popup_menu.unrealize()
393393 for key in @__menu_list.keys
394394 item = @__menu_list[key][:entry]
@@ -437,8 +437,7 @@ module Menu
437437 end
438438 end
439439 end
440- @__popup_menu.popup(nil, nil, button,
441- Gtk.current_event_time())
440+ @__popup_menu.popup_at_pointer(nil)
442441 end
443442
444443 def __set_caption(name, caption)
--- a/lib/ninix/nekodorif.rb
+++ b/lib/ninix/nekodorif.rb
@@ -87,10 +87,10 @@ module Nekodorif
8787 @parent = parent
8888 end
8989
90- def popup(button)
90+ def popup()
9191 katochan_list = @parent.handle_request('GET', 'get_katochan_list')
9292 __set_katochan_menu(katochan_list)
93- @__popup_menu.popup(nil, nil, button, Gtk.current_event_time)
93+ @__popup_menu.popup_at_pointer(nil)
9494 end
9595
9696 def __set_katochan_menu(list)
@@ -357,11 +357,10 @@ module Nekodorif
357357 end
358358
359359 def button_press(widget, event)
360- @x_root = event.x_root
361- @y_root = event.y_root
362360 if event.button == 1
363361 if event.event_type == Gdk::EventType::BUTTON_PRESS
364- #pass
362+ @x_root = event.x_root
363+ @y_root = event.y_root
365364 elsif event.event_type == Gdk::EventType::DOUBLE_BUTTON_PRESS # double click
366365 if @parent.handle_request('GET', 'has_katochan')
367366 start()
@@ -370,7 +369,7 @@ module Nekodorif
370369 end
371370 elsif event.button == 3
372371 if event.event_type == Gdk::EventType::BUTTON_PRESS
373- @__menu.popup(event.button)
372+ @__menu.popup()
374373 end
375374 end
376375 return true
--- a/lib/ninix/sakura.rb
+++ b/lib/ninix/sakura.rb
@@ -440,11 +440,6 @@ module Sakura
440440 for side in 2..@char-1
441441 @balloon.add_window(side)
442442 end
443- for side in 0..@char-1
444- balloon_win = @balloon.get_window(side)
445- surface_win = @surface.get_window(side)
446- balloon_win.set_transient_for(surface_win)
447- end
448443 end
449444
450445 def update_balloon_offset(side, x_delta, y_delta)
@@ -1215,7 +1210,7 @@ module Sakura
12151210 end
12161211 if event == 'OnMouseClick' and arglist[5] == 1
12171212 @parent.handle_request(
1218- 'NOTIFY', 'open_popup_menu', self, arglist[5], arglist[3])
1213+ 'NOTIFY', 'open_popup_menu', self, arglist[3])
12191214 end
12201215 @parent.handle_request(
12211216 'NOTIFY', 'notify_other', @key,
@@ -1501,7 +1496,7 @@ module Sakura
15011496 end
15021497
15031498 def get_target_window
1504- @surface.get_window(0).window
1499+ @surface.get_window(0)
15051500 end
15061501
15071502 def get_kinoko_position(baseposition)
@@ -2716,6 +2711,9 @@ module Sakura
27162711 end
27172712 unless @processed_text.empty?
27182713 @balloon.show(@script_side)
2714+ balloon_win = @balloon.get_window(@script_side)
2715+ surface_win = @surface.get_window(@script_side)
2716+ balloon_win.window.restack(surface_win.window, true)
27192717 @balloon.append_text(@script_side, @processed_text[0])
27202718 @processed_text = @processed_text[1..-1]
27212719 surface_id = get_surface_id(@script_side)
--- a/lib/ninix_main.rb
+++ b/lib/ninix_main.rb
@@ -134,10 +134,10 @@ module Ninix_Main
134134 end
135135 end
136136
137- class SSTPControler
137+ class SSTPControler < MetaMagic::Holon
138138
139139 def initialize(sstp_port)
140- @parent = nil
140+ super("") ## FIXME
141141 @sstp_port = sstp_port
142142 @sstp_servers = []
143143 @__sstp_queue = []
@@ -145,10 +145,6 @@ module Ninix_Main
145145 @__current_sender = nil
146146 end
147147
148- def set_responsible(parent)
149- @parent = parent
150- end
151-
152148 def handle_request(event_type, event, *arglist)
153149 fail "assert" unless ['GET', 'NOTIFY'].include?(event_type)
154150 handlers = {}
@@ -678,7 +674,7 @@ module Ninix_Main
678674 @__menu_owner.network_update()
679675 end
680676
681- def open_popup_menu(sakura, button, side)
677+ def open_popup_menu(sakura, side)
682678 @__menu_owner = sakura
683679 path_background, path_sidebar, path_foreground, \
684680 align_background, align_sidebar, align_foreground = \
@@ -690,7 +686,7 @@ module Ninix_Main
690686 @__menu.set_fontcolor(background, foreground)
691687 mayuna_menu = @__menu_owner.get_mayuna_menu()
692688 @__menu.create_mayuna_menu(mayuna_menu)
693- @__menu.popup(button, side)
689+ @__menu.popup(side)
694690 end
695691
696692 def get_ghost_menus
@@ -1322,7 +1318,7 @@ module Ninix_Main
13221318
13231319 def initialize(app)
13241320 @app = app
1325- @dialog = Gtk::Dialog.new
1321+ @dialog = Gtk::Dialog.new(:parent => nil)
13261322 @dialog.signal_connect('delete_event') do |w, e|
13271323 next true # XXX
13281324 end