Toggle fix minimized and multi-id windows

When a program had multiple windows, the search command return a list of
Id's, and `windowactivate` will not work, and for is added to execute
the command multiple times, the not principal id's will throw a error
that will be omitted.