From a052140921fc0c9e70f7551b5aabdb92795c4c97 Mon Sep 17 00:00:00 2001 From: Thibault Jouan Date: Mon, 20 Apr 2015 10:18:11 +0000 Subject: [PATCH] Handle unmap_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 69307e1..ab09703 100644 --- a/lib/uh/wm/manager.rb +++ b/lib/uh/wm/manager.rb @@ -107,6 +107,10 @@ module Uh map event.window end + def handle_unmap_notify event + unmap event.window + end + def client_for window @clients.find { |e| e.window == window } end diff --git a/spec/uh/wm/manager_spec.rb b/spec/uh/wm/manager_spec.rb index 26298ba..3238b09 100644 --- a/spec/uh/wm/manager_spec.rb +++ b/spec/uh/wm/manager_spec.rb @@ -302,6 +302,15 @@ module Uh manager.handle event end end + + context 'when unmap_notify event is given' do + let(:event) { double 'event', type: :unmap_notify, window: :window } + + it 'unmap the event window' do + expect(manager).to receive(:unmap).with :window + manager.handle event + end + end end end end