Window Position(bis) + ConfigureEvent

Hi,

I noticed that SDL create its window with the (0,0) coords. OK, let’s
assume that it’s not really useful to place it where we want, or to know
its position. Anyway it could be useful sometimes, and especially with
the SDL_NOFRAME flag set, you can’t move the window. So I took a look at
the SDL code, and played around with it by creating a SDL_CONFIGUREEVENT
(and a SDL_configure.c file), but in fact I got some troubles.

Indeed, in the internal function which takes care of the events (under
x11) I added this code :

(…)
case ConfigureEvent:
if(resize event){ /*already done inSDL */
}else{
//move window
SDL_PrivateConfigure(xevent.xconfigure.x,xevent.xconfigure.y);

//change window position
XMoveWindow(SDL_Display,WMwindow,xevent.xconfigure.x,xevent.xconfigure.y);
}

The main problem is that XMoveWindow generates a ConfigureNotify event
again, so this code loops indefinitaly ! it sucks.

So I tried to get this new event from the event queue, but it doesn’t
seem to work.

I really need to find a way to do that, so maybe someone could help me.

Lawouach

“sylvain.hellegouarch at etud.univ-ubs.fr” wrote:

I noticed that SDL create its window with the (0,0) coords. OK, let’s
assume that it’s not really useful to place it where we want, or to know
its position. Anyway it could be useful sometimes, and especially with
the SDL_NOFRAME flag set, you can’t move the window.

use SDL_GetWMInfo() to get the window ID. See the xlib reference docs
and the ICCCM for how to move a window — you should not need to modify
SDL itself

you can’t move windows portably anyway, and is usually a bad idea

you can’t move windows portably anyway, and is usually a bad idea

It would be nice if SDL were able to do this, so that we had a
portable way of moving windows…–
Trick


Linux User #229006 * http://counter.li.org

Mattias Engdeg?rd a ?crit :

“sylvain.hellegouarch at etud.univ-ubs.fr” wrote:

I noticed that SDL create its window with the (0,0) coords. OK, let’s
assume that it’s not really useful to place it where we want, or to know
its position. Anyway it could be useful sometimes, and especially with
the SDL_NOFRAME flag set, you can’t move the window.

use SDL_GetWMInfo() to get the window ID. See the xlib reference docs
and the ICCCM for how to move a window — you should not need to modify
SDL itself

Ok but what is ICCCM ?

you can’t move windows portably anyway, and is usually a bad idea

oh ! why ?

tx anyway

Mattias Engdeg?rd a ?crit :

“sylvain.hellegouarch at etud.univ-ubs.fr” wrote:

I noticed that SDL create its window with the (0,0) coords. OK, let’s
assume that it’s not really useful to place it where we want, or to know
its position. Anyway it could be useful sometimes, and especially with
the SDL_NOFRAME flag set, you can’t move the window.

use SDL_GetWMInfo() to get the window ID. See the xlib reference docs
and the ICCCM for how to move a window — you should not need to modify
SDL itself

Ok but what is ICCCM ?

you can’t move windows portably anyway, and is usually a bad idea

oh ! why ?

tx anyway

e2helleg wrote:

Ok but what is ICCCM ?

Ok but what is Google ?

Mattias Engdeg?rd wrote:

e2helleg wrote:

Ok but what is ICCCM ?

Ok but what is Google ?

you’re so nice as usual ! :confused:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1On Tuesday 09 Oct 2001 3:27 pm, you wrote:

you can’t move windows portably anyway, and is usually a bad idea

Some windowing systems dont support this, and the window manager often places
windows where it pleases anyway. This is something the user should do as he
chooses, and not the app programmer.


Tom “Tomahawk” Badran
Imperial College Dept of Computing


PGP Public key available from:
certserver.pgp.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7wz0aXCpWOla2mCcRAndMAKCBZtalYZYkP0hYZTR+6DhA7qENRwCgnycF
wCbVR08OE/O5XiVKJFKJvTA=
=cLWs
-----END PGP SIGNATURE-----

Tom Badran wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I took a look at the sources of SDL and in fact the configureNotify
event is never stored in a SDL_SYSWMEVENT event. Because the latter
event is only created in the default statement of the switch case, and
the configure notify event is not a default event. Thus it’s impossible
to know it bye SDL_SYSWMEVENT.

I repeat this is only useful when SDL_NOFRAME is set which is sometimes
used. Maybe the position of the screen should be passed to
SDL_SetVideoMode() function, as it it will solve the problem.

Bye
Lawouach> On Tuesday 09 Oct 2001 3:27 pm, you wrote:

you can’t move windows portably anyway, and is usually a bad idea

Some windowing systems dont support this, and the window manager often places
windows where it pleases anyway. This is something the user should do as he
chooses, and not the app programmer.


Tom “Tomahawk” Badran
Imperial College Dept of Computing


PGP Public key available from:
certserver.pgp.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7wz0aXCpWOla2mCcRAndMAKCBZtalYZYkP0hYZTR+6DhA7qENRwCgnycF
wCbVR08OE/O5XiVKJFKJvTA=
=cLWs
-----END PGP SIGNATURE-----