Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. App UI is freezing after returning from Windows Lock screen.
Qt 6.11 is out! See what's new in the release blog

App UI is freezing after returning from Windows Lock screen.

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 309 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    zkrzysztoff7
    wrote on last edited by
    #1

    Hi,
    I'm trying to create something similar to sliding notification windows near system tray. Notifications data will be stored in a ListModel later on, so to maximize simplicity I used Repeater, Loader, and Window with appropriate flags (Loader was used because Repeater as a delegate requires an element derived from Item)

    I noticed that the application can freeze, especially when the user is on the login screen (WinKey + L for quick access there) After returning from this screen, the application interface is frozen. Not always but often, I also noticed that this has some connection to the x/y coordinates when creating the notification window. If I set them somewhere off-screen, it freezes much more frequently after returning from the lock screen

    I've prepared a minimalistic code fragment that frequently triggers the mentioned problem. On my laptop it's enough to go to the lock screen (WinKey + L) 2-3 times to freeze the UI. On much stronger PC its way more difficult to reproduce it at least for me.

    import QtQuick
    
    Window {
      width: 640
      height: 480
      visible: true
      title: qsTr("Hello World")
    
      Rectangle {
        id: animatedRect
        anchors.centerIn: parent
        width: 100; height: 100
        color: "#00FF00"
    
        NumberAnimation {
          target: animatedRect
          properties: "rotation"
          from: 0; to: 360
          running: true
          duration: 500
          loops: Animation.Infinite
        }
      }
    
      Timer {
        interval: 2000
        repeat: true
        running: true
        onTriggered: {
          repeater.model = 0
          repeater.model = 9
        }
      }
    
      Repeater {
        id: repeater
        model: 0
        delegate: Loader {
          sourceComponent: Window {
            x: (Screen.desktopAvailableWidth - 100) + index * 20
            y: (Screen.desktopAvailableHeight - 100) + index * 20
            flags: Qt.Window | Qt.Tool | Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint
            visible: true
            Component.onCompleted: raise()
    
            Rectangle {
              anchors.fill: parent
              color: "#FFCCCC"
              border.color: "#000000"
              border.width: 2
            }
          }
        }
      }
    }
    

    I'm using Qt 6.9.2, on 6.8 this problem doesnt exist for some reason. Perhaps instead of using Repeater/Loader/Window and ListModel, I should dynamically load the component through Qt.createComponent. However, I would first like to understand why my method causes such problems and, if necessary, report a bug.

    Does anyone have any ideas?

    1 Reply Last reply
    1

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved