nanogui: Positioning window after it has been shown


Previous by date: 20 Sep 2009 17:36:57 -0000 Re: Positioning window after it has been shown, Aaron J. Grier
Next by date: 20 Sep 2009 17:36:57 -0000 [patch] nano-x on glibc2.10.1, Benoît Rouits
Previous in thread: 20 Sep 2009 17:36:57 -0000 Re: Positioning window after it has been shown, Aaron J. Grier
Next in thread:

Subject: Re: [nanogui] Positioning window after it has been shown
From: "Greg Haerr" ####@####.####
Date: 20 Sep 2009 17:36:57 -0000
Message-Id: <007c01ca3a18$ef5399a0$6664a8c0@winXP>

: The problem is that I don't know how to move that
: window. I know the GrMoveWindow() function, but I don't know how to get
: the "window descriptor", because it's another programm where I don't
: touch the code... How can I get the "window descriptor" which I need to
: use GrMoveWindow() ?

You can use GrQueryTree to get a list of windows starting from
the root window GR_ROOT_WINDOW_ID.  Then call
GrGetWindowInfo on these until you match with the process id
of your browser (nano-X keeps process IDs with windows for
your very problem).  Then you have the window id for GrMoveWindow.



:
: --> Is there any possibility to get the window descriptor of the last
: started window?

No, not needed and risky in race conditions.


: --> Or is there any possibility to say: Next window which starts should
: have this position?

The window manager uses another mechanism to intercept GrNewWindow
calls, and then can reposition the window, along with the frame.  It
uses this mechanism to position all windows.  See the nanowm
src under src/demos/nanowm for details if you want to use this
mechanism (lots of work for your small problem).



: --> Or is there any trick to say that the next window should bound it
: lower, right edge with the lower, right edge of the allready actual 
window?

The window manager, or your application will have to find the old
and current window, get window info, then re-position accordingly.

Remember that when running a window manager, it creates another
"frame" window, then GrReparents the original window into the
frame.  Thus, the window id that you created in your app could
"change" as it gets wrapped by the window manager.  You'll want
to use the reparented id when moving windows, as moving child
windows within a another window (frame) won't work as expected.

Regards,

Greg 


Previous by date: 20 Sep 2009 17:36:57 -0000 Re: Positioning window after it has been shown, Aaron J. Grier
Next by date: 20 Sep 2009 17:36:57 -0000 [patch] nano-x on glibc2.10.1, Benoît Rouits
Previous in thread: 20 Sep 2009 17:36:57 -0000 Re: Positioning window after it has been shown, Aaron J. Grier
Next in thread:


Powered by ezmlm-browse 0.20.