QGtk3Menu: take GTK's scale factor into account

GTK's scale factor, which can differ from Qt's scale factor, must
be taken into account in the native GTK menu positioning function
qt_gtk_menu_position_func().

Task-number: QTBUG-55251
Change-Id: I4ad460baab54facd25564ad85ded383c9321d597
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
bb10
J-P Nurmi 2018-02-05 14:16:44 +01:00
parent a924b4d58f
commit 9c2783c6c7
1 changed files with 3 additions and 0 deletions

View File

@ -411,6 +411,9 @@ static void qt_gtk_menu_position_func(GtkMenu *, gint *x, gint *y, gboolean *pus
{
QGtk3Menu *menu = static_cast<QGtk3Menu *>(data);
QPoint targetPos = menu->targetPos();
#if GTK_CHECK_VERSION(3, 10, 0)
targetPos /= gtk_widget_get_scale_factor(menu->handle());
#endif
*x = targetPos.x();
*y = targetPos.y();
*push_in = true;