France was technically surrounded by powerful entities as well - it's luck being geography (the Channel protecting from the English, the Pyrenees protecting from the Muslims/the Spanish) and the disunity of both North Italy and the HRE. Poland had much less geographic protection (The Dnyepr in the East, the Baltic in the North, the Carpathians in the South) and faced unified empires - Turkey, Sweden, eventually Russia. So the best way to go would be to reverse the situation - have North Italy and at least the western HRE united, while keeping Ruthenia, eastern HRE and Scandinavia disunited.
Let's say that the muslims turn their attention in the Middle Ages from the Balkans to Iberia to fight the Reconquista. Reconquista fails, Iberia is ruled by the Muslims who possibly try to claim territory on the lowlands north of the Pyrenees. Invasions of the Apenninean Penisula lead to North Italy emerging as a somewhat united entity in the XV-XVI century. The hundred year wars sees both the Muslims and Italians and Germans launching opportunistic raids on France - essentially leading to central power in France being weaker than OTL, and the french realm reduced territorially.
In the meantime, without the Muslims invading the Balkans, Hungary preserves it's status as a Great Power, preventing the rise of the Habsburgs. With the HRE being more involved in the west, the Ordenstaat is weaker (less knights/settlers move to Prussia) and without the Emperors support, falls to Poland. Poland's broader access to sea allow it to claim all of Livonia earlier, denying Sweden territory south of the Gulf of Finland. A stable Polish - Danish alliance might keep Sweden-Finland in check, while allowing Poland to develop a more "westernized economy" - thanks to free passage through the danish straits and more seaports under it's direct control. Thus by the XVI century Poland's western, southern and northern flanks are secure, it's foreign policy mostly concerning preventing any one power claiming all of Ruthenia, the PLC being the greatest power in central Europe.