From fe51cc7c5d9c25b7e7bed91b27f17e8925b6d05d Mon Sep 17 00:00:00 2001 From: morg Date: Thu, 20 Jan 2022 13:26:15 +0100 Subject: [PATCH] Hide the led view to prevent a paint event on rescan #1871 --- qt/OpenRGBDialog2.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/qt/OpenRGBDialog2.cpp b/qt/OpenRGBDialog2.cpp index 5f54d930..e5e5b61b 100644 --- a/qt/OpenRGBDialog2.cpp +++ b/qt/OpenRGBDialog2.cpp @@ -1729,8 +1729,29 @@ void OpenRGBDialog2::SaveProfileAs() void Ui::OpenRGBDialog2::on_ButtonRescan_clicked() { + /*---------------------------------------------------------*\ + | Hide devices view on rescan so it stops handling paint | + | events. | + \*---------------------------------------------------------*/ + for(int device = 0; device < ui->DevicesTabBar->count(); device++) + { + OpenRGBDevicePage* device_page = qobject_cast(ui->DevicesTabBar->widget(device)); + if(device_page) // Check the cast to make sure it is a device and not plugin + { + device_page->HideDeviceView(); + } + } + + device_view_showing = false; + + /*---------------------------------------------------------*\ + | Show the detection progress bar. | + \*---------------------------------------------------------*/ SetDetectionViewState(true); + /*---------------------------------------------------------*\ + | Show the detection progress bar. | + \*---------------------------------------------------------*/ ResourceManager::get()->DetectDevices(); }