diff options
Diffstat (limited to 'hardinfo2/arch/common/display.h')
-rw-r--r-- | hardinfo2/arch/common/display.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/hardinfo2/arch/common/display.h b/hardinfo2/arch/common/display.h index 6731e3e3..b28d34cc 100644 --- a/hardinfo2/arch/common/display.h +++ b/hardinfo2/arch/common/display.h @@ -126,9 +126,13 @@ computer_get_display(void) DisplayInfo *di = g_new0(DisplayInfo, 1); GdkScreen *screen = gdk_screen_get_default(); - - di->width = gdk_screen_get_width(screen); - di->height = gdk_screen_get_height(screen); + + if (screen) { + di->width = gdk_screen_get_width(screen); + di->height = gdk_screen_get_height(screen); + } else { + di->width = di->height = 0; + } get_glx_info(di); get_x11_info(di); |