Skip to content

GDK W32: Ensure correct stacking of popup windows (GTK4)

LRN requested to merge lrn/gtk:restack-gtk4 into master
  1. In the SetWindowPos() function (and the WINDOWPOS struct) the "hWndInsertAfter" argument/field means the window that will be directly above after the change, not the window that will be directly below. MSDN says "precedes" for SetWindowPos(), but WINDOWPOS documentation is more precise: this is the window behind which the affected window will be placed. Apparently, Z-axis goes back-to-front. Therefore, logging should be reworded correctly.

  2. When we switch away from the application and then switch back to a transient window, we need to bring up its transient-owner (and its transient-owner's owner and so forth) as well, otherwise our transient (modal) window might be transient for something that might not be visible.

  3. When we bring up a window, we should bring all of its children (popup windows) on top of it. Because Windows doesn't provide a function to bring one window on top of the other, we have to work around this by calling SetWindowPos() twice, swapping the windows between the calls.

Merge request reports