2011/9/29 Peter Hutterer <peter.hutte...@who-t.net>:
> On Wed, Sep 28, 2011 at 11:29:39PM +0200, Eduard Hasenleithner wrote:
>> Here is some further thought about the pixmap handling. What I somehow
>> dislike is the "dirty" handling of pixmaps when the client is closed.
>> How about pre-allocating the pixmaps at driver startup:
>>
>> void wcmLedInitPixmap(WacomDevicePtr priv, int *values, int count)
>> {
>>       int i;
>>       ScreenPtr pScreen = screenInfo.screens[0];
>>
>>       for (i = 0; i < count; i++) {
>>               PixmapPtr pMap;
>>               XID id;
>>
>>               pMap = pScreen->CreatePixmap(pScreen, 64, 32, 
>> pScreen->rootDepth, 0);
>>               id = FakeClientID(0);
>>               pMap->drawable.id = id;
>>               AddResource(id, RT_PIXMAP, pMap);
>>
>>               values[i] = id;
>>       }
>> }
>>
>> or is this also too "hackish"?
>
> yes. Why do we have to worry about this?
>
> Just make it a documented recommendation that any pixmap that is referenced
> by the device must be persistent for the benefit of other clients and should
> be overwritten, not replaced, whenever the image changes.
> If a client screws up and frees the pixmap all that'll happen is that the
> next client will get BadDrawable and can't read the current state of the
> display and must create a new one. Not ideal but that's just a client bug.
>
> Coincidentally, the code above would not work well with multiple
> ScreenPtrs, iirc you'd have to allocate the pixmap on each screen.

Argh, what a pity. Yes I could allocate each pixmap on all screens and
give it the same XID. But in that case any X11 client reading the
button image properties would not get the really shown picture, but
only those pictures which were set on the same screen. And just for
having a "works 90% of the time" feature I don't want to do so much
effort. I did not even succed yet in blanking the pixmap area :(

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to