[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#243824: XF86VidMode-Extension: existence indistinguishable from non-existence



Package: xlibs-dev
Version: 4.2.1-3.bunk.10
Severity: normal

A program cannot use the result of XF86VidModeQueryExtension() to see,
if it would crash when calling XF86VidModeGetModeLine() or not.

Test program:

xvme.c:
#include <stdio.h>
#include <X11/Xlib.h>
#include <X11/extensions/xf86vmode.h>

int main (int argc, char **argv)
{
  int rc = 0;
  Display *display;

  if ((display = XOpenDisplay (NULL))) {
    XF86VidModeModeLine mode;
    int a, b, r;
    r = XF86VidModeQueryExtension(display, &a, &b);
    printf ("%d = XF86VidModeQueryExtension(%d, %d);\n", r, a, b);
    r = XF86VidModeGetModeLine(display, DefaultScreen (display),
			       &a, &mode);
    printf ("%d = XF86VidModeGetModeLine(%d, %dx%d);\n",
	    r, a, mode.hdisplay, mode.vdisplay);
    XCloseDisplay (display);
  }
  return rc;
}

Running locally:
strcmp:~/src> xvme
1 = XF86VidModeQueryExtension(0, 131);
1 = XF86VidModeGetModeLine(106080, 1280x1024);

Running remotely:
noname:~> setenv DISPLAY strcmp:0
noname:~> xvme
1 = XF86VidModeQueryExtension(0, 131);
X Error of failed request:  XF86VidModeExtensionDisabled
  Major opcode of failed request:  135 (XFree86-VidModeExtension)
  Minor opcode of failed request:  14 (XF86VidModeSetClientVersion)
  Serial number of failed request:  9
  Current serial number in output stream:  10

Of course normal X clients work in this setting (as you can see, because
XOpenDisplay() obviously succeeded, just programs, that try to use the
vidmode-extension crash (e.g. mplayer, tvtime, quake, ...), even, if no
fullscreen mode is activated. Because they are prepared to switch modes,
they usually query the size of the screen with the vidmode extension
instead of looking for the size of the root window etc. They continue to
work via ssh forwarding, because the server sees a local client in this
case, but they become too slow.

As you can see, no return value of XF86VidModeQueryExtension() tells you
that the extension is disabled for remote clients (by the way, how can i
enable it?). As this is the default, none of these programs can run
remotely.
One work-around would be to parse the DISPLAY string, if the display is
remote, and if it is, to use other means. But this is really dirty.

-- System Information
Debian Release: 3.0-bunk-1
Architecture: i386
Kernel: Linux strcmp.libc 2.6.5-strcmp.1 #4 Tue Apr 6 22:08:52 CEST 2004 i686
Locale: LANG=C, LC_CTYPE=de_DE

Versions of packages xlibs-dev depends on:
ii  libc6-dev                2.3.2.ds1-11    GNU C Library: Development Librari
ii  libc6-dev [libc-dev]     2.3.2.ds1-11    GNU C Library: Development Librari
ii  xlibs                    4.2.1-3.bunk.10 X Window System client libraries




Reply to: