From 3ce49979b14b1a46ce4ffbc04436f39a32c28fb4 Mon Sep 17 00:00:00 2001 From: mazze Date: Sun, 1 Jul 2012 11:23:47 +0000 Subject: [PATCH] Call x11_fullscreen_supported(), otherwise the global variables "videomodes" and "num_videomodes" won't be initialized. Added null pointer check to x11_fullscreen_switchmode(). Isn't really necessary because of previous fix but it doesn't hurt. git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@45143 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- arch/all-hosted/hidd/x11/fullscreen.c | 13 ++++++++++++- arch/all-hosted/hidd/x11/fullscreen.h | 8 ++++++++ arch/all-hosted/hidd/x11/x11_init.c | 6 +++--- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/arch/all-hosted/hidd/x11/fullscreen.c b/arch/all-hosted/hidd/x11/fullscreen.c index 7b6b36ef73..6f76d3934b 100644 --- a/arch/all-hosted/hidd/x11/fullscreen.c +++ b/arch/all-hosted/hidd/x11/fullscreen.c @@ -1,3 +1,11 @@ +/* + Copyright © 1995-2012, The AROS Development Team. All rights reserved. + $Id$ + + Desc: Enable fullscreen mode. + Lang: English. +*/ + #include #include #include @@ -48,7 +56,10 @@ int x11_fullscreen_supported(Display *display) void x11_fullscreen_switchmode(Display *display, int *w, int *h) { int i, mode; - + + if (videomodes == NULL) + return; + for(i = 1, mode = 0; i < num_videomodes; i++) { if ((videomodes[i]->hdisplay >= *w) && diff --git a/arch/all-hosted/hidd/x11/fullscreen.h b/arch/all-hosted/hidd/x11/fullscreen.h index c1b0d40b74..26755d0b56 100644 --- a/arch/all-hosted/hidd/x11/fullscreen.h +++ b/arch/all-hosted/hidd/x11/fullscreen.h @@ -1,2 +1,10 @@ +/* + Copyright © 1995-2012, The AROS Development Team. All rights reserved. + $Id$ + + Desc: Enable fullscreen mode. + Lang: English. +*/ + int x11_fullscreen_supported(Display *display); void x11_fullscreen_switchmode(Display *display, int *w, int *h); diff --git a/arch/all-hosted/hidd/x11/x11_init.c b/arch/all-hosted/hidd/x11/x11_init.c index d7b8794776..d311d5eb7a 100644 --- a/arch/all-hosted/hidd/x11/x11_init.c +++ b/arch/all-hosted/hidd/x11/x11_init.c @@ -1,5 +1,5 @@ /* - Copyright © 1995-2010, The AROS Development Team. All rights reserved. + Copyright © 1995-2012, The AROS Development Team. All rights reserved. $Id$ Desc: X11 hidd initialization code. @@ -170,9 +170,9 @@ int X11_Init(struct x11_staticdata *xsd) /* do we have fullscreen flag ? */ if(!strcmp("--fullscreen", n->ln_Name)) { - /*xsd->fullscreen = x11_fullscreen_supported(xsd->display);*/ + xsd->fullscreen = x11_fullscreen_supported(xsd->display); /* Force fullscreen. */ - xsd->fullscreen = TRUE; + /* xsd->fullscreen = TRUE; */ } } } -- 2.11.4.GIT