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

showMinimized() misbehave when called from closeEvent under Linux/X11

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.3.0
    • 5.2.0, 5.3.0 Beta1
    • GUI: Window management
    • None
    • Archlinux x64(KDE), Manjaro x86(Xfde), Ubuntu 13.10 x64(Gnome fallback)
    • d668f1be22c0e0219c02bcc6928a825ca4f33e42

    Description

      # -*- coding: utf-8 -*-
      
      from PyQt5.QtWidgets import QMainWindow, QApplication
      
      class Dummy(QApplication):
          mainWin = None
          def __init__(self, *args):
              super().__init__(*args)
      
              self.mainWin = MainWin()
              self.mainWin.show()
      
      class MainWin(QMainWindow):
          def __init__(self):
              super().__init__(None)
      
          def closeEvent(self, qEvent):
              qEvent.ignore()
              self.showMinimized()
              # same happens to self.setWindowState(Qt.WindowMinimized) 
      
      if __name__ == "__main__":
          app = Dummy([])
          app.exec()
      

      ===========================================
      The code above is misbehaving under Linux/X11. I tested this on Archlinux(KDE), Manjaro(Xfde), Ubuntu 13.10(Gnome fallback), they all went wrong in a same way.

      1. click the close button, it minimizes to the taskbar as expected
      2. click the taskbar to restore the window, working
      3. click the close button again, nothing happens.
      4. no matter how many times you try from now on, nothing happens.

      The same code works on Windows 7 without problems.

      This is not with PyQt for sure. I tried with the C++ version under Linux as well. Same problem.

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-37695
          # Subject Branch Project Status CR V

          Activity

            People

              lagocs Laszlo Agocs
              xinkai Xinkai Chen
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes