We’ll probably have to agree to disagree about Danzig; it was founded by Germans as a Hanseatic League port, While it had a substantial Polish minority and may have had Polish sovereignty from time to time, it was always ethnically and culturally a German city.
As for “keeping the peace” in Europe, the NATO/Warsaw Pact standoff, nuclear weapons and lingering memories of the horrors of WW2 had as much to do with the lasting peace as anything else. The French were once considered a martial people...until Verdun. The Germans were considered a martial people...until Stalingrad.
The 1945 Polish/German resettlement had much more to do with Stalin wanting to punish Germany, and push the Poles west to create more buffer space. He was not so concerned with creating “fair” ethnic boundaries. Not that it was unusual; Stalin’s regime was infamous for re-settlement of entire ethnic populations, such as the Volga Germans, Tatars, Kalmyks, Chechens, etc....
I should point out, however, that Breslau always had a large Polish minority, that were subject to anti-Polish riots in the 19th and early 20th century.
From Wikipedia:
Throughout its long history Gdansk faced various periods of rule from different states before 1945:
* 997-1308: as part of Poland
* 1308-1454: as part of territory of Teutonic Order
* 1454-1466: Thirteen Years’ War
* 1466-1793: as part of Poland
* 1793-1805: as part of Prussia
* 1807-1814: as a free city
* 1815-1871: as part of Prussia
* 1871-1918: as part of Imperial Germany
* 1918-1939: as a free city
* 1939-1945: as part of Nazi Germany