supporting non-rectangular windows

Pat Kane pekane52 at gmail.com
Tue Feb 1 08:56:05 PST 2011


  > Also, can anyone help me to understand
  > what difference does it make if we call XSelectInput or XShapeSelectInput?

This document:   http://www.x.org/docs/Xext/shape.pdf
has this to say about it

     ... only one event type can be selected
     via the extension, XShapeSelectInput provides
     a general mechanism similar to the standard
     Xlib binding for window events. A mask value
     has been defined, ShapeNotifyMask that is
     the only valid bit in mask that may be specified.

So I think you will need to use both.

Pat
---



On Tue, Feb 1, 2011 at 12:40 AM, Prasanta Sadhukhan
<psadhukhan at gmail.com> wrote:
> Thanks. I added the following lines as told. Now I am getting a window but
> 1) it is not circular shaped although I am using X shape extension API
> 2) it is not accepting any input. XNextEvent() still hangs
>
> attached is the modified program. Anything else I need to add
>
> Also, can anyone help me to understand
> what difference does it make if we call XSelectInput or XShapeSelectInput?
>   Do we always need to use XShapeSelectInput if we have set a shape on the
> window? Or are there cases in which we would want to use XSelectInput with a
> shaped window?
>
> Regards & thanks in advance
>
> On Tue, Feb 1, 2011 at 7:15 AM, Pat Kane <pekane52 at gmail.com> wrote:
>>
>> You  should add a line like this too:
>>  XSelectInput(dsp, win, ExposureMask|ButtonPressMask|ButtonReleaseMask );
>>
>>
>> On Mon, Jan 31, 2011 at 9:39 AM, Pat Kane <pekane52 at gmail.com> wrote:
>> > Add this line just before the event loop:
>> >  XMapWindow(dsp, win);
>> > Pat
>> > ---
>> >
>> >
>> >
>> > On Mon, Jan 31, 2011 at 2:05 AM, Prasanta Sadhukhan
>> > <psadhukhan at gmail.com> wrote:
>> >> Thanks for the pointer. I saw that the example use widget API through
>> >> XCreateManagedWIdget APIs.
>> >> Are this required to use the shape extension API to work?
>> >>
>> >> I wanted to use the shape API without this if possible. I tried a small
>> >> example of creating a circular window which will have 2 diagonal line
>> >> in it
>> >> and the window should close when any button is pressed inside it.
>> >> Attached
>> >> is the c program I tried but it is not creating any window and is
>> >> hanging
>> >> inside XNextEvent() call
>> >> Can anyone please point to me as to what is wrong in this program. I am
>> >> a
>> >> newbie to X-programming
>> >>
>> >> Also, one more question regarding events is
>> >> what difference does it make if we call XSelectInput or
>> >> XShapeSelectInput?
>> >> Do we always need to use XShapeSelectInput if we have set a shape on
>> >> the
>> >> window? Or are there cases in which we would want to use XSelectInput
>> >> with a
>> >> shaped window?
>> >>
>> >> Thanks in advance
>> >> Prashant
>> >>
>> >> On Mon, Jan 24, 2011 at 9:14 PM, Alan Coopersmith
>> >> <alan.coopersmith at oracle.com> wrote:
>> >>>
>> >>> On 01/24/11 03:34 AM, Prasanta Sadhukhan wrote:
>> >>> > Thanks for the information. Is there any link which shows an example
>> >>> > of
>> >>> > how to
>> >>> > use this APIs for example, if I want to create a rounded-rect
>> >>> > window.
>> >>>
>> >>> See the oclock sources, which use the shape extension to draw a
>> >>> circular
>> >>> clock
>> >>> window:
>> >>>
>> >>> http://cgit.freedesktop.org/xorg/app/oclock/tree/ or
>> >>> http://www.x.org/releases/individual/app/oclock-1.0.2.tar.bz2
>> >>>
>> >>> --
>> >>>        -Alan Coopersmith-        alan.coopersmith at oracle.com
>> >>>         Oracle Solaris Platform Engineering: X Window System
>> >>>
>> >>
>> >>
>> >> _______________________________________________
>> >> xorg-devel at lists.x.org: X.Org development
>> >> Archives: http://lists.x.org/archives/xorg-devel
>> >> Info: http://lists.x.org/mailman/listinfo/xorg-devel
>> >>
>> >
>
>


More information about the xorg-devel mailing list