Clean and quarter the mushrooms. Heat just two tablespoons of the butter with one tablespoon of the olive oil and sauté the mushrooms until cooked and golden. Remove. Heat the other spoonful of olive oil (adding more if you need it) and sauté the onion until soft. Add the garlic for one minute. Deglaze with the wine and reduce to no more than a spoonful. Add the stock, the thyme, and the mushrooms, season with salt and pepper, and cook until the stock has reduced by half. Knead together the flour with the last tablespoon of butter and stir it in. Cook until the liquid has thickened to a sauce, a matter of minutes. Stir through the parsley.
Spoon the mixture into a gratin dish.
Steam the potatoes in a covered saucepan with about an inch-2.5-cm water in the bottom, until very tender. Mash with the butter and milk until very smooth, adding more milk if needed. Season with salt and pepper. Stir through the diced cheese. Distribute evenly over the mushroom mixture, and smooth with the back of the spoon (if you want to be very retro-housewife, make patterns with the tines of a fork or make waves with a spoon.) Sprinkle over the Parmesan.
Heat the oven to 425°F/220°C. Bake the gratin until bubbling hot and golden on top, about 15 minutes.