src/video/photon/SDL_ph_wm.c
changeset 571 8e3ce997621c
parent 315 3333b6e68289
child 663 8bedd6d61642
     1.1 --- a/src/video/photon/SDL_ph_wm.c	Mon Jan 20 01:37:07 2003 +0000
     1.2 +++ b/src/video/photon/SDL_ph_wm.c	Mon Jan 20 01:38:37 2003 +0000
     1.3 @@ -56,15 +56,11 @@
     1.4  {
     1.5      SDL_Lock_EventThread();
     1.6  
     1.7 -    /* check for set caption call before window init */
     1.8 +    /* sanity check for set caption call before window init */
     1.9      if (window!=NULL)
    1.10      {
    1.11          PtSetResource(window, Pt_ARG_WINDOW_TITLE, title, 0);
    1.12      }
    1.13 -    else
    1.14 -    {
    1.15 -        captionflag=1;
    1.16 -    }
    1.17  
    1.18      SDL_Unlock_EventThread();
    1.19  }
    1.20 @@ -88,35 +84,34 @@
    1.21  
    1.22  SDL_GrabMode ph_GrabInputNoLock(_THIS, SDL_GrabMode mode)
    1.23  {
    1.24 +    short abs_x, abs_y;
    1.25 +
    1.26 +    if( mode == SDL_GRAB_OFF )
    1.27 +    {
    1.28 +        PtSetResource(window, Pt_ARG_WINDOW_STATE, Pt_FALSE, Ph_WM_STATE_ISALTKEY);
    1.29 +    }
    1.30 +    else
    1.31 +    {
    1.32 +        PtSetResource(window, Pt_ARG_WINDOW_STATE, Pt_TRUE, Ph_WM_STATE_ISALTKEY);
    1.33 +
    1.34 +        PtGetAbsPosition(window, &abs_x, &abs_y);
    1.35 +        PhMoveCursorAbs(PhInputGroup(NULL), abs_x + SDL_VideoSurface->w/2, abs_y + SDL_VideoSurface->h/2);
    1.36 +    }
    1.37 +
    1.38 +    SDL_Unlock_EventThread();
    1.39 +
    1.40      return(mode);
    1.41  }
    1.42  
    1.43  SDL_GrabMode ph_GrabInput(_THIS, SDL_GrabMode mode)
    1.44  {
    1.45 -	short abs_x, abs_y;
    1.46 -
    1.47 -	SDL_Lock_EventThread();
    1.48 -/*	mode = ph_GrabInputNoLock(this, mode);*/
    1.49 +    SDL_Lock_EventThread();
    1.50 +    mode = ph_GrabInputNoLock(this, mode);
    1.51 +    SDL_Unlock_EventThread();
    1.52  
    1.53 -	if( mode == SDL_GRAB_OFF )
    1.54 -	{
    1.55 -		PtSetResource(window, Pt_ARG_WINDOW_STATE, Pt_FALSE,
    1.56 -				Ph_WM_STATE_ISALTKEY );
    1.57 -	}
    1.58 -	else
    1.59 -	{
    1.60 -		PtSetResource(window, Pt_ARG_WINDOW_STATE, Pt_TRUE,
    1.61 -				Ph_WM_STATE_ISALTKEY );
    1.62 +    return(mode);
    1.63 +}
    1.64  
    1.65 -		PtGetAbsPosition( window, &abs_x, &abs_y );
    1.66 -		PhMoveCursorAbs( PhInputGroup( NULL ),
    1.67 -				abs_x + SDL_VideoSurface->w/2,
    1.68 -				abs_y + SDL_VideoSurface->h/2 );
    1.69 -	}
    1.70 -
    1.71 -	SDL_Unlock_EventThread();
    1.72 -	return(mode);
    1.73 -}
    1.74  
    1.75  int ph_GetWMInfo(_THIS, SDL_SysWMinfo *info)
    1.76  {