0

When I turn off monitor (by power button), my gtk4 app gets closed with no output and return code 0. From what I've read, it might be some interaction between wayland and gtk4, but I've found no fix except restarting app via some daemon listening for new monitors.

How can I keep my app open? Most apps do not close, but they are not in gtk4, so no idea if it's a bug or my misuse.

When trying to open the app without any monitors I get

Gdk-Message: 10:32:23.553: Error 22 (Bad argument) dispatching to Wayland display.

EDIT It seems that, when monitor disappears, destroy signal is called on the window, and since it's the only window application stops.

I can guess then that there is nothing to keep the ref-counted Window alive, and since I must create window after connect_activate of app, and in main thread, there is no way to store the reference anyway.

So it looks like it all was done on purpose and I'm supposed to recreate windows when new monitors appear, which is annoying but doable.

2
  • That sounds like a bug, can you see if its crashing? Like with coredumpctl Commented Jul 7 at 21:45
  • @TingPing coredumctl shows nothing, program returns exit code 0 and debug print after app.run() is displayed. So I'm pretty sure there is no crash, just normal exit of gtk4::Application Commented Jul 9 at 18:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.