Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Haiku: disable qtsingleapplication #197

Closed
wants to merge 1 commit into from
Closed

Conversation

korli
Copy link

@korli korli commented Sep 17, 2018

No description provided.

@gottcode
Copy link
Owner

Why does Haiku need QtSingleApplication disabled? I would prefer to fix it if possible rather than just disable it.

@khallebal
Copy link

I am the one who disabled it, and i don't know how to fix it, maybe @korli or @3DEYES could explain as to why in case a Qt app in haiku crashes or locks up you can't relaunch it, the only workarounds are to reboot or remove "qtsingleapp-xxxxx-xxxx-x-lockfile" file from the /tmp dir.

@gottcode
Copy link
Owner

Does haiku support QSharedMemory? I think I may have found a way to replace the lockfile with that.

FocusWriter was written with the assumption that there is only one instance running, and it would require a massive rewrite to ensure that multiple instances wouldn't clobber things like the emergency cache or the daily progress. Because of that, I am not going to merge this pull request.

@gottcode gottcode closed this Sep 20, 2018
@khallebal
Copy link

Hi, @gottcode

Does haiku support QSharedMemory?

I'm not sure, but i believe it doesn't, does your solution involves QSharedMemory?

@gottcode
Copy link
Owner

@khallebal Yes, unfortunately. What about QLockFile? Does haiku support that? If you need to test to find out, I could push a branch to GitHub for you to try.

@khallebal
Copy link

I could push a branch to GitHub for you to try.

@gottcode , Please do so, as i don't know if haiku supports QLockFile either.

@gottcode
Copy link
Owner

@khallebal I have made a qlockfile branch for you to test. Thanks!

@gottcode
Copy link
Owner

I set up a haiku nightly build in a virtual machine. The QSharedMemory version does indeed have issues, but the QLockFile branch works. As does the current version! If I kill FocusWriter, it leaves the lockfile, but that doesn't prevent it from starting up again for me. Are you sure it needs to be fixed?

@khallebal
Copy link

khallebal commented Sep 22, 2018

If I kill FocusWriter, it leaves the lockfile, but that doesn't prevent it from starting up again for me

I did the exact same thing and got the same result, so yes this fix is needed for haiku, thanks alot for fixing this.

Now that this is done, i have a patch i'd like to submit(if it's okay with you), which is just a few additions to the "make install" routine in the .pro file (haiku has a different structure than most unix's) and a resource file which includes the icon as resources.

You seem to know Qt quite well, so i'm gonna ask you something.
Is there a way for qmake to call external cmds to do some operations?
In haiku, the icon of an app is injected to the binary using the following cmds.
eg:

`rc focuswriter.rdef`

Which produces the binary "focuwriter.rsrc"
then

`xres -o /path/to/focuswriter focuwriter.rsrc`

to inject the resources
and then you call

`mimeset -f /path/to/focuswriter`

to set the mime type & save the resources.
Finaly i have an issue with the sounds which don't work, but before i open an new issue i want to make sure that's not a haiku problem
If i run it from terminal i get the following:

`using null output device, none available`
`QCoreApplication::postEvent: Unexpected null receiver`

@gottcode
Copy link
Owner

I did the exact same thing and got the same result, so yes this fix is needed for haiku, thanks alot for fixing this.

I'm sorry, I'm confused. Are you saying the qlockfile branch works? Or the master branch? The part you quoted was from me testing the master branch and finding no changes were needed.

Now that this is done, i have a patch i'd like to submit(if it's okay with you), which is just a few additions to the "make install" routine in the .pro file (haiku has a different structure than most unix's) and a resource file which includes the icon as resources.

Sure, open a pull request and I will take a look.

You seem to know Qt quite well, so i'm gonna ask you something.
Is there a way for qmake to call external cmds to do some operations?
In haiku, the icon of an app is injected to the binary using the following cmds.
eg:

`rc focuswriter.rdef`

Which produces the binary "focuwriter.rsrc"
then

`xres -o /path/to/focuswriter focuwriter.rsrc`

to inject the resources
and then you call

`mimeset -f /path/to/focuswriter`

to set the mime type & save the resources.

I think you could probably use QMake's external commands to do that, but I'm not sure. FocusWriter can't be the first Qt program ported; how do the others solve this?

Finaly i have an issue with the sounds which don't work, but before i open an new issue i want to make sure that's not a haiku problem
If i run it from terminal i get the following:

`using null output device, none available`
`QCoreApplication::postEvent: Unexpected null receiver`

Sorry, nothing I can do. Haiku apparently doesn't support QSoundEffect, which is how FocusWriter plays sounds.

@khallebal
Copy link

I'm sorry, I'm confused. Are you saying the qlockfile branch works? Or the master branch? The part you quoted was from me testing the master branch and finding no changes were needed.

I meant the qlockfile branch, but i tried again with the master branch just now and it also worked!, does it make a difference whether the app actually crashes or not? because when it crashed it didn't relaunch until i flushed the /tmp dir, that's why i submitted the patch in the first place.
Oh well, i suppose there is nothing more you could do, thanks alot for all your help, i will try to crash it and see how it behaves.

I'll submit my patch tomorrow.
regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants