From dd572e4448e577852d2946b4944e260a278c5ef7 Mon Sep 17 00:00:00 2001
From: Chris Xiong <chirs241097@gmail.com>
Date: Mon, 8 Nov 2021 00:08:30 -0500
Subject: Fix weird crash caused by updating text of invisible labels.

---
 simple-visualization/qmpkeyboardwindow.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/simple-visualization/qmpkeyboardwindow.cpp b/simple-visualization/qmpkeyboardwindow.cpp
index b33bb4b..79e5fe3 100644
--- a/simple-visualization/qmpkeyboardwindow.cpp
+++ b/simple-visualization/qmpkeyboardwindow.cpp
@@ -29,6 +29,7 @@ qmpKeyboardWindow::qmpKeyboardWindow(qmpPluginAPI *_api, QWidget *parent):
     {
         const SEvent *e = (const SEvent *)ee;
         int ch = e->type & 0xF;
+        if (!this->isVisible()) return;
         if ((e->type & 0xF0) == 0x80 || ((e->type & 0xF0) == 0x90 && e->p2 == 0))
             emit keystateupdated(ch, e->p1, false);
         if ((e->type & 0xF0) == 0x90 && e->p2 > 0)
-- 
cgit v1.2.3