00 is documented in HID++ 1.0 specification, it should be safe to set the 00
register. As another program may have written the notifications register
already and since enabling notifications has side-effects such as "disabling"
certaing functions, restore the flags after reading out available notifs.
Previously, the intent was likely to position the receiver window near the
status icon. It did so by calling move followed by present. According to the
Gtk documentation, move() may fail if the window is hidden before.
Therefore present the window *after* determining the position, but *before*
moving it. (presenting the window before getting the position gives a Gtk
warning and has unpredictable behavior wrt. the window position).
As window positioning is now enabled, add additional logic to prevent overlap
of windows: position the first window near the status icon and others on the
left. This is not idea, e.g. when the status icon is on the left side of the
screen, but the idea of positioning windows near to each other is broken anyway.
"Toggle" should mean "show or hide all windows", not "flip the visibility state
of windows". Case: one receiver window is open. When a new receiver is
connected, I also expect it to be open. Instead it is hidden, so I click the
icon. Now the new receiver window is shown, but the previous one is hidden.
Huh?! Indeed, let's fix that.
The problem is caused by starting Solaar right after installing it; while udev
does have the new rule loaded, the /dev/hidraw* device nodes already exist
with the old permissions.
Rather than doing a "udevadm --reload-rules" (which could have unknown side-
effects on other devices), instruct the user to remove and re-insert the usb
receiver. The new /dev/hidraw* device nods will be created with the right
permissions.
Generating "an unknown notification" type bailed out because of an unknown
feature type None. Since `isinstance(other, str)` is False for None, the script
will raise an exception on `isinstance(other, unicode)`.
There is no differentiation between `str` and `bytes` in Python 2, therefore
add another condition to `NamedInt.__eq__` to catch unknown types (like
`bytes`).