Drawing and mouse in GTK HiDPI aware app (Xorg/Wayland)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Drawing and mouse in GTK HiDPI aware app (Xorg/Wayland)

Giovanni Panozzo

my GTK application draws some bitmaps on a GtkDrawingArea, and receives
mouse position events from the same widget (or its container widget).
The application is running in a 2x HiDPI scaled desktop, so when the
GtkDrawingArea has a logical size of WxH pixel, it's really taking
2*Wx2*H pixels on the physical screen.

In this situation I can see that both cairo_*() coordinates and
GtkEventMotion/GtkEventButton mouse events for the widgets are all
scaled 2x, so I can have compatibility with unscaled displays. Good.

But now I would like to make my application HiDPI aware and take full
advantage of real screen resolution:
I'm unable to find a simple way/example to totally disable scaling for
both cairo_*() and and mouse position events, only for my widget
(GtkDrawingArea or GtkWidget).

Is it possible to disable HiDPI scaling? Or I'm taking the wrong approach?

Thank you

gtk-app-devel-list mailing list
[hidden email]