Window positioning?

Is there any way to give absolute position to an SDL window? I’m
launching external SDL-based apps from one central one and I need frameless
windows to appear in very specific areas… :frowning:

 - John Blanco
 - Rapture In Venice @ http://members.bbnow.net/jblanco
 - "I can't stand to fly...I'm not that naive..." - Five For Fighting

John Blanco wrote:

Is there any way to give absolute position to an SDL window?  I'm

launching external SDL-based apps from one central one and I need frameless
windows to appear in very specific areas… :frowning:

 - John Blanco
 - Rapture In Venice @ http://members.bbnow.net/jblanco
 - "I can't stand to fly...I'm not that naive..." - Five For Fighting

SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

I can think of two ways to do it, neither use SDL.

  1. setup the window manager (assuming you are in X windows) to always position the window (by name perhaps) at a predetermined spot on the screen.

  2. you hack SDL to add a method to move the window via XMoveWindow, or you use the platform specific elements in SDL that have the window reference and call XMoveWindow yourself.

I any case, there’s no good portable way of doing this, that I can see, in the current implementation of SDL.–
-==-
Jon Atkins
http://jonatkins.org/

Hello,On Fri, 2001-12-14 at 18:31, John Blanco wrote:

Is there any way to give absolute position to an SDL window?  I'm

launching external SDL-based apps from one central one and I need frameless
windows to appear in very specific areas… :frowning:

Assuming you are doing this on X11…

#include <SDL.h>

#include <SDL_syswm.h> /* For:
                        *     Functions:
                        *         SDL_GetWMInfo
                        *     Types:
                        *         SDL_SysWMinfo
                        */

#include <SDL_version.h> /* For:
                          *     Macros:
                          *         SDL_version
                          */



// ...




SDL_SysWMinfo info;
SDL_VERSION(&(info.version));
if ( -1 == SDL_GetWMInfo(&info) ) {
    printf("Error getting WM info: %s\n", SDL_GetError());
    exit(1);
}


// Move the window
int x = 10;
int y = 80;
XMoveWindow(info.info.x11.display, info.info.x11.wmwindow, x, y);

It’s as simple as that.

Hope that helps.

See ya

 Charles Iliya Krempeaux
 tnt @ linux.ca
 ckrempea @ alumni.sfu.ca

— Jonathan Atkins wrote:

John Blanco wrote:

Is there any way to give absolute position to an SDL window?  I'm

launching external SDL-based apps from one central one and I need
frameless
windows to appear in very specific areas… :frowning:

 - John Blanco
 - Rapture In Venice @ http://members.bbnow.net/jblanco
 - "I can't stand to fly...I'm not that naive..." - Five For

Fighting


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

I can think of two ways to do it, neither use SDL.

  1. setup the window manager (assuming you are in X windows) to always
    position the window (by name perhaps) at a predetermined spot on the
    screen.

  2. you hack SDL to add a method to move the window via XMoveWindow, or
    you use the platform specific elements in SDL that have the window
    reference and call XMoveWindow yourself.

I any case, there’s no good portable way of doing this, that I can see,
in the current implementation of SDL.

To me, this seems like something that would be useful in SDL. Any reason
why it couldn’t be added?> –

         -=<Long Island Man>=-
               Jon Atkins
         http://jonatkins.org/

SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

=====
Dave Brondsema
dave at brondsema.net
http://www.brondsema.net


Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

Hello,

Is there any way to give absolute position to an SDL window?  I'm

launching external SDL-based apps from one central one and I need frameless
windows to appear in very specific areas… :frowning:

Assuming you are doing this on X11…

[code snipped]

The code provided doesn’t check that the subsystem you’re running on
is X11, nor does it lock the display to prevent multithreaded access.

Example code can be found in the FAQ:
http://www.libsdl.org/faq/FAQ-Linux.html#LINUX_13

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment> On Fri, 2001-12-14 at 18:31, John Blanco wrote: