You are not logged in.

#1 2012-10-21 10:26:23

slopjong
Member
Registered: 2011-07-25
Posts: 6

X11 Xlib, Drawing in a window has no effect in archlinux

I'm trying to draw some lines and rectangles in a window but the window background color remains white. There are no issues in ubuntu 10.04 LTS with xlib 1.4.? but in archlinux and fedora.

In Fedora I did a strace and ltrace and for some reason the lines and rectangles were drawn then. Executing the same "ltrace ./test" hadn't the same effect in archlinux, the window remained unchanged.

ltrace in fedora
strace in fedora

I have no more ideas how to proceed to fix this issue. Did something change in xlib what I'm not aware of?

Here's the source and here's the issue.

Last edited by slopjong (2012-10-21 10:33:21)

Offline

#2 2012-10-21 16:02:48

Trent
Member
From: Baltimore, MD (US)
Registered: 2009-04-16
Posts: 990

Re: X11 Xlib, Drawing in a window has no effect in archlinux

Works for me using libx11 1.5.0-1 according to pacman. Don't have ltrace or strace installed.

(Edit: Although your source link is broken for me. I found it by git-cloning your repo.)

Have you run pacman -Syu recently?

Last edited by Trent (2012-10-21 16:03:40)

Offline

#3 2012-10-21 17:22:09

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,449
Website

Re: X11 Xlib, Drawing in a window has no effect in archlinux

The link also failed for me, but I believe I found what you were talking about.  It also fails for me, but I found if I put a  "sleep(1)" after the call to your own create_gc function it worked.

I thought to try this as I found it odd to be passing a whole GC as a return value of a function.  I'm surprised this would lead to a delay, but it seems to be the case.  Passing a pointer to an allocated block for the GC would be better - or just declare it globally.

Edit: nevermind the second part, that didn't hold up to testing.  The first part is, however, repeatable.

Edit2: An XFlush at the end of the create_gc function solves this for me.

Last edited by Trilby (2012-10-21 17:29:38)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB