nanogui: Thread: moving the window decoration


[<<] [<] Page 1 of 1 [>] [>>]
Subject: moving the window decoration
From: Michael Schnell ####@####.####
Date: 5 Sep 2008 08:52:54 -0000
Message-Id: <48C0F323.10003@lumino.de>

Hi nanogui Experts,

I'm using uCLinux on a NIOS processor.

I created a little testing program that uses tries to move a window 
around on the screen.

Obviously I use GrMoveWindow() for this.

But doing so, only the content of the Window seems to be moved but not 
the decoration (head-line, frame and clipping area) so that it looks as 
if the content is moved within the decoration. So the decoration seems 
to be an additional window that is not accessed by the window-ID i get 
when calling GrNewWindow(). But it also does not seem to be a child 
window (I suppose otherwise it would be moved with it's parent).

What is the paradigm used here ? How to move the complete window ?

Thanks for any help !
-Michael
Subject: Re: [nanogui] moving the window decoration
From: "Greg Haerr" ####@####.####
Date: 6 Sep 2008 01:58:22 -0000
Message-Id: <0d1201c90fc4$275e2de0$6501a8c0@winXP>

: But doing so, only the content of the Window seems to be moved but not 
: the decoration (head-line, frame and clipping area) so that it looks as 
: if the content is moved within the decoration. So the decoration seems 
: to be an additional window that is not accessed by the window-ID i get 
: when calling GrNewWindow(). But it also does not seem to be a child 
: window (I suppose otherwise it would be moved with it's parent).

When the nanowm window manager runs, it creates an additional
window used as a window frame for all top level windows
(windows whose parent is root).  It uses GrReparentWindow
to cause this new frame window to be the parent of the
user window.  Thus, the frame window contains the user
window.  You can access this window by getting the parent
window ID of your window.

The X11 window manager works the same way but additionally
"redirects" window move requests to the frame window by
catching these events and resending them.  In general, a
top-level window shouldn't care where it is positioned exactly,
thus normally calls to GrMoveWindow on a top level window
would be considered bad manners...

Hope that helps.  Check out the code in src/demos/nanowm
for details on how the window manager does its thing and 
catches other events.

Regards,

Greg


: 
: What is the paradigm used here ? How to move the complete window ?
: 
: Thanks for any help !
: -Michael
: 
: ---------------------------------------------------------------------
: To unsubscribe, e-mail: ####@####.####
: For additional commands, e-mail: ####@####.####
: 
: 
:
Subject: Re: [nanogui] moving the window decoration
From: Michael Schnell ####@####.####
Date: 8 Sep 2008 07:59:00 -0000
Message-Id: <48C4DAF8.6050505@lumino.de>

Greg Haerr wrote:
> When the nanowm window manager runs, it creates an additional
> window used as a window frame for all top level windows
> (windows whose parent is root).  
I did suppose this.
> It uses GrReparentWindow
> to cause this new frame window to be the parent of the
> user window.  Thus, the frame window contains the user
> window.  You can access this window by getting the parent
> window ID of your window.
>   
As I assumed exactly this, I did try this but I seem to have gotten the 
ID of the main Window as got an error message that same can't be moved. 
I'm going top retry and come back.
> The X11 window manager works the same way but additionally
> "redirects" window move requests to the frame window by
> catching these events and resending them.  In general, a
> top-level window shouldn't care where it is positioned exactly,
> thus normally calls to GrMoveWindow on a top level window
> would be considered bad manners...
>   
Unfortunately this is my first meeting with X. I never tried to do 
anything with X11 yet, so I don't ave any experience to rely on :(.

Thanks a lot for helping !

-Michael
Subject: Re: [nanogui] moving the window decoration
From: Michael Schnell ####@####.####
Date: 8 Sep 2008 10:16:34 -0000
Message-Id: <48C4FB43.7090704@lumino.de>

> Hope that helps.  Check out the code in src/demos/nanowm
> for details on how the window manager does its thing and 
> catches other events.
>   
I suppose due to lack of documentation this is the only way to get up to
speed.

I already did find out how the timer works by looking at "nxeyes".

But regarding moving a window on the screen I don't know where to look.

-Michael

Subject: Re: [nanogui] moving the window decoration
From: Michael Schnell ####@####.####
Date: 8 Sep 2008 10:17:22 -0000
Message-Id: <48C4FB50.7090408@lumino.de>

I rechecked.

The window I create gets (e.g.) the ID 9
I request the parent ID with GrQueryTree() and get 1
When trying a move I get "nxclient 94: Error (GrMoveWindow) Illegal on
root Window 1.
I verified that GR_ROOT_WINDOW_ID in fact is 1.

What to do ?

-Michael

Subject: Re: [nanogui] moving the window decoration
From: Michael Schnell ####@####.####
Date: 8 Sep 2008 10:19:11 -0000
Message-Id: <48C4FB5D.2040907@lumino.de>

>> I request the parent ID with GrQueryTree() and get 1

The same happens, when I read the parent ID from the GR_WINDOW_INFO
requested by GrGetWindowInfo.

-Michael

Subject: Re: [nanogui] moving the window decoration
From: Michael Schnell ####@####.####
Date: 8 Sep 2008 10:26:03 -0000
Message-Id: <48C4FC3F.6000805@lumino.de>

After same guessing and testing I found that using the window ID + 1 
does the trick.

But I suppose this is not a clean solution. There needs to be a way to 
to find out the correct decoration window.

GR_WINDOW_INFO.sibling always is 5 (i.e not the window id + 1)

I have no idea what this value is supposed to be.

-Michael
Subject: Re: [nanogui] moving the window decoration
From: Michael Schnell ####@####.####
Date: 8 Sep 2008 10:44:53 -0000
Message-Id: <48C501E5.8070901@lumino.de>

Michael Schnell wrote:
>
> But I suppose this is not a clean solution. There needs to be a way to 
> to find out the correct decoration window.
It in fact (of course) moves the wrong window, when multiple x client 
processes are started at the same time.

-Michael
Subject: Re: [nanogui] moving the window decoration
From: Michael Schnell ####@####.####
Date: 8 Sep 2008 12:41:15 -0000
Message-Id: <48C51D2E.6080704@lumino.de>

I found the problem.

Directly after creating the Window, the parent is still the root window,

The window manager changes this only later, so I have to wait before 
determinating the parent.

Thanks for  your patience,

-Michael
[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.