[comp.windows.x] Moving windows from the command line

garfinkel@hpfcso.FC.HP.COM (Dan Garfinkel) (02/16/91)

> Is it possible to move an x-window using the command line in another
> session. For example, somebody posted a way to change the title in
> an x window via a c program executed in another session. Is there
> an analogous way to move the window to another location on the
> root display. 

Yes, use XConfigureWindow.  

> For that matter, is there a way to iconicize it as well?

Yes, use XUnmapWindow.

In both cases, your window manager will (should) handle the operation.


-Dan

mouse@lightning.mcrcim.mcgill.EDU (02/18/91)

>> Is it possible to move an x-window using the command line in another
>> session.  [...]
> Yes, use XConfigureWindow.

(a) that's hardly command-line (you need a small wrapper program), and
(b) you should use XReconfigureWMWindow.  (Why should you?  At present,
the Xlib documentation leads me to believe that you don't need to when
all you're doing is moving the window.  But I'm not sure of this, and
if and when the ICCCM changes, presumably the implementation of
XReconfigureWMWindow will change to match, so your client code doesn't
need to be touched.  XMoveWindow/XConfigureWindow may not always be the
correct method to request that your top-level window be moved.)

>> For that matter, is there a way to iconicize it as well?
> Yes, use XUnmapWindow.

If this does anything, it will probably result in the window being
withdrawn, not iconified.  (See the ICCCM, section 4.1.4.)  The proper
thing to use to request that a top-level window be iconified is
XIconifyWindow.

Of course, in all of these cases, you can only request.  The window
manager is free to obey the request, ignore it, whatever.  (As
plausible examples for these requests, a tiling window manager will
likely ignore move requests, and a window manager that doesn't do icons
will perforce ignore please-iconify-me requests.)

					der Mouse

			old: mcgill-vision!mouse
			new: mouse@larry.mcrcim.mcgill.edu

garfinkel@hpfcso.FC.HP.COM (Dan Garfinkel) (02/20/91)

> > Is it possible to move an x-window using the command line in another
> > session. For example, somebody posted a way to change the title in
> > an x window via a c program executed in another session. Is there
> > an analogous way to move the window to another location on the
> > root display. 
> 
> Yes, use XConfigureWindow.  
> 
> > For that matter, is there a way to iconicize it as well?
> 
> Yes, use XUnmapWindow.
> 
> In both cases, your window manager will (should) handle the operation.

Oops,

That'll teach me to post with a head cold.  This information is incorrect.
First, these are not commands but rather Xlib calls to write commands with.
Second, as de Mouse pointed out, one should use the following Xlib calls in
writing such commands.

1) XConfigureWMWindow

and

2) XIconifyWindow


Sorry for the misinformation.

-Dan