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
How to prevent awesome from quiting from inside async callback attached to exit
signal of awesome?
#3429
Comments
As far as I can tell, And if it really has to be a truly asynchronous callback, then |
i was thinking mb about |
Can you clarify, you want to run this callback later in something like |
the usecase:
|
so ideally i would like it look like this: awesome.connect_signal('exit_async', function(callback)
my_lib.save_state(function()
callback()
end)
end) |
That might be a shitty question, but: can't you just make it optionally synchronous? This seems like a lot of complexity just to turn an async call into a sync one. Or if you can get your hand on the glib main loop object, you can just block on it? |
i wonder is there any relatively painless way to do? awesome.connect_signal('exit', function()
some_lib.wait(function(callback)
my_lib.save_state(function()
callback()
end)
end)
end) |
(this is a copy/paste from the other issue, because I failed at paying attention) I don't think "just" running something in
Reading https://www.freedesktop.org/software/gstreamer-sdk/data/docs/2012.5/glib/glib-The-Main-Event-Loop.html , I think you need to get the look context and acquire it, then
Doing the thing above can work. But that's still more work and hacky-er than just having a synchronous version of your state saving function. |
in my particular case restoring sync version of save function was only 4 lines of code, but in general i think that's still quite a problem, especially for checking unsaved apps, as you mentioned before offtopic:
(i know what both should be handled by apps called Session Managers, and i even tried using 3 of them, from GNOME, XFCE and MATE for quite a while, but rewriting it in couple of lines of lua at the end was working less buggy) |
what do you think about having smth like this? awesome.connect_signal('exit', function()
awesome.cancel_exit()
my_lib.so_smth(function()
awesome.exit()
end)
end) |
Yeah, that would work |
No description provided.
The text was updated successfully, but these errors were encountered: