aboutsummaryrefslogtreecommitdiff
path: root/hardinfo2/arch/common/display.h
diff options
context:
space:
mode:
authorLeandro A. F. Pereira <leandro@hardinfo.org>2006-11-19 19:38:31 +0000
committerLeandro A. F. Pereira <leandro@hardinfo.org>2006-11-19 19:38:31 +0000
commit5e7c1a3a03269b5088b26ecf9c676518d65a05e4 (patch)
treed4b9b5c0731a252954a897892633d1f7f6c8fbc4 /hardinfo2/arch/common/display.h
parent8708504c28caeee4bd3e95b6b6d739970863f19c (diff)
Run hardinfo with the '-r' command-line parameter and you'll get a report in standard output. :)
Diffstat (limited to 'hardinfo2/arch/common/display.h')
-rw-r--r--hardinfo2/arch/common/display.h10
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);