[Xfce4-commits] [xfce/xfce4-settings] 29/67: display: Fix crash when gdk_screen_height_mm() is 0

noreply at xfce.org noreply at xfce.org
Sat Sep 22 11:23:20 CEST 2018


This is an automated email from the git hooks/post-receive script.

o   c   h   o   s   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository xfce/xfce4-settings.

commit d0795ce961f0e4053eec12ab039cfe06a5426420
Author: Florian Schüller <florian.schueller at gmail.com>
Date:   Thu Aug 23 19:44:38 2018 +0200

    display: Fix crash when gdk_screen_height_mm() is 0
    
    This may happen with USB docking stations.
---
 dialogs/display-settings/xfce-randr.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/dialogs/display-settings/xfce-randr.c b/dialogs/display-settings/xfce-randr.c
index f423d9e..98ccb59 100644
--- a/dialogs/display-settings/xfce-randr.c
+++ b/dialogs/display-settings/xfce-randr.c
@@ -643,11 +643,13 @@ xfce_randr_preferred_mode (XfceRandr *randr,
 G_GNUC_BEGIN_IGNORE_DEPRECATIONS
         if (n < randr->priv->output_info[output]->npreferred)
             dist = 0;
-        else if (randr->priv->output_info[output]->mm_height != 0)
+        else if ((randr->priv->output_info[output]->mm_height != 0) &&
+                 (gdk_screen_height_mm() != 0))
+        {
             dist = (1000 * gdk_screen_height () / gdk_screen_height_mm () -
                 1000 * randr->priv->modes[output][n].height /
                     randr->priv->output_info[output]->mm_height);
-        else
+        } else
             dist = gdk_screen_height () - randr->priv->modes[output][n].height;
 G_GNUC_END_IGNORE_DEPRECATIONS
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list