nanogui: Thread: Positioning window after it has been shown


[<<] [<] Page 1 of 1 [>] [>>]
Subject: Positioning window after it has been shown
From: Michael Schmid ####@####.####
Date: 14 Sep 2009 12:01:45 -0000
Message-Id: <4AAE30B2.1050601@ecom-ch.com>

Hi!

I use nano-X 0.91

Following problem:
In have an application (GUI-Based) where I start a webbrowser as another 
process. The browser appears in another parent window in front of my 
application (z-order). 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() ?

--> Is there any possibility to get the window descriptor of the last 
started window?
--> Or is there any possibility to say: Next window which starts should 
have this position?
--> 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?

Thanks!
Michael
-- 

Michael Schmid

 

ECOM Engineering GmbH

Farbgutstrasse 3

9008 St. Gallen

 

Tel. 0041 71 840 08 00

Direkt 0041 71 840 08 20

Fax 0041 71 840 08 01

 

Web www.ecom-ch.com <http://www.ecom-ch.com/>

 

Subject: Re: Positioning window after it has been shown
From: "Aaron J. Grier" ####@####.####
Date: 15 Sep 2009 17:21:23 -0000
Message-Id: <20090915172113.GL8127@arwen.poofy.goof.com>

On Mon, Sep 14, 2009 at 02:01:54PM +0200, Michael Schmid wrote:
> In have an application (GUI-Based) where I start a webbrowser as another 
> process. The browser appears in another parent window in front of my 
> application (z-order). 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() ?

traverse the list of clients, look for your web-browser, get its window
ID, and resize it...  the exact mechanism will be dependent on your
window manager.

Greg, does nano-X have anything similar to xlsclients?

> --> Is there any possibility to get the window descriptor of the last 
> started window?
> --> Or is there any possibility to say: Next window which starts should 
> have this position?
> --> 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 latter two are usually done with hints passed from the window
manager to the application during the application's startup.

-- 
  Aaron J. Grier | "Not your ordinary poofy goof." | ####@####.####
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 

[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.