summaryrefslogtreecommitdiffstats
path: root/gtk/src/hb-backend.c
diff options
context:
space:
mode:
authorJohn Stebbins <[email protected]>2017-01-03 17:03:13 -0700
committerJohn Stebbins <[email protected]>2017-01-03 17:03:56 -0700
commitac5efd889aea96f72000fd6848000c7a6afeffc3 (patch)
treefef2e3e6d65f5963fe59998879fa67eb1cda9b0d /gtk/src/hb-backend.c
parent0d1fec639aee17804285fdf7e7d99f8e92769e6e (diff)
LinGui: fix use of gtk 3.22 deprecated functions
Diffstat (limited to 'gtk/src/hb-backend.c')
-rw-r--r--gtk/src/hb-backend.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gtk/src/hb-backend.c b/gtk/src/hb-backend.c
index fa6a8a6a2..eacc73cb5 100644
--- a/gtk/src/hb-backend.c
+++ b/gtk/src/hb-backend.c
@@ -4406,15 +4406,16 @@ ghb_get_preview_image(
{
gint factor = 80;
- GdkScreen *ss;
+ GdkWindow *window;
gint s_w, s_h;
- ss = gdk_screen_get_default();
- s_w = gdk_screen_get_width(ss);
- s_h = gdk_screen_get_height(ss);
+ window = gtk_widget_get_window(
+ GHB_WIDGET(ud->builder, "hb_window"));
+ ghb_monitor_get_size(window, &s_w, &s_h);
- if (previewWidth > s_w * factor / 100 ||
- previewHeight > s_h * factor / 100)
+ if (s_w > 0 && s_h > 0 &&
+ (previewWidth > s_w * factor / 100 ||
+ previewHeight > s_h * factor / 100))
{
GdkPixbuf *scaled_preview;
int orig_w = previewWidth;