A temporary solution to get X11 windowmanager resolution for fullscreen

Hello,

I post you a temporary solution that I made to get the correct width and height of
any windowmanager in X11 mode:

void get_wm_property(t_pv *p)
{
Display *dpy;

if (!(dpy = XOpenDisplay(0)))
{
fprintf(stderr, “Can’t open display\n”);
exit(1);
}
p->wm_w = DisplayWidth(dpy, 0);
p->wm_h = DisplayHeight(dpy, 0);
XCloseDisplay(dpy);
}

This is very ugly, because he open a new display, but SDL has allready open a
display, but I can’t access to the current display of SDL, because it’s very good
hidden, and I wouldn’t change the library source code myself.–
TrashMail.net
Free disposable email addresses.

This is very ugly, because he open a new display, but SDL has allready open a
display, but I can’t access to the current display of SDL, because it’s very good
hidden, and I wouldn’t change the library source code myself.

Yes, actually you can. The interface is in SDL_syswm.h and an example of
usage is at http://www.libsdl.org/projects/scrap

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Thanks, it works!

Here my new code:

void get_wm_property(t_pv *p)
{
SDL_SysWMinfo info;

SDL_GetWMInfo(&info);
p->wm_w = DisplayWidth(info.info.x11.display, 0);
p->wm_h = DisplayHeight(info.info.x11.display, 0);
}On Mon, Dec 29, 2003 at 02:23:21PM -0800, Sam Lantinga wrote:

This is very ugly, because he open a new display, but SDL has allready open a
display, but I can’t access to the current display of SDL, because it’s very good
hidden, and I wouldn’t change the library source code myself.

Yes, actually you can. The interface is in SDL_syswm.h and an example of
usage is at http://www.libsdl.org/projects/scrap


http://TrashMail.net/
Free disposable email addresses.