[AD] [ alleg-Bugs-1441740 ] window <-> fullscreen switching sometimes failed

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


Bugs item #1441740, was opened at 2006-03-02 15:20
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105665&aid=1441740&group_id=5665

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Linux
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Hans de Goede (jwrdegoede)
Assigned to: Nobody/Anonymous (nobody)
Summary: window <-> fullscreen switching sometimes failed

Initial Comment:
This has already been discussed on the list, but I
though it would be a good idea to officially track it
here. This way I can also put links to this report in
Fedora's bugzilla (bugtracking) system.

Updated copy of my initial mail:

There is a problem (under unix using the X11-system
driver) when calling
set_gfx_mode(GFX_AUTODETECT_FULLSCREEN, ... when
changing from a windowed display to a fullscreen display.

Other unix users have also been able to reproduce this,
sofat the common factor seems to be the metacity
(gnome) window manager.

The problem is in src/x/xwin.c around line 734:
   if (fullscreen) {
      AL_CONST char *fc;
      char tmp1[64], tmp2[128];
      int i;

      /* Switch video mode.  */
      if (!_xvidmode_private_set_fullscreen(w, h)) {
         ustrzcpy(allegro_error, ALLEGRO_ERROR_SIZE,
get_config_text("C
         return 0;
      }

      /* Hack: make the window fully visible and center
cursor.  */
      XMoveWindow(_xwin.display, _xwin.window, 0, 0);
      XF86VidModeSetViewPort(_xwin.display,
_xwin.screen, 0, 0);

      /* This chunk is disabled by default because of
problems on KDE
      fc = get_config_string(uconvert_ascii("graphics",
tmp1),
                            
uconvert_ascii("force_centering", tmp2),
                             NULL);

      if ((fc) && ((i = ugetc(fc)) != 0) && ((i == 'y')
|| (i == 'Y') ||
         XWarpPointer(_xwin.display, None,
_xwin.window, 0, 0, 0, 0, 0,
         XWarpPointer(_xwin.display, None,
_xwin.window, 0, 0, 0, 0, w -
         XWarpPointer(_xwin.display, None,
_xwin.window, 0, 0, 0, 0, 0,
         XWarpPointer(_xwin.display, None,
_xwin.window, 0, 0, 0, 0, w -
      }

      XWarpPointer(_xwin.display, None, _xwin.window,
0, 0, 0, 0, w / 2,
      XSync(_xwin.display, False);

      /* Grab the keyboard and mouse.  */
      if (XGrabKeyboard(_xwin.display,
XDefaultRootWindow(_xwin.display)
                        GrabModeAsync, GrabModeAsync,
CurrentTime) != Gr
         ustrzcpy(allegro_error, ALLEGRO_ERROR_SIZE,
get_config_text("C
         return 0;
      }
      _xwin.keyboard_grabbed = 1;
      if (XGrabPointer(_xwin.display, _xwin.window, False,
                       PointerMotionMask |
ButtonPressMask |
                       GrabModeAsync, GrabModeAsync,
_xwin.window, None,
         ustrzcpy(allegro_error, ALLEGRO_ERROR_SIZE,
get_config_text("Ca
         return 0;
      }
      _xwin.mouse_grabbed = 1;
   }


This should create an unmanaged window with its left
top at position 0.0 of the root window. Now the problem
is that with one allegro using program, sometimes it is
as if the XMoveWindow call and the XGrabPointer call
fail silently. In this case the window is at its last
position (before the set_gfx_mode call) and the mouse
is ungrabbed, thus I can pan around the rest of my
desktop. It is as if both the move and the mousegrab
never happened. Strange enough the keyboardgrab has
happened.

I'll attach a very much minimized version of the
program causing this problem. Once you have the file
compiled press any key todo the fullscreen<->window
toggle. Within say 10 toggle you should see the
unwanted behaviour of the window not being at 0.0 (the
viewport will be there) and then you can also freely
cause the mouse to move outside the window and thus the
viewport to scroll.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105665&aid=1441740&group_id=5665




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