Hi folks, 

I just hacked together two new LibWMH functions, on which I'd like to
hear comments before I commit them to CVS:

int ggiWmhGetPos        (ggi_visual_t vis,int *x,int *y);

gets the position of a currently visible visual relative to the root visual
(i.e. in the same format as needed for ggiWmhMove). This allows to save/
restore window positions as well as to arrange windows for multi-visual 
apps.

Example code:

void wmh_rearrange_to_grid(void) {
        int x,y;
        x=y=10;
        ggiWmhGetPos(state.visxy,&x,&y);
        ggiWmhMove(state.visxy,x                     ,y);
        ggiWmhMove(state.visxz,x                     ,y+state.size.y+BORDERY);
        ggiWmhMove(state.visyz,x+state.size.x+BORDERX,y+state.size.y+BORDERY);
        ggiWmhMove(state.info ,x+state.size.x+BORDERX,y);
}

int ggiWmhGetSize       (ggi_visual_t vis,int *x,int *y);

Does the same for the window size (which may differ from the visual size,
if you enabled resizeable windows).


It would be interesting to as well provide something like

int ggiWmhGetDecoratedSize(ggi_visual_t vis,int *x,int *y);

Or something even more clever, giving the maximum decoration widths on all
four borders, which would allow to place windows side by side without gaps
and do away with the strange BORDERX/BORDERY heuristic constants I use
above. Anyone with a clue on that (I'm horribly lame when it comes to X
programming).


Regarding compatibility, as the functions are just added, there are no 
compatibility issues with older apps. As probably noone except me is using
LibWmh, I suppose there won't be any problem for newer apps encountering an
old LibWmh as well. 


Further ideas to add to LibWMH: Add possibility to go to "withdrawn" state.
More ideas welcome.

Comments ?

CU, Andy

-- 
Andreas Beck             |  Email :  <[EMAIL PROTECTED]>

Reply via email to