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.
- checksums.yaml +4 -4
- data/lib/window.rb +4 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4658e68ce4cbae5cf14d45379d8866754d0b230a
|
4
|
+
data.tar.gz: 933215482798422789ccaf799af996960d2e8eed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
147
|
+
Window.new(@display, win_id)
|
146
148
|
end
|
147
149
|
|
148
150
|
def destroy
|