[MPlayer-dev-eng] GUI's icon - a X11 issue?

Ingo Brückl ib at wupperonline.de
Mon Jun 13 22:33:07 CEST 2011


Steaphan Greene wrote on Mon, 13 Jun 2011 10:46:15 -0400:

>>>> 2. Why do I get return code 1 instead of Success from XCopyArea() and
>>>>    XCopyPlane()?
>>>>
>> A look into the X11 sources reveals the explanation for #2 above. Both
>> functions end with "return 1" instead of "return Success". So how am I
>> supposed to check the return code of a X11 function? 1 can be BadRequest as
>> well.

> Ahh, right.  X11 is not really a graphics library, but a protocol, with
> the server (display) and client (graphical program) decoupled.  The
> errors you are talking about are not return values, but error codes for
> events generated by X.  See the documentation on the XErrorEvent
> structure for more details.

Oh, I see. So 1 is for TRUE then.

>>>> 3. Why is the mask copied with XCopyPlane() to the video window all black
>>>>    and doesn't show any contours?
>>
>> #3 remains a mystery to me.

> I'm afraid I didn't look into that.  My random guess would be that the
> foreground and background colors (used by XCopyPlane) were both black.

Yes, confirmed. ;-)

>>> I'm sure there is a better way to realize these GtkDrawables into their X11
>>> Pixmaps.
>>
>> With your indication of "realization" the gtk main loop came into my mind and
>> I was wondering whether a call would perform this "pending" task. It seems
>> that it does.

> Perhaps, but calling that loop seems like overkill.  Something like
> creating a temporary drawable, copying each of these pixmaps to that
> drawable with GDK, then freeing that temporary drawable, should do it.

Hmm, why overkill? If there will be just now (almost) nothing to do for GTK,
is it really a bad idea calling it once after gtk_init(), or do I miss
something?

At least code-wise it is far simpler than the temporary drawables. Unless
it's a no-go for a reason I currently don't see, I'd rather like to call
the loop.

Ingo


More information about the MPlayer-dev-eng mailing list