Any one know why this code is the way it is? was Re: Use of xcb (X protocol library) in the X11 backends

Sam, any body? This looks like it should be changed.

Bob PendletonOn Wed, Jul 1, 2009 at 6:26 PM, Pierre Phaneuf wrote:

On Wed, Jul 1, 2009 at 5:29 PM, Bob Pendleton<@Bob_Pendleton> wrote:

Take care, this was a fun and informative discussion.

I agree. But…

One last detail: does anyone know why there’s a XSync with the
"discard" flag set to true? This could randomly lose some events when
creating a streaming texture?!? Betting that XSync(True) calls are a
bug is usually a winning bet… :wink:

… I still worry about that guy… Anyone know what it’s for?
Creating windows isn’t too frequent (and most SDL apps are still of
the single-window variety), which I’m guessing is the only reason
things haven’t been going wrong. You’d get the weird key stuck if you
happened to press it while a window was created, say, or the focus
would be incorrect, the kind of things I suspect people just shrug off
as yet another example of the flakiness that afflicts them every
day…

If nobody has any idea, I’d suggest applying this:

Index: src/video/x11/SDL_x11render.c

— src/video/x11/SDL_x11render.c ? ? ? (revision 4597)
+++ src/video/x11/SDL_x11render.c ? ? ? (working copy)
@@ -359,7 +359,7 @@
? ? ? ? ? ? ? ? ? ? shm_error = False;
? ? ? ? ? ? ? ? ? ? X_handler = XSetErrorHandler(shm_errhandler);
? ? ? ? ? ? ? ? ? ? XShmAttach(renderdata->display, shminfo);

  • ? ? ? ? ? ? ? ? ? ?XSync(renderdata->display, True);
  • ? ? ? ? ? ? ? ? ? ?XSync(renderdata->display, False);
    ? ? ? ? ? ? ? ? ? ? XSetErrorHandler(X_handler);
    ? ? ? ? ? ? ? ? ? ? if (shm_error) {
    ? ? ? ? ? ? ? ? ? ? ? ? shmdt(shminfo->shmaddr);


http://www.google.com/profiles/pphaneuf


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


±----------------------------------------------------------

No idea. :slight_smile:
Is there any information in subversion blame?On Fri, Jul 3, 2009 at 3:25 PM, Bob Pendleton wrote:

Sam, any body? This looks like it should be changed.

Bob Pendleton

On Wed, Jul 1, 2009 at 6:26 PM, Pierre Phaneuf wrote:

On Wed, Jul 1, 2009 at 5:29 PM, Bob Pendleton wrote:

Take care, this was a fun and informative discussion.

I agree. But…

One last detail: does anyone know why there’s a XSync with the
"discard" flag set to true? This could randomly lose some events when
creating a streaming texture?!? Betting that XSync(True) calls are a
bug is usually a winning bet… :wink:

… I still worry about that guy… Anyone know what it’s for?
Creating windows isn’t too frequent (and most SDL apps are still of
the single-window variety), which I’m guessing is the only reason
things haven’t been going wrong. You’d get the weird key stuck if you
happened to press it while a window was created, say, or the focus
would be incorrect, the kind of things I suspect people just shrug off
as yet another example of the flakiness that afflicts them every
day…

If nobody has any idea, I’d suggest applying this:

Index: src/video/x11/SDL_x11render.c

— src/video/x11/SDL_x11render.c (revision 4597)
+++ src/video/x11/SDL_x11render.c (working copy)
@@ -359,7 +359,7 @@
shm_error = False;
X_handler = XSetErrorHandler(shm_errhandler);
XShmAttach(renderdata->display, shminfo);

  •                XSync(renderdata->display, True);
    
  •                XSync(renderdata->display, False);
                  XSetErrorHandler(X_handler);
                  if (shm_error) {
                      shmdt(shminfo->shmaddr);
    


http://www.google.com/profiles/pphaneuf


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


±----------------------------------------------------------


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

No idea. :slight_smile:
Is there any information in subversion blame?

4161 slouken 2008-11-30 15:58:23 -0600 (Sun, 30 Nov 2008)
XShmAttach(renderdata->display, shminfo);
4161 slouken 2008-11-30 15:58:23 -0600 (Sun, 30 Nov 2008)
XSync(renderdata->display, True);
4161 slouken 2008-11-30 15:58:23 -0600 (Sun, 30 Nov 2008)
XSetErrorHandler(X_handler);

Yeah, looks like it has been there since the beginning you checked it
in last fall.

Bob PendletonOn Fri, Aug 7, 2009 at 5:15 AM, Sam Lantinga wrote:

On Fri, Jul 3, 2009 at 3:25 PM, Bob Pendleton <@Bob_Pendleton> wrote:

Sam, any body? This looks like it should be changed.

Bob Pendleton

On Wed, Jul 1, 2009 at 6:26 PM, Pierre Phaneuf wrote:

On Wed, Jul 1, 2009 at 5:29 PM, Bob Pendleton<@Bob_Pendleton> wrote:

Take care, this was a fun and informative discussion.

I agree. But…

One last detail: does anyone know why there’s a XSync with the
"discard" flag set to true? This could randomly lose some events when
creating a streaming texture?!? Betting that XSync(True) calls are a
bug is usually a winning bet… :wink:

… I still worry about that guy… Anyone know what it’s for?
Creating windows isn’t too frequent (and most SDL apps are still of
the single-window variety), which I’m guessing is the only reason
things haven’t been going wrong. You’d get the weird key stuck if you
happened to press it while a window was created, say, or the focus
would be incorrect, the kind of things I suspect people just shrug off
as yet another example of the flakiness that afflicts them every
day…

If nobody has any idea, I’d suggest applying this:

Index: src/video/x11/SDL_x11render.c

— src/video/x11/SDL_x11render.c ? ? ? (revision 4597)
+++ src/video/x11/SDL_x11render.c ? ? ? (working copy)
@@ -359,7 +359,7 @@
? ? ? ? ? ? ? ? ? ? shm_error = False;
? ? ? ? ? ? ? ? ? ? X_handler = XSetErrorHandler(shm_errhandler);
? ? ? ? ? ? ? ? ? ? XShmAttach(renderdata->display, shminfo);

  • ? ? ? ? ? ? ? ? ? ?XSync(renderdata->display, True);
  • ? ? ? ? ? ? ? ? ? ?XSync(renderdata->display, False);
    ? ? ? ? ? ? ? ? ? ? XSetErrorHandler(X_handler);
    ? ? ? ? ? ? ? ? ? ? if (shm_error) {
    ? ? ? ? ? ? ? ? ? ? ? ? shmdt(shminfo->shmaddr);


http://www.google.com/profiles/pphaneuf


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


±----------------------------------------------------------


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


±----------------------------------------------------------

Okay, changed!On Fri, Jul 3, 2009 at 3:25 PM, Bob Pendleton wrote:

Sam, any body? This looks like it should be changed.

Bob Pendleton

On Wed, Jul 1, 2009 at 6:26 PM, Pierre Phaneuf wrote:

On Wed, Jul 1, 2009 at 5:29 PM, Bob Pendleton wrote:

Take care, this was a fun and informative discussion.

I agree. But…

One last detail: does anyone know why there’s a XSync with the
"discard" flag set to true? This could randomly lose some events when
creating a streaming texture?!? Betting that XSync(True) calls are a
bug is usually a winning bet… :wink:

… I still worry about that guy… Anyone know what it’s for?
Creating windows isn’t too frequent (and most SDL apps are still of
the single-window variety), which I’m guessing is the only reason
things haven’t been going wrong. You’d get the weird key stuck if you
happened to press it while a window was created, say, or the focus
would be incorrect, the kind of things I suspect people just shrug off
as yet another example of the flakiness that afflicts them every
day…

If nobody has any idea, I’d suggest applying this:

Index: src/video/x11/SDL_x11render.c

— src/video/x11/SDL_x11render.c (revision 4597)
+++ src/video/x11/SDL_x11render.c (working copy)
@@ -359,7 +359,7 @@
shm_error = False;
X_handler = XSetErrorHandler(shm_errhandler);
XShmAttach(renderdata->display, shminfo);

  •                XSync(renderdata->display, True);
    
  •                XSync(renderdata->display, False);
                  XSetErrorHandler(X_handler);
                  if (shm_error) {
                      shmdt(shminfo->shmaddr);
    


http://www.google.com/profiles/pphaneuf


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


±----------------------------------------------------------


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC

Good enough!On Wed, Aug 19, 2009 at 11:40 PM, Sam Lantinga wrote:

Okay, changed!

On Fri, Jul 3, 2009 at 3:25 PM, Bob Pendleton <@Bob_Pendleton> wrote:

Sam, any body? This looks like it should be changed.

Bob Pendleton

On Wed, Jul 1, 2009 at 6:26 PM, Pierre Phaneuf wrote:

On Wed, Jul 1, 2009 at 5:29 PM, Bob Pendleton<@Bob_Pendleton> wrote:

Take care, this was a fun and informative discussion.

I agree. But…

One last detail: does anyone know why there’s a XSync with the
"discard" flag set to true? This could randomly lose some events when
creating a streaming texture?!? Betting that XSync(True) calls are a
bug is usually a winning bet… :wink:

… I still worry about that guy… Anyone know what it’s for?
Creating windows isn’t too frequent (and most SDL apps are still of
the single-window variety), which I’m guessing is the only reason
things haven’t been going wrong. You’d get the weird key stuck if you
happened to press it while a window was created, say, or the focus
would be incorrect, the kind of things I suspect people just shrug off
as yet another example of the flakiness that afflicts them every
day…

If nobody has any idea, I’d suggest applying this:

Index: src/video/x11/SDL_x11render.c

— src/video/x11/SDL_x11render.c ? ? ? (revision 4597)
+++ src/video/x11/SDL_x11render.c ? ? ? (working copy)
@@ -359,7 +359,7 @@
? ? ? ? ? ? ? ? ? ? shm_error = False;
? ? ? ? ? ? ? ? ? ? X_handler = XSetErrorHandler(shm_errhandler);
? ? ? ? ? ? ? ? ? ? XShmAttach(renderdata->display, shminfo);

  • ? ? ? ? ? ? ? ? ? ?XSync(renderdata->display, True);
  • ? ? ? ? ? ? ? ? ? ?XSync(renderdata->display, False);
    ? ? ? ? ? ? ? ? ? ? XSetErrorHandler(X_handler);
    ? ? ? ? ? ? ? ? ? ? if (shm_error) {
    ? ? ? ? ? ? ? ? ? ? ? ? shmdt(shminfo->shmaddr);


http://www.google.com/profiles/pphaneuf


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


±----------------------------------------------------------


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


±----------------------------------------------------------