Discussion:
Moving an X window about on screen by a program
(too old to reply)
Binary Nomad
2005-01-16 23:01:42 UTC
Permalink
Hi,

How do I do this?

I looked at XMoveWindow(), haven't used it yet, will it do what I say
above, ie. simulate a mouse drag, WHILE the window is updating stuff
within itself, eg. it could be a game? I would like the whole thing to
be flicker free, and capable of 3D as well!

If so, is there a simple way to get to it from the shell, or anything
else, except C ?

Thanks,


The Nomad.
Dances With Crows
2005-01-16 23:56:16 UTC
Permalink
[ crossposting trimmed ]
["Followup-To:" header set to comp.os.linux.x.]
On 16 Jan 2005 15:01:42 -0800, Binary Nomad staggered into the Black Sun
How do I [move an X window via a program or shellscript]? I looked at
XMoveWindow(), haven't used it yet, will it do what I say above, ie.
simulate a mouse drag, WHILE the window is updating stuff within
itself, eg. it could be a game? If so, is there a simple way to get
to it from the shell, or anything else, except C ?
Could you read the man page for XMoveWindow and answer your own
question, and stop using run-on sentences, which are hard to read, and
they make the reader lose the point, that the writer was originally
trying to make? XMoveWindow() is a C function that requires Xlib. You
can't call it from a script. You also have to find the window ID of the
window you want to move, which may require more work than you want to
deal with.
I would like the whole thing to be flicker free, and capable of 3D as
well!
What in the name of Cthulhu does 3D have to do with moving a window? If
you've got the GLX extension running, and an OpenGL app running in a
window that isn't fullscreen, you can move that window. Flicker-free
operation depends on a lot of variables and the current system load, so
forget about it for now. Get it working first. (The 3 steps are: 0.
make it work 1. make it maintainable 2. make it fast. If you can ignore
those rules no matter how often the developers tell you about them, you
have a bright future in Project Management.)

If you know the coordinates of the window you want to move, you can
always use xmacroplay ( http://xmacro.sourceforge.net/ ). This text
fragment does the same thing as "hold Alt, move mouse to (1000,900),
click button 1, move mouse to (800,600), release button 1, release Alt."
Like so:

cat << EOF | xmacroplay :0
KeyStrPress Alt_L
MotionNotify 1000 900
ButtonPress 1
MotionNotify 800 600
ButtonRelease 1
KeyStrRelease Alt_L
EOF

...this moves my terminal window 200 pixels left and 300 pixels up,
since in my window manager, Alt+button 1 click/drag moves windows.
Modify for your window manager, do simple arithmetic to move windows.
HTH,
--
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin / mail: TRAP + SPAN don't belong
http://www.brainbench.com / Hire me!
-----------------------------/ http://crow202.dyndns.org/~mhgraham/resume
Dan Espen
2005-01-17 02:36:10 UTC
Permalink
Post by Binary Nomad
Hi,
How do I do this?
I looked at XMoveWindow(), haven't used it yet, will it do what I say
above, ie. simulate a mouse drag, WHILE the window is updating stuff
within itself, eg. it could be a game? I would like the whole thing to
be flicker free, and capable of 3D as well!
If so, is there a simple way to get to it from the shell, or anything
else, except C ?
Moving windows is the job of the window manager.

Some window managers let you create shell scripts that
tell the window manager what to do.

I don't know about 3D, what exactly are you trying to do?

Loading...