xlib-objects 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5a7725013756732b19e1d6cad4a23e39db1db597
4
- data.tar.gz: fd41104e5db94a5f0e9e162e7addfb73cae71c66
3
+ metadata.gz: 5eb017deaa55c8438035b42871a46cb9dfd856cd
4
+ data.tar.gz: 3c23ed53041986d3a641a1f35ccdba3c3389681b
5
5
  SHA512:
6
- metadata.gz: 2192da1bfc5495095d66616f9800c63723df3a3041fa04dc2557583887469d3cb383de1242f55a90edd6db8f887b38f503dcd6bb6c57cffd35c72773381d3d1e
7
- data.tar.gz: 44300b382803c33c2cd5c3cfe2a51b5ec6c6b4eed1ac6a2eb4cddfe0755e88ca634c98ea32e106377bbc31999bb635169289d9ed1e40f098fda4d8d61801b5ea
6
+ metadata.gz: e26d982f5a19eb525934c138da6691961cb5969941336d754d6f61f36f7cf32658b34e33f79ab6efe869e0efebcb939155f0a76711c596d92afdc89a8a5481ce
7
+ data.tar.gz: fd667e34a14514c8b0effa9c36bd094148244ce1ee62d4d77a32f87cb4e6d95820f6deeb3294b724819ba72f6d8b61e85bf972b97fdefdbda5eac54cceea8074
data/lib/error.rb CHANGED
@@ -13,9 +13,11 @@ module XlibObj
13
13
  @error_code = error[:error_code]
14
14
  @request_code = error[:request_code]
15
15
  @minor_code = error[:minor_code]
16
- @resource = error[:resourceid]
16
+ @resourceid = error[:resourceid]
17
17
  end
18
18
 
19
+ attr_reader :error_code, :request_code, :minor_code, :resourceid
20
+
19
21
  def description
20
22
  "#{request_description}\n" <<
21
23
  "Error: #{error_description}\n" <<
@@ -53,7 +55,7 @@ module XlibObj
53
55
  end
54
56
 
55
57
  def resource_description
56
- @resource
58
+ @resourceid
57
59
  end
58
60
  end
59
61
  end
@@ -20,6 +20,7 @@ module XlibObj
20
20
 
21
21
  def handle
22
22
  window_id = event || parent || window || owner || requestor
23
+ puts "Core event: #{@extension.display.name} #{window_id} #{name}"
23
24
  Window.new(@extension.display, window_id).handle(self)
24
25
  end
25
26
 
@@ -41,9 +41,11 @@ module XlibObj
41
41
  end
42
42
 
43
43
  def handle(event)
44
- @event_handlers.each do |mask, handlers|
44
+ # duplicate the event handlers hash so it can be modified in one of
45
+ # its handlers
46
+ @event_handlers.dup.each do |mask, handlers|
45
47
  next unless handlers[event.name]
46
- handlers[event.name].each{ |handler| handler.call(event) }
48
+ handlers[event.name].dup.each{ |handler| handler.call(event) }
47
49
  end
48
50
  end
49
51
 
data/lib/xlib/xi.rb CHANGED
@@ -40,7 +40,9 @@ module Xlib
40
40
  def grab_device(display, device, window, time, cursor, mode, pair_mode, owner_events, event_mask)
41
41
  event_mask = EventMask.new(device, event_mask)
42
42
  0 == Xlib::XIGrabDevice(display.to_native, device.to_native, window.to_native, time, cursor,
43
- mode, pair_mode, owner_events, event_mask.to_native)
43
+ mode, pair_mode, owner_events, event_mask.to_native).tap do
44
+ Xlib::X.flush(display)
45
+ end
44
46
  end
45
47
 
46
48
  def ungrab_device(display, device, time)
@@ -50,6 +52,7 @@ module Xlib
50
52
  end
51
53
 
52
54
  def select_events(display, devices, window, event_mask)
55
+ puts "XISelectEvents: #{display.name} #{devices.map(&:id).inspect} #{window.to_native} #{event_mask.to_s(2)}"
53
56
  event_mask = EventMask.new(devices, event_mask)
54
57
  Xlib.XISelectEvents(display.to_native, window.to_native, event_mask.to_native, devices.size)
55
58
  Xlib::X.flush(display)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xlib-objects
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Aue
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-22 00:00:00.000000000 Z
11
+ date: 2016-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xlib