Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Pool of Graphic Contexts

2 views
Skip to first unread message

Bruce

unread,
May 22, 2006, 2:52:32 PM5/22/06
to
I'm trying to track down a BadGC problem in an X-Windows application.
I'm receiving the following error when running an X-Windows application
on
some, but not all, of our AIX RS6000s:

"X error of failed request 'Bad GC (invalid GC parameter)
major opcode of failed request: 70 (X-Polyfill rectangle)"

There is a Feb 2004 thread ("BadGC with Find dialog") wherein Glynn
Clements
says that "Xt maintains a pool of GCs, with each GC being share among
all
widget which want a GC with those properties".

Is the pool of X-Window GCs specific to each executable or is the pool
shared among all the widgets of all the executables that are currently
running under the specific X-Windows manager?

Bruce

noj...@gate.cpmet.ufpel.tche.br

unread,
May 22, 2006, 8:22:54 PM5/22/06
to

Short answer: no.

Long answer: GCs are server-stored objects so they could be shared
between clients, in theory, but that would not be practical. If one
client changed a shared GC that change would affect all operations
made used with that GC. There is also the problem that resources
created by one client are destroyed by the server when the client
closes its connection.

--- Casantos

Fred Kleinschmidt

unread,
May 23, 2006, 11:17:02 AM5/23/06
to

<noj...@gate.cpmet.ufpel.tche.br> wrote in message
news:1148343774.5...@g10g2000cwb.googlegroups.com...
Some implementations can and do share GCs, depending on how you
generated the GC. If you use XtAllocGC, for example, you specify which
attributes you want, and which ones you wish to be able to modify.
This GC can be shared with any other app (or your own), as long as
their requewst for az GC matches the
items you specified you will use (not modify), and either do not use
any of the ones you might modify or else they also specify they want
to modify that (or those) resource(s). This means, of course, that every
time you
use that GC, you must explicitly set all of the values of the items you
said you might modify, since some other app (or your own!) might have
modified one or more of thoses values since you last used them.
--
Fred L. Kleinschmidt
Boeing Associate Technical Fellow
Technical Architect, Software Reuse Project


Bruce

unread,
May 25, 2006, 7:23:36 PM5/25/06
to
Thanks for both of your answers. I'm an application developer.
The BadGC error is indicating an error somewhere else. It is not
specific to my code's handling of the GC because the code is not
explicitly handling the X-Window GCs. It is very useful to know
that its very probable that the problem is in the executable with the
BadGC error. It is probably not being affected by some other
executable managed by the X-Windows manager.

Bruce

0 new messages