Date: Thu, 4 Dec 2003 07:48:40 +0200
authorSam Lantinga <slouken@libsdl.org>
Wed, 10 Dec 2003 12:35:56 +0000
changeset 753b14fdadd8311
parent 752 4bb432a0f6e0
child 754 623b453a3219
Date: Thu, 4 Dec 2003 07:48:40 +0200
From: "Mike Gorchak"
Subject: SDL/QNX6 new patch

Here in attachment my patch for the SDL/QNX6 again :) It contain non-crtitical/cosmetic fixes:

1. Fixed window centering at other than the first consoles.
2. Fixed window centering algorithm in case when window height or width are greater than the desktop resolution.
3. Fixed window positioning on other than the first consoles.
4. Fixed occasional input focus lost when switching to fullscreen.
5. Removed the Photon's default chroma color for the overlays, added RGB(12, 6, 12) color instead (very dark pink).
6. Added more checks to the YUV overlay code (fixed crashes during resolution mode switches).
7. Added support for Enter/Backspace keys in unicode mode (used by Maelstrom and by other games).
8. Fixed window restore/maximize function. It works, finally.
README.QNX
SDL.qpg.in
configure.in
src/video/photon/SDL_ph_events.c
src/video/photon/SDL_ph_video.c
src/video/photon/SDL_ph_video.h
src/video/photon/SDL_ph_wm.c
src/video/photon/SDL_phyuv.c
test/testoverlay2.c
test/testsprite.c
     1.1 --- a/README.QNX	Wed Dec 10 12:32:38 2003 +0000
     1.2 +++ b/README.QNX	Wed Dec 10 12:35:56 2003 +0000
     1.3 @@ -1,5 +1,16 @@
     1.4  README by Mike Gorchak <mike@malva.ua>, <lestat@i.com.ua>
     1.5 -Last changed at 12 Aug 2003.
     1.6 +Last changed at 30 Sep 2003.
     1.7 +
     1.8 +======================================================================
     1.9 +Table of Contents:
    1.10 +
    1.11 +1. OpenGL.
    1.12 +2. Wheel and multi-button mouses.
    1.13 +3. CDROM handling issues.
    1.14 +4. Hardware video overlays.
    1.15 +5. Shared library building.
    1.16 +6. Some building issues.
    1.17 +7. Environment variables.
    1.18  
    1.19  ======================================================================
    1.20  OpenGL:
    1.21 @@ -14,7 +25,7 @@
    1.22  cially selected (QSSL made acceleration  only  for  Voodoo  boards  in
    1.23  fullscreen mode, sorry but I don't have this board  to  test  OpenGL -
    1.24  maybe it works or maybe not :)). If you  want  acceleration - you  can
    1.25 -remove one line in the source code: find the  file SDL_ph_video.c  and
    1.26 +remove one line in the source code: find the  file SDL_ph_image.c  and
    1.27  remove the following
    1.28  
    1.29      OGLAttrib[OGLargc++]=PHOGL_ATTRIB_FORCE_SW;
    1.30 @@ -50,7 +61,7 @@
    1.31  root:root rights.
    1.32  
    1.33  ======================================================================
    1.34 -Video Overlays:
    1.35 +Hardware video overlays:
    1.36  
    1.37      Overlays can flicker  during  window  movement,  resizing, etc. It
    1.38  happens because the photon driver updates the real window contents be-
    1.39 @@ -77,8 +88,11 @@
    1.40  script you must manually delete the libtool.m4 stuff from the acinclu-
    1.41  de.m4 file (it comes after the ESD detection code up to the end of the
    1.42  file), because the libtool stuff in the acinclude.m4 file is very  old
    1.43 -and  doesn't  know  anything  about  QNX. Just   remove  it, then  run
    1.44 -"libtoolize --force --copy" and after that run the autogen.sh script.
    1.45 +in SDL distribution before the version 1.2.7 and doesn't know anything
    1.46 +about QNX. SDL 1.2.7 distribution contain  the  new libtool.m4 script,
    1.47 +but anyway  it  is  broken :), Just  remove  it, then  run "libtoolize
    1.48 +--force --copy",  delete the file aclocal.m4 and after  that  run  the
    1.49 +autogen.sh script.
    1.50  
    1.51  ======================================================================
    1.52  Some building issues:
    1.53 @@ -107,3 +121,24 @@
    1.54      ./configure  --with-sdl-prefix=/usr            \
    1.55                   --with-sdl-exec-prefix=/usr       \
    1.56                   --prefix=/usr --without-x
    1.57 +
    1.58 +======================================================================
    1.59 +Environment variables:
    1.60 +
    1.61 +    Please note that the photon driver  is  sensible to the  following
    1.62 +environmental variables:
    1.63 +
    1.64 + * SDL_VIDEO_WINDOW_POS - can be  set in the "X,Y" format.  If X and Y
    1.65 +coordinates are bigger than the current desktop resolution, then  win-
    1.66 +dow positioning across  virtual  consoles is activated. If X and Y are
    1.67 +smaller than the desktop resolution  then  window  positioning  in the
    1.68 +current console is activated. The word "center" can be used instead of
    1.69 +coordinates, it  produces  the  same  behavior  as  SDL_VIDEO_CENTERED
    1.70 +environmental variable.
    1.71 +
    1.72 + * SDL_VIDEO_CENTERED - if this environmental variable exists then the
    1.73 +window centering is perfomed in the current virtual console.
    1.74 +
    1.75 +    The SDL_VIDEO_CENTERED enviromental variable has greater  priority
    1.76 +than the SDL_VIDEO_WINDOW_POS in case if both variables  are  supplied
    1.77 +to the application.
     2.1 --- a/SDL.qpg.in	Wed Dec 10 12:32:38 2003 +0000
     2.2 +++ b/SDL.qpg.in	Wed Dec 10 12:35:56 2003 +0000
     2.3 @@ -62,7 +62,7 @@
     2.4              </QPM:PackageDescription>
     2.5  
     2.6              <QPM:ProductDescription>
     2.7 -               <QPM:ProductName>SDL</QPM:ProductName>
     2.8 +               <QPM:ProductName>Simple DirectMedia Layer (SDL)</QPM:ProductName>
     2.9                 <QPM:ProductIdentifier>SDL</QPM:ProductIdentifier>
    2.10                 <QPM:ProductEmail>slouken@libsdl.org</QPM:ProductEmail>
    2.11                 <QPM:VendorName>public</QPM:VendorName>
    2.12 @@ -95,10 +95,11 @@
    2.13  
    2.14              <QPM:ContentDescription>
    2.15                 <QPM:ContentTopic xmlmultiple="true">Software Development/Libraries and Extensions/C Libraries</QPM:ContentTopic>
    2.16 -               <QPM:ContentKeyword>SDL, audio, graphics, demos, games, emulators, media, layer</QPM:ContentKeyword>
    2.17 +               <QPM:ContentKeyword>SDL, audio, graphics, demos, games, emulators, direct, media, layer</QPM:ContentKeyword>
    2.18                 <QPM:TargetOS>qnx6</QPM:TargetOS>
    2.19                 <QPM:HostOS>none</QPM:HostOS>
    2.20                 <QPM:DisplayEnvironment xmlmultiple="true">Photon</QPM:DisplayEnvironment>
    2.21 +               <QPM:DisplayEnvironment xmlmultiple="true">Console</QPM:DisplayEnvironment>
    2.22                 <QPM:TargetAudience xmlmultiple="true">Developer</QPM:TargetAudience>
    2.23                 <QPM:TargetAudience xmlmultiple="true">User</QPM:TargetAudience>
    2.24              </QPM:ContentDescription>
     3.1 --- a/configure.in	Wed Dec 10 12:32:38 2003 +0000
     3.2 +++ b/configure.in	Wed Dec 10 12:35:56 2003 +0000
     3.3 @@ -1582,7 +1582,9 @@
     3.4  
     3.5          if test x$use_dlopen = xyes; then
     3.6              CFLAGS="$CFLAGS -DUSE_DLOPEN"
     3.7 -            AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl", AC_CHECK_LIB(ltdl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -lltdl"))
     3.8 +            AC_CHECK_LIB(c, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS",
     3.9 +               AC_CHECK_LIB(dl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -ldl",
    3.10 +                  AC_CHECK_LIB(ltdl, dlopen, SYSTEM_LIBS="$SYSTEM_LIBS -lltdl")))
    3.11          fi
    3.12      fi
    3.13  }
     4.1 --- a/src/video/photon/SDL_ph_events.c	Wed Dec 10 12:32:38 2003 +0000
     4.2 +++ b/src/video/photon/SDL_ph_events.c	Wed Dec 10 12:35:56 2003 +0000
     4.3 @@ -217,12 +217,12 @@
     4.4                  set_motion_sensitivity(this, -1);
     4.5                  posted = SDL_PrivateAppActive(1, SDL_APPINPUTFOCUS);
     4.6              }
     4.7 -            /* request to quit */
     4.8 +            /* quit request */
     4.9              else if (winEvent->event_f==Ph_WM_CLOSE)
    4.10              {
    4.11                  posted = SDL_PrivateQuit();
    4.12              }
    4.13 -            /* request to hide/unhide */
    4.14 +            /* hide/unhide request */
    4.15              else if (winEvent->event_f==Ph_WM_HIDE)
    4.16              {
    4.17                  if (currently_hided)
    4.18 @@ -241,7 +241,7 @@
    4.19              /* request to resize */
    4.20              else if (winEvent->event_f==Ph_WM_RESIZE)
    4.21              {
    4.22 -                SDL_PrivateResize(winEvent->size.w, winEvent->size.h);
    4.23 +                SDL_PrivateResize(winEvent->size.w+1, winEvent->size.h+1);
    4.24              }
    4.25              /* request to move */
    4.26              else if (winEvent->event_f==Ph_WM_MOVE)
    4.27 @@ -250,6 +250,7 @@
    4.28                  {
    4.29                     int lockedstate=current_overlay->hwdata->locked;
    4.30                     int chromastate=current_overlay->hwdata->ischromakey;
    4.31 +                   int error;
    4.32                     SDL_Rect target;
    4.33  
    4.34                     current_overlay->hwdata->locked=1;
    4.35 @@ -258,20 +259,25 @@
    4.36                     target.w=current_overlay->hwdata->CurrentViewPort.size.w;
    4.37                     target.h=current_overlay->hwdata->CurrentViewPort.size.h;
    4.38                     current_overlay->hwdata->ischromakey=0;
    4.39 -                   ph_DisplayYUVOverlay(this, current_overlay, &target);
    4.40 -                   current_overlay->hwdata->ischromakey=chromastate;
    4.41 -                   current_overlay->hwdata->locked=lockedstate;
    4.42 +                   error=ph_DisplayYUVOverlay(this, current_overlay, &target);
    4.43 +                   if (!error)
    4.44 +                   {
    4.45 +                       current_overlay->hwdata->ischromakey=chromastate;
    4.46 +                       current_overlay->hwdata->locked=lockedstate;
    4.47 +                   }
    4.48                  }
    4.49              }
    4.50 -            /* request to maximize */
    4.51 +            /* maximize request */
    4.52              else if (winEvent->event_f==Ph_WM_MAX)
    4.53              {
    4.54                  /* window already moved and resized here */
    4.55 -                SDL_PrivateResize(winEvent->size.w-winEvent->pos.x, winEvent->size.h-winEvent->pos.y);
    4.56 +                currently_maximized=1;
    4.57              }
    4.58 -            /* request to restore */
    4.59 +            /* restore request */
    4.60              else if (winEvent->event_f==Ph_WM_RESTORE)
    4.61              {
    4.62 +                /* window already moved and resized here */
    4.63 +                currently_maximized=0;
    4.64              }
    4.65          }
    4.66          break;
    4.67 @@ -285,7 +291,7 @@
    4.68                  {
    4.69                      rect = PhGetRects(event);
    4.70  
    4.71 -                    for(i=0;i<event->num_rects;i++)
    4.72 +                    for(i=0; i<event->num_rects; i++)
    4.73                      {
    4.74                          sdlrects[i].x = rect[i].ul.x;
    4.75                          sdlrects[i].y = rect[i].ul.y;
    4.76 @@ -298,6 +304,7 @@
    4.77                      if (current_overlay!=NULL)
    4.78                      {
    4.79                          int lockedstate=current_overlay->hwdata->locked;
    4.80 +                        int error;
    4.81                          SDL_Rect target;
    4.82  
    4.83                          current_overlay->hwdata->locked=1;
    4.84 @@ -306,9 +313,12 @@
    4.85                          target.w=current_overlay->hwdata->CurrentViewPort.size.w;
    4.86                          target.h=current_overlay->hwdata->CurrentViewPort.size.h;
    4.87                          current_overlay->hwdata->forcedredraw=1;
    4.88 -                        ph_DisplayYUVOverlay(this, current_overlay, &target);
    4.89 -                        current_overlay->hwdata->forcedredraw=0;
    4.90 -                        current_overlay->hwdata->locked=lockedstate;
    4.91 +                        error=ph_DisplayYUVOverlay(this, current_overlay, &target);
    4.92 +                        if (!error)
    4.93 +                        {
    4.94 +                            current_overlay->hwdata->forcedredraw=0;
    4.95 +                            current_overlay->hwdata->locked=lockedstate;
    4.96 +                        }
    4.97                      }
    4.98                  }
    4.99              }
   4.100 @@ -355,6 +365,11 @@
   4.101              }
   4.102          }
   4.103          break;
   4.104 +        
   4.105 +        case Ph_EV_INFO:
   4.106 +        {
   4.107 +        }
   4.108 +        break;
   4.109      }
   4.110  
   4.111      return(posted);
   4.112 @@ -542,13 +557,20 @@
   4.113  
   4.114          switch (keysym->scancode)
   4.115          {
   4.116 +           /* Esc key */
   4.117             case 0x01: keysym->unicode = 27;
   4.118                        break;
   4.119 +           /* BackSpace key */
   4.120 +           case 0x0E: keysym->unicode = 127;
   4.121 +                      break;
   4.122 +           /* Enter key */
   4.123 +           case 0x1C: keysym->unicode = 10;
   4.124 +                      break;
   4.125             default:
   4.126                        utf8len = PhKeyToMb(utf8, key);
   4.127                        if (utf8len > 0)
   4.128                        {
   4.129 -                          utf8len = mbtowc(&unicode, utf8, utf8len);
   4.130 +                         utf8len = mbtowc(&unicode, utf8, utf8len);
   4.131                           if (utf8len > 0)
   4.132                           {
   4.133                               keysym->unicode = unicode;
     5.1 --- a/src/video/photon/SDL_ph_video.c	Wed Dec 10 12:32:38 2003 +0000
     5.2 +++ b/src/video/photon/SDL_ph_video.c	Wed Dec 10 12:35:56 2003 +0000
     5.3 @@ -186,7 +186,7 @@
     5.4  {
     5.5      PtWidget_t *widget;
     5.6      
     5.7 -    widget = PtCreateWidget(PtWindow, NULL, 0, 0);
     5.8 +    widget = PtCreateWidget(PtWindow, NULL, 0, NULL);
     5.9  
    5.10      return widget;
    5.11  }
    5.12 @@ -195,20 +195,28 @@
    5.13  {
    5.14      PtArg_t     args[32];
    5.15      PhPoint_t   pos = {0, 0};
    5.16 +    PhDim_t*    olddim;
    5.17      PhDim_t     dim = {w, h};
    5.18 +    PhRect_t    desktopextent;
    5.19      int         nargs = 0;
    5.20      const char* windowpos;
    5.21      const char* iscentered;
    5.22      int         x, y;
    5.23  
    5.24 -    PtSetArg(&args[nargs++], Pt_ARG_DIM, &dim, 0);
    5.25 +    /* check if window size has been changed by Window Manager */
    5.26 +    PtGetResource(window, Pt_ARG_DIM, &olddim, 0);
    5.27 +    if ((olddim->w!=w) || (olddim->h!=h))
    5.28 +    {
    5.29 +       PtSetArg(&args[nargs++], Pt_ARG_DIM, &dim, 0);
    5.30 +    }
    5.31  
    5.32      if ((flags & SDL_RESIZABLE) == SDL_RESIZABLE)
    5.33      {
    5.34 -        PtSetArg(&args[nargs++], Pt_ARG_WINDOW_MANAGED_FLAGS, Pt_FALSE, Ph_WM_RESIZE | Ph_WM_CLOSE);
    5.35 -        PtSetArg(&args[nargs++], Pt_ARG_WINDOW_MANAGED_FLAGS, Pt_TRUE, Ph_WM_MAX | Ph_WM_RESTORE);
    5.36 -        PtSetArg(&args[nargs++], Pt_ARG_WINDOW_NOTIFY_FLAGS, Pt_TRUE, Ph_WM_RESIZE | Ph_WM_MOVE | Ph_WM_MAX | Ph_WM_RESTORE | Ph_WM_CLOSE);
    5.37 +        PtSetArg(&args[nargs++], Pt_ARG_WINDOW_MANAGED_FLAGS, Pt_FALSE, Ph_WM_CLOSE);
    5.38 +        PtSetArg(&args[nargs++], Pt_ARG_WINDOW_MANAGED_FLAGS, Pt_TRUE, Ph_WM_MAX | Ph_WM_RESTORE | Ph_WM_RESIZE);
    5.39 +        PtSetArg(&args[nargs++], Pt_ARG_WINDOW_NOTIFY_FLAGS, Pt_TRUE, Ph_WM_RESIZE | Ph_WM_MOVE | Ph_WM_CLOSE | Ph_WM_MAX | Ph_WM_RESTORE);
    5.40          PtSetArg(&args[nargs++], Pt_ARG_WINDOW_RENDER_FLAGS, Pt_TRUE, Ph_WM_RENDER_RESIZE | Ph_WM_RENDER_MAX | Ph_WM_RENDER_COLLAPSE | Ph_WM_RENDER_RETURN);
    5.41 +        PtSetArg(&args[nargs++], Pt_ARG_RESIZE_FLAGS, Pt_TRUE, Pt_RESIZE_XY_AS_REQUIRED);
    5.42      }
    5.43      else
    5.44      {
    5.45 @@ -216,6 +224,7 @@
    5.46          PtSetArg(&args[nargs++], Pt_ARG_WINDOW_NOTIFY_FLAGS, Pt_FALSE, Ph_WM_RESIZE | Ph_WM_MAX | Ph_WM_RESTORE);
    5.47          PtSetArg(&args[nargs++], Pt_ARG_WINDOW_NOTIFY_FLAGS, Pt_TRUE, Ph_WM_MOVE | Ph_WM_CLOSE);
    5.48          PtSetArg(&args[nargs++], Pt_ARG_WINDOW_RENDER_FLAGS, Pt_FALSE, Ph_WM_RENDER_RESIZE | Ph_WM_RENDER_MAX | Ph_WM_RENDER_COLLAPSE | Ph_WM_RENDER_RETURN);
    5.49 +        PtSetArg(&args[nargs++], Pt_ARG_RESIZE_FLAGS, Pt_FALSE, Pt_RESIZE_XY_AS_REQUIRED);
    5.50      }
    5.51  
    5.52      if (((flags & SDL_NOFRAME)==SDL_NOFRAME) || ((flags & SDL_FULLSCREEN)==SDL_FULLSCREEN))
    5.53 @@ -240,39 +249,71 @@
    5.54      {
    5.55          PtSetArg(&args[nargs++], Pt_ARG_POS, &pos, 0);
    5.56          PtSetArg(&args[nargs++], Pt_ARG_BASIC_FLAGS, Pt_TRUE, Pt_BASIC_PREVENT_FILL);
    5.57 -        PtSetArg(&args[nargs++], Pt_ARG_WINDOW_MANAGED_FLAGS, Pt_TRUE, Ph_WM_FFRONT | Ph_WM_MAX);
    5.58 +        PtSetArg(&args[nargs++], Pt_ARG_WINDOW_MANAGED_FLAGS, Pt_TRUE, Ph_WM_FFRONT | Ph_WM_MAX | Ph_WM_TOFRONT | Ph_WM_CONSWITCH);
    5.59          PtSetArg(&args[nargs++], Pt_ARG_WINDOW_STATE, Pt_TRUE, Ph_WM_STATE_ISFRONT | Ph_WM_STATE_ISFOCUS | Ph_WM_STATE_ISALTKEY);
    5.60      }
    5.61      else
    5.62      {
    5.63 -        windowpos = getenv("SDL_VIDEO_WINDOW_POS");
    5.64 -	iscentered = getenv("SDL_VIDEO_CENTERED");
    5.65 +        if (!currently_maximized)
    5.66 +        {
    5.67 +            windowpos = getenv("SDL_VIDEO_WINDOW_POS");
    5.68 +            iscentered = getenv("SDL_VIDEO_CENTERED");
    5.69  
    5.70 -        if ((iscentered) || ((windowpos) && (strcmp(windowpos, "center")==0)))
    5.71 +            if ((iscentered) || ((windowpos) && (strcmp(windowpos, "center")==0)))
    5.72 +            {
    5.73 +                PhWindowQueryVisible(Ph_QUERY_CONSOLE, 0, 0, &desktopextent);
    5.74 +                if (desktop_mode.width>w)
    5.75 +                {
    5.76 +                    pos.x = (desktop_mode.width - w)/2;
    5.77 +                }
    5.78 +                if (desktop_mode.height>h)
    5.79 +                {
    5.80 +                    pos.y = (desktop_mode.height - h)/2;
    5.81 +                }
    5.82 +
    5.83 +                pos.x+=desktopextent.ul.x;
    5.84 +                pos.y+=desktopextent.ul.y;
    5.85 +                PtSetArg(&args[nargs++], Pt_ARG_POS, &pos, 0);
    5.86 +            }
    5.87 +            else
    5.88 +            {
    5.89 +                if (windowpos)
    5.90 +                {
    5.91 +                    if (sscanf(windowpos, "%d,%d", &x, &y) == 2)
    5.92 +                    {
    5.93 +                        if ((x<desktop_mode.width) && (y<desktop_mode.height))
    5.94 +                        {
    5.95 +                            PhWindowQueryVisible(Ph_QUERY_CONSOLE, 0, 0, &desktopextent);
    5.96 +                            pos.x=x+desktopextent.ul.x;
    5.97 +                            pos.y=y+desktopextent.ul.y;
    5.98 +                        }
    5.99 +                        PtSetArg(&args[nargs++], Pt_ARG_POS, &pos, 0);
   5.100 +                    }
   5.101 +                }
   5.102 +            }
   5.103 +        }
   5.104 +
   5.105 +        PtSetArg(&args[nargs++], Pt_ARG_FILL_COLOR, Pg_BLACK, 0);
   5.106 +        
   5.107 +        /* if window is maximized render it as maximized */
   5.108 +        if (currently_maximized)
   5.109          {
   5.110 -            pos.x = (desktop_mode.width - w)/2;
   5.111 -            pos.y = (desktop_mode.height - h)/2;
   5.112 -            PtSetArg(&args[nargs++], Pt_ARG_POS, &pos, 0);
   5.113 -	}
   5.114 +           PtSetArg(&args[nargs++], Pt_ARG_WINDOW_STATE, Pt_TRUE, Ph_WM_STATE_ISMAX);
   5.115 +        }
   5.116          else
   5.117          {
   5.118 -            if (windowpos)
   5.119 -            {
   5.120 -                if (sscanf(windowpos, "%d,%d", &x, &y) == 2 )
   5.121 -                {
   5.122 -                    pos.x=x;
   5.123 -                    pos.y=y;
   5.124 -                    PtSetArg(&args[nargs++], Pt_ARG_POS, &pos, 0);
   5.125 -                }
   5.126 -	    }
   5.127 +           PtSetArg(&args[nargs++], Pt_ARG_WINDOW_STATE, Pt_FALSE, Ph_WM_STATE_ISMAX);
   5.128          }
   5.129  
   5.130 +        /* do not grab the keyboard by default */
   5.131 +        PtSetArg(&args[nargs++], Pt_ARG_WINDOW_STATE, Pt_FALSE, Ph_WM_STATE_ISALTKEY);
   5.132  
   5.133 -        PtSetArg(&args[nargs++], Pt_ARG_FILL_COLOR, Pg_BLACK, 0);
   5.134 -        PtSetArg(&args[nargs++], Pt_ARG_WINDOW_STATE, Pt_FALSE, Ph_WM_STATE_ISFRONT | Ph_WM_STATE_ISMAX | Ph_WM_STATE_ISALTKEY);
   5.135 +        /* bring the focus to the window */
   5.136 +        PtSetArg(&args[nargs++], Pt_ARG_WINDOW_STATE, Pt_TRUE, Ph_WM_STATE_ISFOCUS);
   5.137 +
   5.138 +        /* allow to catch hide events */
   5.139          PtSetArg(&args[nargs++], Pt_ARG_WINDOW_MANAGED_FLAGS, Pt_TRUE, Ph_WM_HIDE);
   5.140          PtSetArg(&args[nargs++], Pt_ARG_WINDOW_NOTIFY_FLAGS, Pt_TRUE, Ph_WM_HIDE);
   5.141 -        PtSetArg(&args[nargs++], Pt_ARG_RESIZE_FLAGS, Pt_FALSE, Pt_RESIZE_XY_AS_REQUIRED);
   5.142      }
   5.143  
   5.144      PtSetResources(window, nargs, args);
   5.145 @@ -386,6 +427,7 @@
   5.146           
   5.147      currently_fullscreen = 0;
   5.148      currently_hided = 0;
   5.149 +    currently_maximized = 0;
   5.150      current_overlay = NULL;
   5.151  
   5.152      OCImage.direct_context = NULL;
   5.153 @@ -395,7 +437,6 @@
   5.154      OCImage.CurrentFrameData = NULL;
   5.155      OCImage.FrameData0 = NULL;
   5.156      OCImage.FrameData1 = NULL;
   5.157 -
   5.158      
   5.159      this->info.wm_available = 1;
   5.160      
     6.1 --- a/src/video/photon/SDL_ph_video.h	Wed Dec 10 12:32:38 2003 +0000
     6.2 +++ b/src/video/photon/SDL_ph_video.h	Wed Dec 10 12:35:56 2003 +0000
     6.3 @@ -62,7 +62,8 @@
     6.4  };
     6.5  
     6.6  /* Private display data */
     6.7 -struct SDL_PrivateVideoData {
     6.8 +struct SDL_PrivateVideoData
     6.9 +{
    6.10      PgDisplaySettings_t mode_settings;	
    6.11      PtWidget_t *Window;                  /* used to handle input events */
    6.12      PhImage_t *image;	                 /* used to display image       */
    6.13 @@ -96,12 +97,13 @@
    6.14      int mouse_relative;
    6.15      WMcursor* BlankCursor;
    6.16  
    6.17 -    Uint32 depth;	            /* current visual depth (not bpp)           */
    6.18 -    Uint32 desktopbpp;              /* bpp of desktop at the moment of start    */
    6.19 -    Uint32 desktoppal;              /* palette mode emulation or system         */
    6.20 +    Uint32 depth;	            /* current visual depth (not bpp)              */
    6.21 +    Uint32 desktopbpp;              /* bpp of desktop at the moment of start       */
    6.22 +    Uint32 desktoppal;              /* palette mode emulation or system            */
    6.23  
    6.24      int currently_fullscreen;
    6.25 -    int currently_hided;        /* 1 - window hided (minimazed), 0 - normal */
    6.26 +    int currently_hided;            /* 1 - window hided (minimazed), 0 - normal    */
    6.27 +    int currently_maximized;        /* 1 - window hided (minimazed), 0 - normal    */
    6.28  
    6.29      PhEvent_t* event;
    6.30      SDL_Overlay* overlay;
    6.31 @@ -120,6 +122,7 @@
    6.32  #define syspalph             (this->hidden->syspalph)
    6.33  #define currently_fullscreen (this->hidden->currently_fullscreen)
    6.34  #define currently_hided      (this->hidden->currently_hided)
    6.35 +#define currently_maximized  (this->hidden->currently_maximized)
    6.36  #define event                (this->hidden->event)
    6.37  #define current_overlay      (this->hidden->overlay)
    6.38  #define desktop_mode         (this->hidden->desktop_mode)
     7.1 --- a/src/video/photon/SDL_ph_wm.c	Wed Dec 10 12:32:38 2003 +0000
     7.2 +++ b/src/video/photon/SDL_ph_wm.c	Wed Dec 10 12:35:56 2003 +0000
     7.3 @@ -43,9 +43,6 @@
     7.4  #include "SDL_ph_modes_c.h"
     7.5  #include "SDL_ph_wm_c.h"
     7.6  
     7.7 -/* This is necessary for working properly with Enlightenment, etc. */
     7.8 -#define USE_ICON_WINDOW
     7.9 -
    7.10  void ph_SetIcon(_THIS, SDL_Surface *icon, Uint8 *mask)
    7.11  {
    7.12      return;
     8.1 --- a/src/video/photon/SDL_phyuv.c	Wed Dec 10 12:32:38 2003 +0000
     8.2 +++ b/src/video/photon/SDL_phyuv.c	Wed Dec 10 12:35:56 2003 +0000
     8.3 @@ -182,7 +182,9 @@
     8.4      overlay->hwdata->props.src_dim.w = width;
     8.5      overlay->hwdata->props.src_dim.h = height;
     8.6  
     8.7 -    overlay->hwdata->chromakey = PgGetOverlayChromaColor();
     8.8 +    /* overlay->hwdata->chromakey = PgGetOverlayChromaColor(); */
     8.9 +    overlay->hwdata->chromakey = PgRGB(12, 6, 12); /* very dark pink color */
    8.10 +    overlay->hwdata->props.color_key = overlay->hwdata->chromakey;
    8.11  
    8.12      PhAreaToRect(&overlay->hwdata->CurrentViewPort, &overlay->hwdata->props.viewport);
    8.13  
    8.14 @@ -191,6 +193,7 @@
    8.15      if ((overlay->hwdata->ischromakey)&&(overlay->hwdata->chromakey))
    8.16      {
    8.17          overlay->hwdata->props.flags |= Pg_SCALER_PROP_CHROMA_ENABLE;
    8.18 +        overlay->hwdata->props.flags |= Pg_SCALER_PROP_CHROMA_SPECIFY_KEY_MASK;
    8.19      } 
    8.20      else
    8.21      {
    8.22 @@ -286,7 +289,7 @@
    8.23  {
    8.24      if (overlay == NULL)
    8.25      {
    8.26 -        return 0;
    8.27 +        return -1;
    8.28      }
    8.29  
    8.30      overlay->hwdata->locked = 1;
    8.31 @@ -332,7 +335,7 @@
    8.32  {
    8.33      if (overlay == NULL)
    8.34      {
    8.35 -         return;
    8.36 +        return;
    8.37      }
    8.38  
    8.39      overlay->hwdata->locked = 0;
    8.40 @@ -406,9 +409,9 @@
    8.41          switch(rtncode)
    8.42          {
    8.43              case -1:
    8.44 -                     SDL_SetError("PgConfigScalerChannel failed\n");
    8.45 +                     SDL_SetError("PgConfigScalerChannel() function failed\n");
    8.46                       SDL_FreeYUVOverlay(overlay);
    8.47 -                     return (0);
    8.48 +                     return -1;
    8.49              case 1:
    8.50                       grab_ptrs2(overlay->hwdata->channel, overlay->hwdata->FrameData0, overlay->hwdata->FrameData1);
    8.51                       break;
     9.1 --- a/test/testoverlay2.c	Wed Dec 10 12:32:38 2003 +0000
     9.2 +++ b/test/testoverlay2.c	Wed Dec 10 12:35:56 2003 +0000
     9.3 @@ -275,6 +275,7 @@
     9.4      SDL_Event event;
     9.5      Uint32 lastftick;
     9.6      int paused=0;
     9.7 +    int resized=0;
     9.8      int i;
     9.9      int fps=12;
    9.10      int fpsdelay;
    9.11 @@ -505,6 +506,10 @@
    9.12                       screen=SDL_SetVideoMode(event.resize.w, event.resize.h, 0, SDL_RESIZABLE | SDL_SWSURFACE);
    9.13                       overlayrect.w=event.resize.w;
    9.14                       overlayrect.h=event.resize.h;
    9.15 +                     if (paused)
    9.16 +                     {
    9.17 +                         resized=1;
    9.18 +                     }
    9.19                       break;
    9.20                  case SDL_KEYDOWN:
    9.21                       if (event.key.keysym.sym == SDLK_SPACE)
    9.22 @@ -526,9 +531,9 @@
    9.23              }
    9.24          }
    9.25  
    9.26 -        if (!paused)
    9.27 +        if ((!paused)||(resized))
    9.28          {
    9.29 -            if ((SDL_GetTicks()-lastftick)>fpsdelay)
    9.30 +            if (((SDL_GetTicks()-lastftick)>fpsdelay)||(resized))
    9.31              {
    9.32                  lastftick=SDL_GetTicks();
    9.33  
    9.34 @@ -552,10 +557,17 @@
    9.35                  }
    9.36  
    9.37                  SDL_DisplayYUVOverlay(overlay, &overlayrect);
    9.38 -                i++;
    9.39 -                if (i==10)
    9.40 +                if (!resized)
    9.41                  {
    9.42 -                    i=0;
    9.43 +                    i++;
    9.44 +                    if (i==10)
    9.45 +                    {
    9.46 +                        i=0;
    9.47 +                    }
    9.48 +                }
    9.49 +                else
    9.50 +                {
    9.51 +                    resized=0;
    9.52                  }
    9.53              }
    9.54          }
    10.1 --- a/test/testsprite.c	Wed Dec 10 12:32:38 2003 +0000
    10.2 +++ b/test/testsprite.c	Wed Dec 10 12:35:56 2003 +0000
    10.3 @@ -4,6 +4,7 @@
    10.4  #include <stdlib.h>
    10.5  #include <string.h>
    10.6  #include <ctype.h>
    10.7 +#include <math.h>
    10.8  #include <time.h>
    10.9  
   10.10  #include "SDL.h"