window initial position - Motif

This is a discussion on window initial position - Motif ; Hi all, I had noticed very strange behaviour while trying to get the x,y coor. of a created window. I use the standard XCreateSimpleWindow(...) library call to create my window - right after I create it - I "Map" it ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: window initial position

  1. window initial position

    Hi all,

    I had noticed very strange behaviour while trying to get the x,y coor.
    of a created window.
    I use the standard XCreateSimpleWindow(...) library call to create my
    window - right after I create it - I "Map" it using XMapWindow().
    Now, all I want is to query the created window's initial x,y coor. -
    and for this I use XTranslateCoordinates(). For some reason sometimes
    the x,y coor. I receive differ from the window's actual position.

    Also, after creating the window and querying its initial location I
    subscirbe to its events - I had noticed that sometimes the window
    receives a non-interactive initial move event (which I don't always
    catch) - that changes its original initial location.

    To make it short: after the window is created I wait on its events
    with XNextEvent() and sometimes I get the event of the correct window
    location and sometime I dont get it (the location I get is in the left
    corner of the screen and not in the updated location of the window)

    How can I be sure the coor. I receive are the correct ones?
    Any suggestion? Did I miss something?

    Please help.
    Thanks in advance.

  2. Re: window initial position

    On 26 dez, 16:52, hagit wrote:
    > Hi all,
    >
    > I had noticed very strange behaviour while trying to get the x,y coor.
    > of a created window.
    > I use the standard XCreateSimpleWindow(...) library call to create my
    > window - right after I create it - I "Map" it using XMapWindow().
    > Now, all I want is to query the created window's initial x,y coor. -
    > and for this I use XTranslateCoordinates(). For some reason sometimes
    > the x,y coor. I receive differ from the window's actual position.
    >
    > Also, after creating the window and querying its initial location I
    > subscirbe to its events - I had noticed that sometimes the window
    > receives a non-interactive initial move event (which I don't always
    > catch) - that changes its original initial location.
    >
    > To make it short: after the window is created I wait on its events
    > with XNextEvent() and sometimes I get the event of the correct window
    > location and sometime I dont get it (the location I get is in the left
    > corner of the screen and not in the updated location of the window)
    >
    > How can I be sure the coor. I receive are the correct ones?
    > Any suggestion? Did I miss something?


    Did you wait for a MapNotify event? I'd suggest you to look at this

    http://tronche.com/gui/x/xlib-tutorial/

    and at this

    http://tronche.com/gui/x/xlib-tutori...m-anatomy.html

    Yeah, it's quite old material, but still useful.

    ---
    Casantos



  3. Re: window initial position

    On Dec 27, 4:08*am, noj...@gate.cpmet.ufpel.tche.br wrote:
    > On 26 dez, 16:52, hagit wrote:
    >
    >
    >
    >
    >
    > > Hi all,

    >
    > > I had noticed very strange behaviour while trying to get the x,y coor.
    > > of a createdwindow.
    > > I use the standard XCreateSimpleWindow(...) library call to create my
    > >window- right after I create it - I "Map" it using XMapWindow().
    > > Now, all I want is to query the createdwindow'sinitialx,y coor. -
    > > and for this I use XTranslateCoordinates(). For some reason sometimes
    > > the x,y coor. I receive differ from thewindow'sactualposition.

    >
    > > Also, after creating thewindowand querying itsinitiallocation I
    > > subscirbe to its events - I had noticed that sometimes thewindow
    > > receives a non-interactiveinitialmove event (which I don't always
    > > catch) - that changes its originalinitiallocation.

    >
    > > To make it short: after thewindowis created I wait on its events
    > > with XNextEvent() and sometimes I get the event of the correctwindow
    > > location and sometime I dont get it (the location I get is in the left
    > > corner of the screen and not in the updated location of thewindow)

    >
    > > How can I be sure the coor. I receive are the correct ones?
    > > Any suggestion? Did I miss something?

    >
    > Did you wait for a MapNotify event? I'd suggest you to look at this
    >
    > http://tronche.com/gui/x/xlib-tutorial/
    >
    > and at this
    >
    > http://tronche.com/gui/x/xlib-tutori...m-anatomy.html
    >
    > Yeah, it's quite old material, but still useful.
    >
    > ---
    > Casantos- Hide quoted text -
    >
    > - Show quoted text -


    Unfortunatly,
    sometimes I don't get the MapNotify event at all...
    I followed the tutorial and still strange things happened to me there.
    any idea?

+ Reply to Thread