How do I open all windows when clicking the icon in Ubuntu dock?

You can change the click-action on Ubuntu Dock icons. Open Terminal and run

gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'

Now if you click on an application icon with multiple open windows, it will switch between minimising and restoring all windows.


Run in terminal:

gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize-or-previews'

The whole action list is here