Repository: pwr-Solaar/Solaar

Issue:
Mice connected via wire do not need Wireless link indicator
**Information**
The mouse connected via wire has Wireless Link indicator. See screenshot. 

![obrazek](https://user-images.githubusercontent.com/1659215/218970379-02321f1f-bea0-4cbc-aa37-cd06637c10cf.png)

Since they are connected via wire, Wireless Link is not used.

It should be corrected.


Discussion:

Resolving patch:
diff --git a/lib/logitech_receiver/descriptors.py b/lib/logitech_receiver/descriptors.py
--- a/lib/logitech_receiver/descriptors.py
+++ b/lib/logitech_receiver/descriptors.py
@@ -284,6 +284,8 @@ class _PerformanceMXDpi(_ST.RegisterDpi):
 
 _D('G9 Laser Mouse', codename='G9', usbid=0xc048, interface=1, protocol=1.0,
     settings=[_PerformanceMXDpi, _ST.RegisterSmoothScroll, _ST.RegisterSideScroll])
+_D('G9x Laser Mouse', codename='G9x', usbid=0xc066, interface=1, protocol=1.0,
+    settings=[_PerformanceMXDpi, _ST.RegisterSmoothScroll, _ST.RegisterSideScroll])
 _D('G502 Gaming Mouse', codename='G502', usbid=0xc07d, interface=1)
 _D('G402 Gaming Mouse', codename='G402', usbid=0xc07e, interface=1)
 _D('G900 Chaos Spectrum Gaming Mouse', codename='G900', usbid=0xc081)
diff --git a/lib/logitech_receiver/status.py b/lib/logitech_receiver/status.py
--- a/lib/logitech_receiver/status.py
+++ b/lib/logitech_receiver/status.py
@@ -293,13 +293,14 @@ def changed(self, active=None, alert=ALERT.NONE, reason=None, push=False, timest
                     _settings.apply_all_settings(d)
 
             else:
-                if was_active:
-                    battery = self.get(KEYS.BATTERY_LEVEL)
-                    self.clear()
-                    # If we had a known battery level before, assume it's not going
-                    # to change much while the device is offline.
-                    if battery is not None:
-                        self[KEYS.BATTERY_LEVEL] = battery
+                if was_active:  # don't clear status when devices go inactive
+                    ##                    battery = self.get(KEYS.BATTERY_LEVEL)
+                    ##                    self.clear()
+                    ## # If we had a known battery level before, assume it's not going
+                    ## # to change much while the device is offline.
+                    ## if battery is not None:
+                    ##     self[KEYS.BATTERY_LEVEL] = battery
+                    pass
 
         # A device that is not active on the first status notification
         # but becomes active afterwards does not produce a pop-up notification
diff --git a/lib/solaar/ui/window.py b/lib/solaar/ui/window.py
--- a/lib/solaar/ui/window.py
+++ b/lib/solaar/ui/window.py
@@ -141,7 +141,7 @@ def _status_line(label_text):
     p._lux = _status_line(_('Lighting'))
     p.pack_start(p._lux, False, False, 0)
 
-    p.pack_start(Gtk.Separator.new(Gtk.Orientation.HORIZONTAL), False, False, 0)  # spacer
+    #    p.pack_start(Gtk.Separator.new(Gtk.Orientation.HORIZONTAL), False, False, 0)  # spacer
 
     p._config = _config_panel.create()
     p.pack_end(p._config, True, True, 4)
@@ -683,14 +683,9 @@ def _update_device_panel(device, panel, buttons, full=False):
     battery_level = device.status.get(_K.BATTERY_LEVEL)
     battery_voltage = device.status.get(_K.BATTERY_VOLTAGE)
     if battery_level is None and battery_voltage is None:
-        icon_name = _icons.battery()
-        panel._battery._icon.set_from_icon_name(icon_name, _INFO_ICON_SIZE)
-        panel._battery._icon.set_sensitive(False)
-        panel._battery._text.set_sensitive(is_online)
-        panel._battery._label.set_text(_('Battery'))
-        panel._battery._text.set_markup('<small>%s</small>' % _('unknown'))
-        panel._battery.set_tooltip_text(_('Battery information unknown.'))
+        panel._battery.set_visible(False)
     else:
+        panel._battery.set_visible(True)
         battery_next_level = device.status.get(_K.BATTERY_NEXT_LEVEL)
         charging = device.status.get(_K.BATTERY_CHARGING)
         icon_name = _icons.battery(battery_level, charging)
@@ -725,9 +720,16 @@ def _update_device_panel(device, panel, buttons, full=False):
         panel._battery._text.set_markup(text)
         panel._battery.set_tooltip_text(tooltip_text)
 
-    if is_online:
-        not_secure = device.status.get(_K.LINK_ENCRYPTED) is False
-        if not_secure:
+    if device.status.get(_K.LINK_ENCRYPTED) is None:
+        panel._secure.set_visible(False)
+    elif is_online:
+        panel._secure.set_visible(True)
+        panel._secure._icon.set_visible(True)
+        if device.status.get(_K.LINK_ENCRYPTED) is True:
+            panel._secure._text.set_text(_('encrypted'))
+            panel._secure._icon.set_from_icon_name('security-high', _INFO_ICON_SIZE)
+            panel._secure.set_tooltip_text(_('The wireless link between this device and its receiver is encrypted.'))
+        else:
             panel._secure._text.set_text(_('not encrypted'))
             panel._secure._icon.set_from_icon_name('security-low', _INFO_ICON_SIZE)
             panel._secure.set_tooltip_text(
@@ -736,14 +738,10 @@ def _update_device_panel(device, panel, buttons, full=False):
                     'This is a security issue for pointing devices, and a major security issue for text-input devices.'
                 )
             )
-        else:
-            panel._secure._text.set_text(_('encrypted'))
-            panel._secure._icon.set_from_icon_name('security-high', _INFO_ICON_SIZE)
-            panel._secure.set_tooltip_text(_('The wireless link between this device and its receiver is encrypted.'))
-        panel._secure._icon.set_visible(True)
     else:
-        panel._secure._text.set_markup('<small>%s</small>' % _('offline'))
+        panel._secure.set_visible(True)
         panel._secure._icon.set_visible(False)
+        panel._secure._text.set_markup('<small>%s</small>' % _('offline'))
         panel._secure.set_tooltip_text('')
 
     if is_online:


Test patch: