XtDisplayToApplicationContext fails with "Error: Couldn't find per display information"

Dan Nicholson dbn.lists at gmail.com
Tue Feb 3 09:44:21 PST 2009

On Thu, Jan 29, 2009 at 5:08 PM, Tristan Schmelcher
<tschmelcher at google.com> wrote:
> Hello all. Sorry if this is not the right place to send this, but I'm
> developing a plugin for Firefox on Linux and I've run up against a
> roadblock. In my plugin I'm being passed a pointer to an X "Display" struct
> (in NPP_SetWindow, for those of you that know NPAPI) and I'm calling
> XtDisplayToApplicationContext on it to get an app context to use in various
> Xt calls. Now on most systems this works fine--e.g., Ubuntu Dapper 32-bit
> with FF2 and Intrepid 32-bit with FF3 both work flawlessly. However, when I
> build a 64-bit version and try it on Ubuntu Hardy 64-bit with FF3, it
> doesn't work. When it enters XtDisplayToApplicationContext, I get "Error:
> Couldn't find per display information" on the console and the program exits.

I think that happens when you pass a NULL Display to

I can't say I know anything about Xt, but does it fail in a simple testcase?

#include <X11/Xlib.h>
#include <X11/Intrinsic.h>
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
    Display *dpy;
    XtAppContext ctx;

    dpy = XOpenDisplay(NULL);
    if (!dpy) {
        fprintf(stderr, "XOpenDisplay failed\n");
    ctx = XtDisplayToApplicationContext(dpy);

    return 0;


More information about the xorg mailing list