diff options
author | ZenWalker <[email protected]> | 2017-08-19 18:29:56 +0200 |
---|---|---|
committer | ZenWalker <[email protected]> | 2017-08-19 18:29:56 +0200 |
commit | 1b565937c12415d96b41eaa020450b10c50aaade (patch) | |
tree | 8dd27df624340f424fbb10fdf5269a49749bec87 /capplets/appearance/appearance-desktop.c | |
parent | 987090c5615af43301317e6cdc24d9f12bac5716 (diff) | |
download | mate-control-center-1b565937c12415d96b41eaa020450b10c50aaade.tar.bz2 mate-control-center-1b565937c12415d96b41eaa020450b10c50aaade.tar.xz |
gtk 3.22: avoid deprecated gdk_screen_get_monitor... functions:
avoid deprecated:
gdk_screen_get_monitor_geometry
gdk_screen_get_monitor_at_window
Diffstat (limited to 'capplets/appearance/appearance-desktop.c')
-rw-r--r-- | capplets/appearance/appearance-desktop.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/capplets/appearance/appearance-desktop.c b/capplets/appearance/appearance-desktop.c index e13a54d9..ee5d1427 100644 --- a/capplets/appearance/appearance-desktop.c +++ b/capplets/appearance/appearance-desktop.c @@ -883,11 +883,20 @@ static gdouble get_monitor_aspect_ratio_for_widget (GtkWidget *widget) { gdouble aspect; +#if GTK_CHECK_VERSION (3, 22, 0) + GdkMonitor *monitor; +#else gint monitor; +#endif GdkRectangle rect; +#if GTK_CHECK_VERSION (3, 22, 0) + monitor = gdk_display_get_monitor_at_window (gtk_widget_get_display (widget), gtk_widget_get_window (widget)); + gdk_monitor_get_geometry (monitor, &rect); +#else monitor = gdk_screen_get_monitor_at_window (gtk_widget_get_screen (widget), gtk_widget_get_window (widget)); gdk_screen_get_monitor_geometry (gtk_widget_get_screen (widget), monitor, &rect); +#endif aspect = rect.height / (gdouble)rect.width; return aspect; |