[PATCH xf86-video-nested 5/5] Introduce a new XCB client backend, and make it the default one.
Laércio de Sousa
laerciosousa at sme-mogidascruzes.sp.gov.br
Thu Nov 6 09:04:17 PST 2014
Hi Uli,
2014-11-05 20:16 GMT-02:00 Uli Schlachter <psychon at znc.in>:
> Hi,
>
> Am 31.10.2014 um 14:12 schrieb Laércio de Sousa:
> > + case XCB_CONN_CLOSED_REQ_LEN_EXCEED:
> > + xf86DrvMsg(scrnIndex,
> > + X_ERROR,
> > + "Connection to host X server closed: too many
> requests.\n");
> > + return TRUE;
>
>
> This isn't a "too many requests" error, this is "something tried to send a
> single request larger than the supported maximum request length" (Think:
> "Something tried to send a request of size 1 GiB"). Or, to quote xcb.h:
>
> /** Connection closed, exceeding request length that server accepts. */
> #define XCB_CONN_CLOSED_REQ_LEN_EXCEED 4
>
Fixed. Thanks!
> [...]
> > +static void
> > +_NestedClientSetWindowTitle(NestedClientPrivatePtr pPriv,
> > + const char *extra_text)
> > +{
> [...]
> > + xcb_flush(pPriv->conn);
> > +}
> [...]
> > +static Bool
> > +_NestedClientHostXInit(NestedClientPrivatePtr pPriv)
> > +{
> [...]
> > + xcb_flush(pPriv->conn);
> > +}
> [...]
>
> What's your strategy for placing calls to xcb_flush()? I'd like to see each
> xcb_flush() having a comment explaining why it is needed.
>
> E.g. _NestedClientSetWindowTitle() calls xcb_flush(), but its only caller,
> _NestedClientCreateWindow() does not flush. I can't see why a flush would
> be
> required between setting a window title and mapping the window.
>
> My preferred solution would be to remove all these calls to xcb_flush().
> Instead, "something in the event loop" should flush. For example, you could
> place a call to xcb_flush() at the end of NestedClientCheckEvents() and
> remove
> all other calls (no idea if this actually works, I don't know the code
> well enough).
>
I've followed your suggestion, putting a single xcb_flush() call at the end
of NestedClientCheckEvents(), and it works pretty well. Thanks!
> +void
> > +NestedClientCheckEvents(NestedClientPrivatePtr pPriv)
> > +{
> > + xcb_generic_event_t *ev;
> > +
> > + while (TRUE)
> > + {
> > + ev = xcb_poll_for_event(pPriv->conn);
> > +
> > + if (!ev)
> > + {
> > + if (xcb_connection_has_error(pPriv->conn))
> > + exit(1);
> [...]
>
> Really? Doesn't this mean "when something goes wrong, we will silently exit
> without any error message"?
>
Fixed. Thanks!
I've also added a new handle for "delete window" event (i.e., if the user
clicks on close button at nested Xorg window). I'll submit a v2 of my patch
series right now.
> Cheers,
> Uli
> --
> "Why make things difficult, when it is possible to make them cryptic
> and totally illogical, with just a little bit more effort?" -- A. P. J.
>
Thank you very much!
--
*Laércio de Sousa*
*Orientador de Informática*
*Escola Municipal "Professor Eulálio Gruppi"*
*Rua Ismael da Silva Mello, 559, Mogi Moderno*
*Mogi das Cruzes - SPCEP 08717-390*
Telefone: (11) 4726-8313
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20141106/40b87761/attachment.html>
More information about the xorg-devel
mailing list