Skip to content

Fix long combo box positioning

Jonas Ådahl requested to merge jadahl/gtk:wip/long-combo-boxes into gtk-3-24

This branch fixes combo box mapping under Wayland if the combo box was extremely long and the selected item was far down.

It works by inhibiting the "clamp to work area" logic in GtkWindow for popup menus that are expected to be size-constrained by the gdk_window_move_to_rect() mechanisms. If we don't inhibit the clamping, the offset set by e.g. GtkComboBox are incorrect, as they are based on the pre-clamped size, and can't be made correct as the clamping is done during the showing of the popup window.

Thus, this makes clamping completely rely on the gdk_window_move_to_rect() implementation to do the appropriate clamping. This means that compositors (e.g. weston currently) that doesn't implement xdg_positioner clamping might get very long combo boxes. Prior to this, however, they might have failed to map them completely, given that the positioner metadata passed by gtk was invalid.

This is completely untested on any backend other than X11 and Wayland.

Merge request reports