Unix Programming - window initial position

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > December 2007 > window initial position





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author window initial position
hagit

2007-12-26, 7:21 pm

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.
Måns Rullgård

2007-12-26, 7:21 pm

hagit <hagit_guy@hotmail.com> writes:

> [...]


Please do not multi-post. I have already answered your question in
another group.

--
Måns Rullgård
mans@mansr.com
lg..

2007-12-27, 1:24 pm

On Dec 26, 4:50 pm, hagit <hagit_...@hotmail.com> 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?
>
> Please help.
> Thanks in advance.


Could be that the window manager automatically displays it in other
position.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com