Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-95741

MainWindow::showMinimized() not working in certain circumstances in GNOME Shell



    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Cannot Reproduce
    • Affects Version/s: 5.12.11, 5.14.2
    • Fix Version/s: None
    • Labels:
    • Environment:
      Ubuntu 18.04, 20.04 and other GNOME Shell systems
    • Platform/s:


      When a GUI application is launched from a $HOME/.config/autostart .desktop file: showing a GUI application with `showMinmized()` doesn't work on Ubuntu 18.04, 20.04 and later GNOME Shell systems: the window is displayed on the screen as if I started it with `showNormal()`, additionally, the minimize window decoration doesn't work.

      Note that it works fine on Ubuntu 16.04.

      I found that if I execute `mainWindow->showNormal(); then wait a few hundred milliseconds, then execute mainWindow->setWindowState(Qt::WindowMinimized);` the window is minimized.

      Steps to reproduce this issue:

      • open the "Main Window" example
      • change `mainWin.show();` in `main.cpp` with `mainWin.showMinimized()`
      • compile
      • set a $HOME/.config/autostart .desktop file to execute the compiled application (sample .desktop file used with our application attached)
      • restart system (user set to automatically login without password - may or may not matter)

      Expected behavior: on startup the application should be running minimzed.

      Actual behavior: on startup the application is shown as a normal window, and the minimize tool in the top window bar does not minimize the window.

      This is a special case of the bug reported in https://bugreports.qt.io/browse/QTBUG-76354 - unfortunately for us, it is also our primary use case.  At present, we are working around the issue by launching a first application with a splash screen that matches the desktop, then launching our 5 other support applications behind the splash screen and after they have been shown, waited a few hundred milliseconds, and been minimized, then the first application drops the splash screen and normal operation proceeds from there.  While this is getting us the desired appearance and functionality, A) it's an ugly kludge, and B) on occasion an application needs to re-launch after system start and we see the application window briefly before it minimizes, which is undesirable in our use case.


        No reviews matched the request. Check your Options in the drop-down menu of this sections header.



            liaqi Liang Qi
            mangocats Mike Inman
            0 Vote for this issue
            2 Start watching this issue



                Gerrit Reviews

                There are no open Gerrit changes