So as to try to give a mnemonic scheme for the purpose of assimilating the difference between the "passé composé" and the "imparfait" and so as to show all possibilities in a case illustrating simultaneity, I have devised a diagram representing the actions in time (shown below); however the whole set of correspondences between the actions is still something difficult to remember at first;
=======> time (time present is the tip of the arrow, >)
…______… action taking up time but not precisely determined in time as to its end or beginning except that it extends at least over the whole solid line
…------• action taking up time but not precisely determined in time as to its beginning except that it extends at least over the whole dashed line and ends at the dot
Pierre mangeait de la tarte quand Paul dessinait sa montagne.
========= …___________…=======> The end can't occur before the end below.
========= …___________…=======> The beginning can't occur before the beginning above
Pierre mangeait de la tarte quand Paul a dessiné sa montagne.
============ …_____…==========> The end can't occur before the end below.
============ …--------•===========> The beginning can't occur before the beginning above
Pierre a mangé de la tarte quand Paul dessinait sa montagne.
===========--------•==================> The end can occur before the end below.
=========…__________…============> The beginning can occur before the beginning above
Pierre a mangé de la tarte quand Paul a dessiné sa montagne.
============-------•…============> The end can occur before the end below.
==========…----------•=============> The beginning can occur before the beginning above
You do have here, then, a "recipe" for choosing when to use one tense or the other in the case of approximately simultaneous actions. It all depends on what context you want to impart into your reader's mind. It can be said that the choice of time allows to situate in time one action with respect to the other.
The English tenses which correspond are used in no different way and can be taken for reference (when well understood) so as to know what choice to make in French (when studying French as a second foreign language);
- Peter was eating tart when Paul was drawing his mountain.
- Peter was eating tart when Paul drew his mountain.
- Peter ate tart when Paul was drawing his mountain.
- Peter ate tart when Paul drew his mountain.
ADDITION Certain questions were raised by user Sharcoux and as what can be said about them is of enough interest I provide some answers here.
It must be said that not all combinations of verbs are possible in all four cases. One problem is the relative durations that can have the actions; for instance in the following the first sentence is valid but not the second: "La voiture allait vite quand elle a percuté l'arbre.", "La voiture est allé vite quand elle percutait l'arbre.".
1/ Concerning some doubt about the general validity of the distinction made between the 2nd and 3rd sentences -- The distinction made is that made for the following sentences: "Le temps était beau quand nous avons voyagé.", "Le temps a été beau quand nous avons voyagé.".
- first sentence: all the time of travelling, fair wheather _ all the time during the eating, drawing (not very judicious a context, it must be said)
- second sentence: at least for a while if not all the time or even in several occasions, fair wheather _ sporadic eating of tart (but nothing said as concerns the time after drawing stops)
2/ The following question might be asked as pertains the fourth sentence; couldn't Pierre have started eating after Paul' completing his drawing? I'd say no, that is not possible. In my opinion you would have to have a sentence written as follows in order to infer that;
Pierre a mangé de la tarte quand Paul eut dessiné sa montagne. or
Pierre a mangé de la tarte quand Paul a eu fini de dessiner sa montagne. or
"Quand" here refers to a time that is a "point" action (finir) and not as in the fourth sentence to a time that is a "period" action, that of drawing, and that does not extend beyond the end of drawing (of course).
Let's see how for instance the example "J'ai dormi quand j'ai eu sommeil." relates to that scheme of simultaneity. In this particular case "avoir sommeil" is a state that has to be taken as being of short duration; it is certain that you can go through a rather long period of time being sleepy and without sleep and so there is also that possibility of a long period of sleepiness, but here it is excluded since you slept: once you are asleep you are not sleepy anymore; in conclusion, one might even say that the utterance is not perfectly logical as what the person did really when taken over by sleepiness was not to sleep but to fall asleep. Nevertheless, such manner of expression could be tolerated; the two cases below are apparently of the same sort.
- Quand j'ai eu faim j'ai mangé. _ J'ai travaillé quand j'ai eu un besoin d'argent.
However this is not so, there exist quite a difference: hunger lasts all the time you eat and the need for money subsists while you work. In the end I would tend to consider such cases as proposed by user Sharcoux limit cases or marginal cases.