From e97dcea87a7c2dcffae720fca1263f488d637d7e Mon Sep 17 00:00:00 2001 From: Thibault Jouan Date: Tue, 21 Apr 2015 02:21:12 +0000 Subject: [PATCH] Handle destroy_notify X events in manager --- lib/uh/wm/manager.rb | 4 ++++ spec/uh/wm/manager_spec.rb | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/lib/uh/wm/manager.rb b/lib/uh/wm/manager.rb index 1169c5e..ab830cd 100644 --- a/lib/uh/wm/manager.rb +++ b/lib/uh/wm/manager.rb @@ -109,6 +109,10 @@ module Uh configure event.window end + def handle_destroy_notify event + destroy event.window + end + def handle_map_request event map event.window end diff --git a/spec/uh/wm/manager_spec.rb b/spec/uh/wm/manager_spec.rb index 478ba39..b3180c8 100644 --- a/spec/uh/wm/manager_spec.rb +++ b/spec/uh/wm/manager_spec.rb @@ -323,6 +323,15 @@ module Uh end end + context 'when destroy_notify event is given' do + let(:event) { double 'event', type: :destroy_notify, window: :window } + + it 'destroy the event window' do + expect(manager).to receive(:destroy).with :window + manager.handle event + end + end + context 'when map_request event is given' do let(:event) { double 'event', type: :map_request, window: :window }