xlib-objects 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/window.rb +4 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 22f4f88902d97b0d31c2610f90bfa14b2378571a
4
- data.tar.gz: 0139801c5a443d34350d5ac3aeed21d87d58d3e4
3
+ metadata.gz: 4658e68ce4cbae5cf14d45379d8866754d0b230a
4
+ data.tar.gz: 933215482798422789ccaf799af996960d2e8eed
5
5
  SHA512:
6
- metadata.gz: a409bdbcfbd75f89e9fb0fe4ac8a3b2c72790d9dbb857a0a7f38dec73efe4b00309291b8005bfb31e30efa58e865ade4c4dd035b0262312631f8365906a8471e
7
- data.tar.gz: fcdabd70932efe480f6a8a18e98da2544de3bac50b52311ee8a706c35142df89082519d376da418c0e12af9d75e0733bbdea724c80be4caba26fb42a0fa522ed
6
+ metadata.gz: a303e9c96e74040b2d2a6a2731adcece55911d818046d093d22de2af2dfe7fc09bb10c09d769d0935971526e241b59185d6481ca8e125db3d46285db5b7a62cb
7
+ data.tar.gz: f6d1fadb43dc41a79f7a19b55c422e64d90fc935ae16316261d09c4eb2f28239ed0bc1ca8f8941f0a2175827cfdb6d00365bb7c7b7a8cda91440619b1a6f69b0
data/lib/window.rb CHANGED
@@ -119,6 +119,7 @@ module XlibObj
119
119
  # running this very code
120
120
  selection_handler = on(:no_event, :selection_notify) do |event|
121
121
  next if Atom.new(@display, event.selection).name != type
122
+ next if Atom.new(@display, event.target).name != format
122
123
 
123
124
  if event.property == Xlib::None
124
125
  selection = nil
@@ -126,7 +127,8 @@ module XlibObj
126
127
  selection = property(event.property)
127
128
  delete_property(event.property)
128
129
  end
129
- on_receive.call(selection, type)
130
+ selection_owner = Window.new(@display, Xlib.XGetSelectionOwner(@display, event.selection))
131
+ on_receive.call(selection, type, selection_owner)
130
132
  off(:no_event, :selection_notify, selection_handler)
131
133
  end
132
134
 
@@ -142,7 +144,7 @@ module XlibObj
142
144
  def create_window
143
145
  black = Xlib.XBlackPixel(@display.to_native, 0)
144
146
  win_id = Xlib.XCreateSimpleWindow(@display.to_native, to_native, 0, 0, 1, 1, 0, black, black)
145
- XlibObj::Window.new(@display, win_id)
147
+ Window.new(@display, win_id)
146
148
  end
147
149
 
148
150
  def destroy
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.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher Aue