Re: [AD] Another X11 glitch |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> I think we should take a conservative approach. Disable the hack by
> default, but allow it to be enabled with a config variable. If someone
> reports a problem, at least they can just edit their config file. If no
> problems are reported then the hack can be deleted later on.
Good idea. I've commited the following patch on trunk and branch.
Index: allegro.cfg
===================================================================
RCS file: /cvsroot/alleg/allegro/allegro.cfg,v
retrieving revision 1.39
diff -u -r1.39 allegro.cfg
--- allegro.cfg 27 Oct 2002 23:12:59 -0000 1.39
+++ allegro.cfg 23 Jan 2003 12:24:30 -0000
@@ -158,6 +158,12 @@
+# Unix/X11 only: whether to force window centering in fullscreen mode
+# for the XWFS driver (yes or no)
+force_centering =
+
+
+
# Windows only: whether to disable direct updating in color conversion
# mode for the DXWN driver (yes or no)
disable_direct_updating =
Index: docs/src/allegro._tx
===================================================================
RCS file: /cvsroot/alleg/allegro/docs/src/allegro._tx,v
retrieving revision 1.124
diff -u -r1.124 allegro._tx
--- docs/src/allegro._tx 23 Jan 2003 09:57:56 -0000 1.124
+++ docs/src/allegro._tx 23 Jan 2003 12:26:10 -0000
@@ -1370,6 +1370,11 @@
this variable is not set, Allegro checks the FRAMEBUFFER environment
variable, and then defaults to /dev/fb0.
<li>
+force_centering = x<br>
+ Unix/X11 only: specifies whether to force window centering in fullscreen
+ mode when the XWFS driver is used (yes or no). Enabling this setting may
+ cause some artifacts to appear on KDE desktops.
+<li>
disable_direct_updating = x<br>
Windows only: specifies whether to disable direct updating when the
GFX_DIRECTX_WIN driver is used in color conversion mode (yes or no).
Index: src/x/xwin.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/x/xwin.c,v
retrieving revision 1.48
diff -u -r1.48 xwin.c
--- src/x/xwin.c 23 Jan 2003 10:23:11 -0000 1.48
+++ src/x/xwin.c 23 Jan 2003 12:26:32 -0000
@@ -707,6 +707,10 @@
#ifdef ALLEGRO_XWINDOWS_WITH_XF86VIDMODE
if (fullscreen) {
+ AL_CONST char *fc;
+ char tmp1[64], tmp2[128];
+ int i;
+
/* Switch video mode. */
if (!_xvidmode_private_set_fullscreen(w, h, 0, 0)) {
ustrzcpy(allegro_error, ALLEGRO_ERROR_SIZE, get_config_text("Can not
set video mode"));
@@ -716,10 +720,19 @@
/* Hack: make the window fully visible and center cursor. */
XMoveWindow(_xwin.display, _xwin.window, 0, 0);
XF86VidModeSetViewPort(_xwin.display, _xwin.screen, 0, 0);
- XWarpPointer(_xwin.display, None, _xwin.window, 0, 0, 0, 0, 0, 0);
- XWarpPointer(_xwin.display, None, _xwin.window, 0, 0, 0, 0, w - 1, 0);
- XWarpPointer(_xwin.display, None, _xwin.window, 0, 0, 0, 0, 0, h - 1);
- XWarpPointer(_xwin.display, None, _xwin.window, 0, 0, 0, 0, w - 1, h -
1);
+
+ /* This chunk is disabled by default because of problems on KDE
desktops. */
+ fc = get_config_string(uconvert_ascii("graphics", tmp1),
+ uconvert_ascii("force_centering", tmp2),
+ NULL);
+
+ if ((fc) && ((i = ugetc(fc)) != 0) && ((i == 'y') || (i == 'Y') || (i
== '1'))) {
+ XWarpPointer(_xwin.display, None, _xwin.window, 0, 0, 0, 0, 0, 0);
+ XWarpPointer(_xwin.display, None, _xwin.window, 0, 0, 0, 0, w - 1,
0);
+ XWarpPointer(_xwin.display, None, _xwin.window, 0, 0, 0, 0, 0, h -
1);
+ XWarpPointer(_xwin.display, None, _xwin.window, 0, 0, 0, 0, w - 1, h
- 1);
+ }
+
XWarpPointer(_xwin.display, None, _xwin.window, 0, 0, 0, 0, w / 2, h /
2);
XSync(_xwin.display, False);
--
Eric Botcazou