Thread: ScummVM on N900
View Single Post
javispedro's Avatar
Posts: 2,330 | Thanked: 5,200 times | Joined on Jan 2009 @ Barcelona
#103
Originally Posted by fanoush View Post
Maybe in future I can try to start another thread from inside scummvm and initialize glib etc. and listen to d-bus events in parallel to SDL event loop (mainly to support power management better) but it is not trivial. Actually in that case maybe abandoning SDL and starting from scratch would be easier and allowed more flexibility. It is a lot of work though. Also I like current state where all Maemo devices running OS2006,7,8,maemo5 can run same scummvm binary compiled from same source code. Supporting each device and each Maemo version separately is more work too.
Note that what the hildon-games-wrapper library tries to do is exactly that: mix SDL event loop and D-Bus. It actually tries to notify you of certain system / power events, but in a buggy way
I'm constantly wondering too whether to keep on using SDL1.2 or switch to Glib+Gtk... with recent developments I think I'll keep with SDL1.2. SDL1.3 is also an option since the Maemo port is theoretically now "under our control" and we ("we" as in community) may put whatever fixes we care about into it.

Originally Posted by kimtuomi View Post
There is another problem concerning Broken Sword 1. The inventory bar opens in top of the screen. Even when playing in full screen mode and trying to handle the first object in inventory bar, the N900 application menu is triggered although it is not visible on screen.
This is yet another SDL1.2 vs hildon-desktop miscommunication that arises from SDL windows using CWOverrideRedirect instead of fullscreening using NetWM.

You may want to do something like this to the SDL fullscreen window, just after SDL_SetVideoMode
Code:
SDL_SysWMinfo wminfo;
Display *display;
Window xwindow;
XSetWindowAttributes xattr;
Atom atom;
int one = 1;

	SDL_VERSION(&wminfo.version);
	if (!SDL_GetWMInfo(&wminfo)) return;

	wminfo.info.x11.lock_func();
	display = wminfo.info.x11.display;
	xwindow = wminfo.info.x11.fswindow;

		XUnmapWindow(display, xwindow);
		xattr.override_redirect = False;
		XChangeWindowAttributes(display, xwindow, CWOverrideRedirect, &xattr);

		atom = HDATOM(_NET_WM_STATE_FULLSCREEN);
		XChangeProperty(display, xwindow, HDATOM(_NET_WM_STATE),
			XA_ATOM, 32, PropModeReplace,
			(unsigned char *) &atom, 1);

		XChangeProperty(display, xwindow, HDATOM(_HILDON_NON_COMPOSITED_WINDOW),
			XA_INTEGER, 32, PropModeReplace,
			(unsigned char *) &one, 1);
		XMapWindow(display, xwindow);

wminfo.info.x11.unlock_func();
(this may not compile since I just stripped it from my workspace test app , you also need to define the HDATOM macro -- if you don't care about roundtrips just use XInternAtom instead.

Also, the above snippet sets NON_COMPOSITED mode which gives a nice speed bump (will be on by default from firmware 1.1 onwards).

Last edited by javispedro; 2009-12-15 at 14:33.
 

The Following 5 Users Say Thank You to javispedro For This Useful Post: