xlib-objects 0.7.3 → 0.7.4

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: d1314e972650608fddedf9aa13c41c30be55c989
4
- data.tar.gz: b0c7aa19611d27d5b3fc26d1da527b17185b8953
3
+ metadata.gz: 0b1e65a5824201ce6773108aeb130a603a908f72
4
+ data.tar.gz: 1cbf2a4b3cbd7536f9dd71608a5f0cc16300df10
5
5
  SHA512:
6
- metadata.gz: 6a87eec32e4d3cc447fa1aff04e6fbcccd04d3e0dc9a8b0ac55b0f3f97e60b12b336adb7d4937b003d0fa339f1abd152e502df679a14eb3c5399a36a80f3cae7
7
- data.tar.gz: 1da1684dc81d6d9679615e44dc9de7052109680e5548a49960c98eb81ab11004a779d3a484ec524e11540471a156e60ec5b65e68caf88f6c3269514439965bf6
6
+ metadata.gz: b98048ac8a11f1399fecf30a50ff33d168ade049faad21c3266f3d366418ba705b99792fdebb5b40ad4fee7e664da6e1d8ed6e6804db8e8d00e96e3a5c70a7fd
7
+ data.tar.gz: 585913f1f3bd4d5bdc0dd1b9a3d5a054e9a76228eac378f3bb5d8b9eea40421dbb03e4f7e94d6e9b6686a773b9d3ce1974c733a2e7d379ae906ca4ce94890833
@@ -22,7 +22,8 @@ module XlibObj
22
22
  @receiver = receiver
23
23
  Xlib.XSendEvent(@receiver.display.to_native, @receiver.to_native, false,
24
24
  Xlib::SubstructureNotifyMask | Xlib::SubstructureRedirectMask, to_native)
25
- @receiver.display.flush
25
+ ensure
26
+ Xlib::X.flush(@receiver.display)
26
27
  end
27
28
 
28
29
  private
@@ -15,7 +15,8 @@ module XlibObj
15
15
 
16
16
  def send_to(receiver)
17
17
  Xlib.XSendEvent(receiver.display.to_native, receiver.to_native, false, 0, event(receiver))
18
- receiver.display.flush
18
+ ensure
19
+ Xlib::X.flush(receiver.display)
19
20
  end
20
21
 
21
22
  private
@@ -69,7 +69,8 @@ module XlibObj
69
69
  @window.display.to_native, @window.to_native, @atom.to_native,
70
70
  Atom.new(@window.display, item_type).to_native, item_width,
71
71
  Xlib::PropModeReplace, bytes, item_count)
72
- @window.display.flush
72
+ Xlib::X.flush(@window.display)
73
+
73
74
  self
74
75
  end
75
76
 
data/lib/window.rb CHANGED
@@ -68,37 +68,37 @@ module XlibObj
68
68
 
69
69
  def move_resize(x, y, width, height)
70
70
  Xlib.XMoveResizeWindow(@display.to_native, @to_native, x, y, width, height)
71
- @display.flush
71
+ Xlib::X.flush(@display)
72
72
  self
73
73
  end
74
74
 
75
75
  def map
76
76
  Xlib.XMapWindow(@display.to_native, @to_native)
77
- @display.flush
77
+ Xlib::X.flush(@display)
78
78
  self
79
79
  end
80
80
 
81
81
  def unmap
82
82
  Xlib.XUnmapWindow(@display.to_native, @to_native)
83
- @display.flush
83
+ Xlib::X.flush(@display)
84
84
  self
85
85
  end
86
86
 
87
87
  def iconify
88
88
  Xlib.XIconifyWindow(@display.to_native, @to_native, screen.number)
89
- @display.flush
89
+ Xlib::X.flush(@display)
90
90
  self
91
91
  end
92
92
 
93
93
  def raise
94
94
  Xlib.XRaiseWindow(@display.to_native, @to_native)
95
- @display.flush
95
+ Xlib::X.flush(@display)
96
96
  self
97
97
  end
98
98
 
99
99
  def focus
100
100
  Xlib.XSetInputFocus(@display.to_native, @to_native, Xlib::RevertToParent, Xlib::CurrentTime)
101
- @display.flush
101
+ Xlib::X.flush(@display)
102
102
  self
103
103
  end
104
104
 
@@ -155,7 +155,7 @@ module XlibObj
155
155
  property_atom = Atom.new(@display, property)
156
156
  Xlib.XConvertSelection(@display.to_native, type_atom.to_native, target_atom.to_native,
157
157
  property_atom.to_native, @to_native, Xlib::CurrentTime)
158
- @display.flush
158
+ Xlib::X.flush(@display)
159
159
 
160
160
  self
161
161
  end
data/lib/xlib/xi.rb CHANGED
@@ -18,9 +18,9 @@ module Xlib
18
18
  end
19
19
 
20
20
  def set_focus(display, device, window, time)
21
- 0 == Xlib::XISetFocus(display.to_native, device.to_native, window.to_native, time).tap do
22
- Xlib::X.flush(display)
23
- end
21
+ 0 == Xlib::XISetFocus(display.to_native, device.to_native, window.to_native, time)
22
+ ensure
23
+ Xlib::X.flush(display)
24
24
  end
25
25
 
26
26
  def get_focus(display, device)
@@ -40,22 +40,23 @@ 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).tap do
44
- Xlib::X.flush(display)
45
- end
43
+ mode, pair_mode, owner_events, event_mask.to_native)
44
+ ensure
45
+ Xlib::X.flush(display)
46
46
  end
47
47
 
48
48
  def ungrab_device(display, device, time)
49
- 0 == Xlib::XIUngrabDevice(display.to_native, device.to_native, time).tap do
50
- Xlib::X.flush(display)
51
- end
49
+ 0 == Xlib::XIUngrabDevice(display.to_native, device.to_native, time)
50
+ ensure
51
+ Xlib::X.flush(display)
52
52
  end
53
53
 
54
54
  def select_events(display, devices, window, event_mask)
55
55
  event_mask = EventMask.new(devices, event_mask)
56
56
  Xlib.XISelectEvents(display.to_native, window.to_native, event_mask.to_native, devices.size)
57
- Xlib::X.flush(display)
58
57
  true
58
+ ensure
59
+ Xlib::X.flush(display)
59
60
  end
60
61
  end
61
62
  end
data/lib/xlib/xrr.rb CHANGED
@@ -3,6 +3,7 @@ module Xlib
3
3
  class << self
4
4
  def select_input(display, window, mask)
5
5
  Xlib.XRRSelectInput(display.to_native, window.to_native, mask)
6
+ ensure
6
7
  Xlib::X.flush(display)
7
8
  end
8
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xlib-objects
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Aue