commit e99e9a6e3635b7eb1b0a6ca7f9d4600bbc5ac957
parent abfbfe6be6bf930836cbd55d6181a857273a4939
Author: Suraj N. Kurapati <sunaku@gmail.com>
Date: Wed, 20 Sep 2006 11:02:05 -0700
[project @ c4f2ef4e7b5f62bc8ae51f7e06e9e49a04774aa7]
[project @ 114]
reverted to use of open() b/c less traffic
Diffstat:
wmiirc-config.rb | | | 76 | +++++++++++++++++++++++++++++++++++++++------------------------------------- |
1 file changed, 39 insertions(+), 37 deletions(-)
diff --git a/wmiirc-config.rb b/wmiirc-config.rb
@@ -433,43 +433,45 @@ end
## WM event loop
begin
- while event = FS.event.chomp
- type, arg = event.split(' ', 2)
-
- case type.to_sym
- when :Start
- if arg == __FILE__
- LOG.info "another instance is starting"
- exit
- end
-
- when :BarClick
- clickedView, clickedButton = arg.split
-
- case clickedButton.to_i
- when PRIMARY_CLICK
- Wmii.focus_view clickedView
-
- when MIDDLE_CLICK
- Wmii.selected_clients.each do |c|
- c.tag! clickedView
- end
-
- when SECONDARY_CLICK
- Wmii.selected_clients.each do |c|
- c.untag! clickedView
- end
- end
-
- when :ClientClick
- clickedClient, clickedButton = arg.split
-
- if clickedButton.to_i != PRIMARY_CLICK
- Wmii.get_client(clickedClient).invert_selection!
- end
-
- when :Key
- SHORTCUTS[arg].call
+ IXP::Client.new.open('/event') do |f|
+ while event = f.read.chomp
+ type, arg = event.split(' ', 2)
+
+ case type.to_sym
+ when :Start
+ if arg == __FILE__
+ LOG.info "another instance is starting"
+ exit
+ end
+
+ when :BarClick
+ clickedView, clickedButton = arg.split
+
+ case clickedButton.to_i
+ when PRIMARY_CLICK
+ Wmii.focus_view clickedView
+
+ when MIDDLE_CLICK
+ Wmii.selected_clients.each do |c|
+ c.tag! clickedView
+ end
+
+ when SECONDARY_CLICK
+ Wmii.selected_clients.each do |c|
+ c.untag! clickedView
+ end
+ end
+
+ when :ClientClick
+ clickedClient, clickedButton = arg.split
+
+ if clickedButton.to_i != PRIMARY_CLICK
+ Wmii.get_client(clickedClient).invert_selection!
+ end
+
+ when :Key
+ SHORTCUTS[arg].call
+ end
end
end
rescue EOFError