Bug 496963 - Qt program using layer-shell-qt exited after screen turn-off
Summary: Qt program using layer-shell-qt exited after screen turn-off
Status: REPORTED
Alias: None
Product: layer-shell-qt
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Aleix Pol
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-02 22:15 UTC by Viet Dang
Modified: 2024-12-02 22:15 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Viet Dang 2024-12-02 22:15:20 UTC
SUMMARY

A Qt program using layer-shell-qt would exit itself if the screen is turned off.

It did not seem to crash, just exited by itself.

Minimal program below.

Could you please take a look?

Thanks,

Viet

—

Minimum program:

#include <QApplication>
#include <QWidget>
#include <QWindow>

#include <LayerShellQt/Window>

int main(int argc, char** argv) {
  QApplication app(argc, argv);

  QWidget dock;
  dock.winId();  // we need this for widget->windowHandle() to not return nullptr.
  auto* layerShellWin = LayerShellQt::Window::get(dock.windowHandle());

  // Same bug if for example this is called instead:
  // layerShellWin->setAnchors(LayerShellQt::Window::AnchorBottom);
  layerShellWin->setLayer(LayerShellQt::Window::LayerBottom);

  dock.show();

  return app.exec();
}


STEPS TO REPRODUCE
1. Build and run the program
2. Wait for screen to turn off (e.g. 1 minute of inactivity while screen is locked)
3. Reactivate screen

OBSERVED RESULT
Program exited itself.

EXPECTED RESULT
Program should stay alive.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: OpenSUSE Tumbleweed (also happens on Fedora 41, Kubuntu 24.10 etc.)
KDE Plasma Version: 6.2.2
KDE Frameworks Version: 6.7.0
Qt Version: 6.8.0

ADDITIONAL INFORMATION