[compiz] Re: --skip-gl-yield

Colin Guthrie gmane at colin.guthr.ie
Fri Apr 20 09:38:31 PDT 2007


Kristian Lyngstøl wrote:
> Sure, I was thinking of makeing this simple and generic. I don't
> really think wether it is compiled or not matters all that much,
> though.

Cool. I reckon if it can be done in scripts it should be, but that's
just my preference. Makes it easier to include in packages but overall
that's just my laziness speaking ;)

<script promotion>
That said with a bit of clever awk magic a lot can be achieved... here
is how we determine if Xgl shoudl be started or not:

glxinfo 2>/dev/null | awk 'BEGIN { no_direct = 1; in_client = 0;
server_tfp = 0; client_tfp = 0 } /direct rendering: Yes/ { no_direct = 0
} /GLX_EXT_texture_from_pixmap/ { if (in_client) { client_tfp = 1 } else
{ server_tfp = 1 } } /client glx extensions:/ { in_client = 1 } /GLX
extensions/ { exit } END { exit or(no_direct, and(server_tfp,
client_tfp)) }'

If the return value of that is 0 then we start Xgl, if not we don't. So
I'm sure a lot of the tests that need done can be achieved in similar ways.
</script promotion>

> How about I make sure that the application can be used to test
> specific cases manually? Say: 'compiz-manager' does all the tests and
> starts compiz, but 'compiz-manager --test glyield --no-start' just
> checks wether __GL_YIELD="NOTHING" should be set or not? That way, you
> could use it fairly easy from other places too. Or "compiz-manager
> --get-arguments --no-start" to return a list of all arguments
> compiz-manager suggest you pass to compiz?

Yeah sounds like a good idea.

Something that could do that would be ideal. Tho I would make it more
generic than that. GL_YIELD is just an env. variable and thus you could
probably just return a recommended list of environment variables rather
than testing for the GL_YIELD specifically. That way if Nvidia or Ati
etc. introduce new variables the tool can be updated and people use of
it will not need to change.

I'd generificate two specific modes:

compiz-helper --recommend --env
compiz-helper --recommend --args

Or something similar.

If you are going the compiled route, then these tests could be compiled
into a library and used by compiz-manager and compiz-helper as two
separate apps... That way you wouldn't need e.g. gtk bindings on a pure
KDE system if you don't actually want/need the GUI app. I'd probably go
for static linkage tho' as a fully separate shared library seems a
little excessive!



Just some ideas and idle thoughts... feel free to pick 'em apart ;)

See ya

Col.



More information about the compiz mailing list