Re: [AD] Fwd: Allegro fullscreen under Xwindow

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Eric Botcazou wrote:
----------  Forwarded Message  ----------

We haven't been able to set fullscreen mode under Xwindows.
Function _xvidmode_private_set_fullscreen (called with parameters
800,600,0,0) failed, because every mode avaliable under our X-window
system has htotal and vtotal equal to zero

This makes me wonder why this was never caught before. Since X11 seems to always set vw/vh to 0, I can only guess that it was used only for DGA1. The attached patch should fix the problem. Since X11 never used the vw/vh params, I removed them from _xvidmode_private_set_fullscreen completely.

- Kitty Cat
Index: src/x/xwin.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/x/xwin.c,v
retrieving revision 1.70
diff -u -r1.70 xwin.c
--- src/x/xwin.c	6 Sep 2004 22:52:46 -0000	1.70
+++ src/x/xwin.c	13 Sep 2004 21:17:35 -0000
@@ -265,7 +265,7 @@
 static void _xwin_private_slow_palette_32(int sx, int sy, int sw, int sh);
 
 #ifdef ALLEGRO_XWINDOWS_WITH_XF86VIDMODE
-static int _xvidmode_private_set_fullscreen(int w, int h, int vw, int vh);
+static int _xvidmode_private_set_fullscreen(int w, int h);
 static void _xvidmode_private_unset_fullscreen(void);
 #endif
 
@@ -721,7 +721,7 @@
       int i;
 
       /* Switch video mode.  */
-      if (!_xvidmode_private_set_fullscreen(w, h, 0, 0)) {
+      if (!_xvidmode_private_set_fullscreen(w, h)) {
 	 ustrzcpy(allegro_error, ALLEGRO_ERROR_SIZE, get_config_text("Can not set video mode"));
 	 return 0;
       }
@@ -2963,7 +2963,7 @@
 /* _xvidmode_private_set_fullscreen:
  *  Attempt to switch video mode and make window fullscreen.
  */
-static int _xvidmode_private_set_fullscreen(int w, int h, int vw, int vh)
+static int _xvidmode_private_set_fullscreen(int w, int h)
 {
    int vid_event_base, vid_error_base;
    int vid_major_version, vid_minor_version;
@@ -2991,8 +2991,7 @@
    /* Search for a matching video mode.  */
    for (i = 0; i < _xwin.num_modes; i++) {
       mode = _xwin.modesinfo[i];
-      if ((mode->hdisplay == w) && (mode->vdisplay == h)
-	  && (mode->htotal > vw) && (mode->vtotal > vh)) {
+      if ((mode->hdisplay == w) && (mode->vdisplay == h)) {
 	 /* Switch video mode.  */
 	 if (!XF86VidModeSwitchToMode(_xwin.display, _xwin.screen, mode))
 	    return 0;


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/