HAMBURG, Germany — Over her 11 years in power, Chancellor Angela Merkel of Germany has proved uncommonly adept at solving the puzzle-box challenges posed by the world’s most unpredictable leaders. But she has never met a problem like Donald J. Trump.

Mr. Trump and Ms. Merkel — estranged by widely diverging temperaments, worldviews, leadership styles and visions of Europe — had a breakthrough of sorts just before their brief meeting on the eve of the Group of 20 conference in Hamburg on Thursday night. They got the handshake right.

The 40-minute meeting that followed was mostly uneventful, touching only lightly on the hot-button topics of climate change, trade and “burning foreign policy questions” on North Korea, Ukraine and the Middle East, according to a brief statement from Ms. Merkel’s government.

People close to these two most powerful Western leaders say the brevity and bonhomie were, in fact, the main goal. Both sides are hoping for a series of low-octane interactions in which the two articulate their differences without the awkward optics of previous meetings.