Try not to re-position the menu needlessly
authorRoy Marples <roy@marples.name>
Thu, 4 Dec 2014 14:07:20 +0000 (14:07 +0000)
committerRoy Marples <roy@marples.name>
Thu, 4 Dec 2014 14:07:20 +0000 (14:07 +0000)
src/dhcpcd-qt/dhcpcd-qt.cpp
src/dhcpcd-qt/dhcpcd-wi.cpp

index 92c714576e6ee9ab30980f7af626a3b8c58019e9..f1589c4fdabe93578e7225374bf2db75f0610c7b 100644 (file)
@@ -387,8 +387,7 @@ void DhcpcdQt::processScans(DhcpcdWi *wi, DHCPCD_WI_SCAN *scans)
            (ssidMenu == NULL || !ssidMenu->isVisible()))
                notify(title, txt);
 
-       wi->setScans(scans);
-       if (ssidMenu && ssidMenu->isVisible())
+       if (wi->setScans(scans) && ssidMenu && ssidMenu->isVisible())
                ssidMenu->popup(ssidMenuPos);
 }
 
index b4c32f8a8c182c7b01da0a18b1105e7b7c2141ae..979bebea92617792ba14671f20f84cc6fe80adf4 100644 (file)
@@ -171,7 +171,7 @@ bool DhcpcdWi::setScans(DHCPCD_WI_SCAN *scans)
        dhcpcd_wi_scans_free(this->scans);
        this->scans = scans;
 
-       return changed;
+       return (changed && menu && menu->isVisible());
 }
 
 void DhcpcdWi::createMenuItem(QMenu *menu, DHCPCD_WI_SCAN *scan,