[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg
Subject:    Re: XtDisplayToApplicationContext fails with "Error: Couldn't find
From:       Tristan Schmelcher <tschmelcher () google ! com>
Date:       2009-02-03 17:46:57
Message-ID: 5323d74a0902030946w3e64c140p55946f1d065fbed5 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


I've already verified that the display is not NULL. I'll try the experiment
you suggested though. Thanks.

2009/2/3 Dan Nicholson <dbn.lists@gmail.com>

> On Thu, Jan 29, 2009 at 5:08 PM, Tristan Schmelcher
> <tschmelcher@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
> XtDisplayToApplicationContext.
>
> 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");
>        exit(1);
>    }
>    ctx = XtDisplayToApplicationContext(dpy);
>    XCloseDisplay(dpy);
>
>    return 0;
> }
>
> --
> Dan
>

[Attachment #5 (text/html)]

I&#39;ve already verified that the display is not NULL. I&#39;ll try the experiment \
you suggested though. Thanks.<br><br><div class="gmail_quote">2009/2/3 Dan Nicholson \
<span dir="ltr">&lt;<a \
href="mailto:dbn.lists@gmail.com">dbn.lists@gmail.com</a>&gt;</span><br> <blockquote \
class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt \
0pt 0.8ex; padding-left: 1ex;"><div class="im">On Thu, Jan 29, 2009 at 5:08 PM, \
Tristan Schmelcher<br> &lt;<a \
href="mailto:tschmelcher@google.com">tschmelcher@google.com</a>&gt; wrote:<br> &gt; \
Hello all. Sorry if this is not the right place to send this, but I&#39;m<br> &gt; \
developing a plugin for Firefox on Linux and I&#39;ve run up against a<br> &gt; \
roadblock. In my plugin I&#39;m being passed a pointer to an X &quot;Display&quot; \
struct<br> &gt; (in NPP_SetWindow, for those of you that know NPAPI) and I&#39;m \
calling<br> &gt; XtDisplayToApplicationContext on it to get an app context to use in \
various<br> &gt; Xt calls. Now on most systems this works fine--e.g., Ubuntu Dapper \
32-bit<br> &gt; with FF2 and Intrepid 32-bit with FF3 both work flawlessly. However, \
when I<br> &gt; build a 64-bit version and try it on Ubuntu Hardy 64-bit with FF3, \
it<br> &gt; doesn&#39;t work. When it enters XtDisplayToApplicationContext, I get \
&quot;Error:<br> &gt; Couldn&#39;t find per display information&quot; on the console \
and the program exits.<br> <br>
</div>I think that happens when you pass a NULL Display to<br>
XtDisplayToApplicationContext.<br>
<br>
I can&#39;t say I know anything about Xt, but does it fail in a simple testcase?<br>
<br>
#include &lt;X11/Xlib.h&gt;<br>
#include &lt;X11/Intrinsic.h&gt;<br>
#include &lt;stdio.h&gt;<br>
#include &lt;stdlib.h&gt;<br>
<br>
int main(int argc, char *argv[])<br>
{<br>
    Display *dpy;<br>
    XtAppContext ctx;<br>
<br>
    dpy = XOpenDisplay(NULL);<br>
    if (!dpy) {<br>
        fprintf(stderr, &quot;XOpenDisplay failed\n&quot;);<br>
        exit(1);<br>
    }<br>
    ctx = XtDisplayToApplicationContext(dpy);<br>
    XCloseDisplay(dpy);<br>
<br>
    return 0;<br>
}<br>
<br>
--<br>
<font color="#888888">Dan<br>
</font></blockquote></div><br>



_______________________________________________
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic