maemo-leste / bugtracker

Issue tracking repository
63 stars 3 forks source link

Proper fullscreen support #18

Closed parazyd closed 3 years ago

parazyd commented 7 years ago

Currently in hildon-desktop, software that should run fullscreen actually does not. I tried this with Battle for Wesnoth. Ideally, the game is supposed to run fullscreen, but we still have the top bar from matchbox(?) staying there and making a part of the game's screen missing and unusable.

parazyd commented 6 years ago

Further testing shows mpv is actually able to do fullscreen in h-d (on the n900 at least). Games like freedoom still leave the top titlebar.

android-808 commented 6 years ago

Both game examples you have given (freedoom and Wesnoth) use libsdl1.2 on Maemo. libsdl1.2 in Fremantle contains several fullscreen related patches. Might be worth checking them out.

http://maemo.org/packages/source/view/fremantle_sdk_free_source/libsdl1.2/1.2.13-2maemo8+0m5/

Additionally, this package contains the /etc/osso-af-init/sdl.defs that is currently being looked for during login/startup, which just specifies to use the Pulse driver. IIRC it disables all other audio drivers via another patch.

android-808 commented 6 years ago

First off, this is 100% untested. Literally all I know is this will build under scratchbox for a Fremantle X86 target.

I can't find all the source packages in Debian to track all changes since the Maemo build, so I've just used the active Maemo specific patches listed in the series file and refreshed them against a stock version of 1.2.15. Debian have there own patches so these could be applied on top of those for more potential fixes. Most are relating to dfsg. If this version fixes the issue the other patches could be added as necessary.

Edit: removed broken sources.

android-808 commented 6 years ago

This fails to build on Leste at the moment due to bug 1769 in SDL, redefind _XData32 and packaging issues. Several patches exist such as https://git.yoctoproject.org/cgit.cgi/poky/plain/meta/recipes-graphics/libsdl/libsdl-1.2.15/libsdl-1.2.15-xdata32.patch or https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/media-libs/libsdl/files/libsdl-1.2.15-const-xdata32.patch. I'll try to look further over the weekend.

android-808 commented 6 years ago

Leste build now working. This is based on the current Debian Stretch version.

What's not included: Maemo /etc/osso-af-init/sdl.defs file referred to during boot, just exports a default audio driver. Maemo conf flags.

Tested with freedoom/prboom-plus. Stock SDL allows seamless transition between fullscreen and windowed using ALT+Enter but still shows titlebar in both and crops the games status bar. This version is displayed correctly in both modes but transition between screen modes will show task manager when encountering certain conditions. Window to Full is OK but Full to Window shows task manager or vice versa, can't remember off hand.

All Maemo patches are included AFAIK. Some of these may not be needed anymore, I imagine pulseaudio/libcanberra might be friendlier.

zip includes all sources (orig, debian, dsc, changes etc) and an amd64 deb libsdl1.2_1.2.15+dfsg1-4+maemo1.zip

android-808 commented 6 years ago

As osso-* games preinstalled are AFAIK derived from those by lgames I thought I'd give it a test.

LMarbles: Corrupted config error whenever it starts. Fullscreen option does nothing. LTris: Fullscreen to windowed causes task manager to show. NB: Fullscreen changes Virtualbox window size as it doesn't use native display size as fullscreen.

MerlijnWajer commented 6 years ago

@parazyd - can you try out if this helps?

MerlijnWajer commented 6 years ago

@android-808 - perhaps we should have a ticket just for your libsdl port/work? I'm also toying with #169, and I'll probably need it there too.

android-808 commented 6 years ago

In fairness I haven't touched it since submitting my last post. I did start looking at the sources available for the games frontend used by Marble, Chess (iirc) and some of the emulators. In terms of a user experience, I felt this would be a good target for creating a more consistent UI.

Unfortunately, I haven't had much time lately to look any further. As I mentioned before, all the games mentioned by parazyd use SDL so feel free to spin this off as a different issue but remember that the reason SDL needs patching is because of the way HD/MB handle fullscreen.

MerlijnWajer commented 5 years ago

I build your zip, but I don't get freedom and prboom-plus in fullscreen mode. Is there anything I have missed?

MerlijnWajer commented 5 years ago

gngb works though, in full screen mode.

android-808 commented 5 years ago

I'll take a look, I can't remember.

There is a command line option to force: prboom -fullscreen -width 800 -height 480

There may be a setting under Options>General

MerlijnWajer commented 5 years ago

This works. Maybe I was not using it right.

MerlijnWajer commented 5 years ago

So it sounds like we might want to carry this libsdl in our maemo repository.

MerlijnWajer commented 5 years ago

cc @spinal84 - it's fun to see how well this works:

prboom-plus -fullscreen -width 800 -height 480

freedoom1 -fullscreen -width 800 -height 480

gngb -f Pokemon\ -\ Blue\ Version\ \(UE\)\ \[S\]\[\!\].zip -R 800x480 -s -Y

android-808 commented 5 years ago

Might be worth trying other apps. Don't know if recent updates have fixed the issues I noted with the patches earlier. Like fullscreen toggle sometimes sending you to task switched instead. Might be worth checking if they are all still needed as I can't remember without looking what was included. The other option would be patching h-d/matchbox to handle requests in a more compatible way to avoid having to patch other apps/libraries as well although in my experience all seem to cope on Fremantle except SDL1.2.

Not sure if any of the patches are needed in SDL2 as well. I didn't incorporate them when I did a test build on Fremantle mentioned in another issue (Anbox) because I couldn't get the app that needed it to build.

I had intended on porting the hildon game frontend/launcher code used by Marble, DrNokSnes etc but didn't get around to it. There were some other media related packages fmg ported that were missing that it required.

android-808 commented 5 years ago

So, GitHub reply via email doesn't keep formatting. Sorry about that.

I forgot, once run with the fullscreen flag, it should, from what I've read, remember that and the resolution when next launched. Might also be worth looking at Fremantle version of prboom for key config they used.

MerlijnWajer commented 5 years ago

I would love to get this moving and have some applications on Maemo Leste that we can demo/ship by default (currently only three applications is not very impressive).

Do you think you could send me some links to the missing packages that were ported? And would you be willing to port some of the games, like Marble and DrNokSnes?

We can add them to Jenkins afterwards and have it work in our CI.

dderby commented 5 years ago

It would be nice to see Accelemymote ported too. There are some games designed to be used by a mouse which don't control very well with touch input. For example in Doom-clones like Quake 2 or Aliens versus Predator, it feels much more natural to look around to with the accelerometer instead of dragging across the touchscreen, which also obscures the display. Maybe we could even integrate an option into system settings to enable the accelerometer as an input device/joystick.

android-808 commented 5 years ago

I think something like a small set of games, file manager, image viewer and a simple browser would be a nice default set.

osso-games-startup is required to port DrNokSnes, PicoDrive and the built in Marbles, Mahjong, Chess and Blocks (Most are in http://repository.maemo.org/pool/maemo5.0/free/o/ and free/m/ for maemoblocks). Those packages also need their respective gfx and sound packages such as osso-graphics-game-mahjong and osso-sounds-game-mahjong but I don't know where they are but open/replacement/usable components are listed as being available https://wiki.maemo.org/Porting/Closed_Packages

Currently there is no repo setup for osso-games-startup in Leste . Not sure if the original source repo is mirrored anywhere to fork from. Latest I can find is http://maemo.org/packages/source/view/fremantle_sdk_free_source/osso-games-startup/1.7.49-1+0m5/

In terms of porting so far I've identified:

MerlijnWajer commented 5 years ago

The way we currently operate is to have repos for all of these packages under maemo-leste/ (except for translation and/or gfx/sound/resources, those are just imported), and then add them to our jenkins instance. I'd be glad to add you to the maemo-leste organisation and give you a jenkins account as well, that is, if you're up for doing some of this work. (The only things that currently only parazyd and I do can do is actually add a repo to our jenkins so that it can be build by others/us)

MerlijnWajer commented 5 years ago

@dderby - I invite you to make tickets for every package you'd like to see ported, btw. (Same for others, of course)

dderby commented 5 years ago

I'm not sure if my suggestion warrants a ticket just yet, I'm really just thinking out aloud. ;) There are much more important things to fix first. I'll open a ticket for this when the time is right.

android-808 commented 5 years ago

I'll open a ticket to add osso-games-startup to repo. I can fork and create pull requests should I have time to work on it further.

MerlijnWajer commented 5 years ago

@dderby - tickets are cheap, just create them. ;)

MerlijnWajer commented 5 years ago

@android-808 - alright, that would be much appreciated! I send you a request to join the orga, then you can at least make a repo to file a PR against. ;)

MerlijnWajer commented 5 years ago

BTW - @android-808 - do you have working keyboard/touch input using your libsdl? Bencoh and I both don't have working input with your libsdl.

android-808 commented 5 years ago

Not tested on an actual device. Keyboard works in virtualbox.

MerlijnWajer commented 5 years ago

On the Droid4 and the N900 we don't seem to have any keyboard input.

android-808 commented 5 years ago

320_no_fullscreen_grab.diff Is there to enable passive key grab (apparently) such as volume applet but shouldn't affect it as it is still the app in focus. There may have been some more patches I didn't port so I'll have to go through it again. While I'm at it I'll look to pull in the newer upstream version.

Have you tried stock Devuan SDL to see if it is affected there?

android-808 commented 5 years ago

Also of note, if testing with prboom, the default key to access menu is escape, which isn't present on the N900.

MerlijnWajer commented 5 years ago

I also had trouble using gngb (gameboy emulator). I could be that all the keys I pressed were not used by the application, but I would be slightly surprised if this was the case. Do you have a N900 or Droid to test this on?

android-808 commented 5 years ago

I have one that I use daily so can't afford to mess around with. Can you do a quick test of stock SDL on both devices, then I know it must be something I've changed. Going over input related fixes there really isn't much though.

Also, do we have a source the graphics/sound debs for the osso-* games like Marble, Chess and Mahjong? I've nearly got enough done to build a test of one of them but I need usable debs for those and it requires osso-games-il8n related debs so I don't know what to do with those

MerlijnWajer commented 5 years ago

@parazyd - should we import those? I assume they'll be arch: all. It's probably similar (license wise) to the translation and theme packages. We'll need to resolve that eventually.

Regarding testing, I think bencoh (on IRC) said that reverting to stock SDL made input work in gngb. I will try it myself today as well.

BTW: If you would like a device, I can try to send one to you. I have about 5 spare N900 devices and more than 5 spare droid4 devices.

parazyd commented 5 years ago

Yes, it's fine to import them, just as we have tthe other l10n packages.

@android-808 If you can point me to where I can find the asset debs, I can put them in the Leste repository.

parazyd commented 5 years ago

@android-808 I imported osso-sounds and osso-games-l10n packages into the Leste repo.

android-808 commented 5 years ago

For the osso-graphics-games- and osso-sound-games- debs, I'm not sure if we can use them as they're on the list of closed debs on Maemo wiki. There are some replacements in Maemo extras repos, such as libre-mahjong.

Originals were at downloads.maemo.nokia.com/fremantle/ssu/mr0/ There are mirrors of this in several places.

As for SDL, can someone with a device try building it with the 310-350 patches (the Maemo bits) disabled except for 340*. I think this is the main fullscreen fix so if it works I can worry about the rest later.

MerlijnWajer commented 5 years ago

I would argue that right now, we should keep the debs in the repo, unless a free package is available. It is my understanding that translations, sound and such can be hosted on maemo.org infra without legal issues. (And our repository is on maemo.org)

Regarding the patch, I can try it a bit later.

MerlijnWajer commented 4 years ago

I tried the zip here, and it makes brainparty work OK in fullscreen mode. https://github.com/maemo-leste/bugtracker/issues/18#issuecomment-370149219

MerlijnWajer commented 4 years ago

Can we get a maemo-leste/libsdl repo going? ;)

android-808 commented 4 years ago

Didn't you have a input problem with that version or is that now working? I don't test on a real device so your in a better position to decide if it's ok to import. https://github.com/maemo-leste/bugtracker/issues/18#issuecomment-478292037

My last post here I said about trying with some patches disabled to try to isolate the input issue. Patch 340 iirc is the main full screen fix. Matchbox/HD handles windows slightly differently than SDL expects.

MerlijnWajer commented 4 years ago

Right. I think a repo with auto builds for me makes it easier to test & fix, so I'll try to get one going, with the right history (?), patches applied, and then figure out what patch should go or not. leste-devel is great playground repo/component for this.

android-808 commented 4 years ago

I don't have a repo for SDL on GitHub. So long ago now I think I just downloaded files from maemo.org and edited them. Most changes are in the patches folder so should be easy to diff if you can find correct repo.

MerlijnWajer commented 4 years ago

I think that would be: https://salsa.debian.org/sdl-team/libsdl1.2

And then just add the patches. Will try to do it in a bit, once all the python stuff is in the repo.

android-808 commented 4 years ago

Not quite. We would miss commits for Maemo patches. I've got to finish getting ready for today but I'll try to search around a bit.

MerlijnWajer commented 4 years ago

Understood.

MerlijnWajer commented 4 years ago

I'm temporarily put libsdl here - https://github.com/maemo-leste/libsdl

Without any history, so let's fix that. It's also build for leste-devel.

clort81 commented 4 years ago

For testing libsdl-haa fullscreen here is a helpful little proggie!

gcc -o fullscreen sdl-config --libs --cflags -lSDL_haa fullscreen.c

http://git.maemo.org/git/?p=sdlhildon;a=tree;f=sdlhaa/test;h=8bcf8050a8e2c1cfacc5078a9f6fdfa8fd47a7ae;hb=HEAD

IMbackK commented 3 years ago

I wrote a test app that creates fullscreen windows:

https://github.com/IMbackK/fullscreenXlib

Note that the EWMH method works fine on hildon, while a window that trys to take over the xserver as was common pre-EWMH fails on hildon

IMbackK commented 3 years ago

also note that i3lock also has the same problems as other applications and creates a fullscreen window using the evil ICCCM era override redirect method, like the test app in ICCCM mode

see https://github.com/i3/i3lock/blob/4f76d51a3f79082e01b319e9031aad868d89449d/xcb.c#L139

with override redirect activated the wm cant frame the window or reparent it, instead it can only use x10 style wm facilities.

anyhow, hildon manages to break this as it has, as a composing wm, the final say over renderd surface placement and places it underneath the pannel. but with override redirect the underlying x11 window cant be placed by hildon like it expects. so the rendered surface and the xwindow get out of sync

anyhow as _NET_WM_STATE_FULLSCREEN works fine we need to ensure clutter/the hildon rendering pipeline treats windows with OVERRIDE_REDIRECT the same as windows with _NET_WM_STATE_FULLSCREEN. This should fix most issues, except some wierd coner cases like ported x10 applications that want to use window borders and x10 style window manipulation.