Skip to content
Snippets Groups Projects
Commit 9c2783c6 authored by J-P Nurmi's avatar J-P Nurmi
Browse files

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: default avatarFriedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: default avatarDmitry Shachnev <mitya57@gmail.com>
Reviewed-by: default avatarMorten Johan Sørvig <morten.sorvig@qt.io>
parent a924b4d5
No related merge requests found
...@@ -411,6 +411,9 @@ static void qt_gtk_menu_position_func(GtkMenu *, gint *x, gint *y, gboolean *pus ...@@ -411,6 +411,9 @@ static void qt_gtk_menu_position_func(GtkMenu *, gint *x, gint *y, gboolean *pus
{ {
QGtk3Menu *menu = static_cast<QGtk3Menu *>(data); QGtk3Menu *menu = static_cast<QGtk3Menu *>(data);
QPoint targetPos = menu->targetPos(); QPoint targetPos = menu->targetPos();
#if GTK_CHECK_VERSION(3, 10, 0)
targetPos /= gtk_widget_get_scale_factor(menu->handle());
#endif
*x = targetPos.x(); *x = targetPos.x();
*y = targetPos.y(); *y = targetPos.y();
*push_in = true; *push_in = true;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment