Clean and quarter the mushrooms. (Dice if using portabello).
Heat 2 of the tablespoons of the butter with one tablespoon of the olive oil and sauté the mushrooms until golden. Remove from pan.
Heat the other spoonful of olive oil (more if needed) and sauté the onion until soft. Add the garlic for one minute.
Deglaze with the wine and reduce to about a tablespoon.
Add the stock, thyme leaves and the mushrooms, season with salt and pepper, cook until the stock has reduced by half.
Combine the flour with the last tablespoon of butter in a small dish and the stir it into the sauce. Cook until the liquid has thickened to a sauce, a matter of minutes. Stir in the parsley. Spoon the mixture into a gratin dish.
Potato Topping: Steam the potatoes in a covered saucepan with about an inch of water in the bottom, until very tender. Keep and eye on them or you will start to brown the bottom. This way of steaming the potatoes gives them a nice texture and flavour.
Mash the potatoes with the butter and milk until very smooth, adding more milk if needed.
Season with salt and pepper. Stir in the Gruyere cheese.
Spread over the mushroom mixture, smooth with the back of a spoon.