Opened 9 years ago

Closed 8 years ago

#5058 closed Bug (fixed)

Qt client closed when the Open file dialog cancelled

Reported by: martonmiklos Owned by: jordan
Priority: Normal Milestone: 2.76
Component: Qt Client Version: 2.71
Severity: Normal Keywords:
Cc:

Description

Problem description: Enable system tray icon. Choose Open Cancel the dialog

Behaviour: Transmission closed

Expected behaviour: Transmission should not get closed

Affected and tested revisions: Latest svn trunk, 2.6.0

Bug reason: All Qt widgets of type Qt::Window have the Qt::WA_QuitOnClose attribute set by default. After closing these kind of dialogs if no other widgets are visible the application gets closed.

It could be eliminated by disabling this behaviour for the whole application with the setQuitOnLastWindowClosed method of the QApplication, or by clearing the Qt::WA_QuitOnClose attribute on the affected widgets.

Which method would you prefer?

If we disable it globally we need to add a closeEvent handler to every dialog which could present as a single window, where we need to determine that the system tray is enabled or not.

Or we can add this attribute disabling to these dialogs depending on the system tray enabled status. Of course it would bring up the question how should we handle if the user enablse/disables the tray runtime.

Change History (8)

comment:1 Changed 9 years ago by jordan

I guess I'd prefer disabling it globally. That way we don't have to keep adding special cases each time we add a new dialog into the codebase.

comment:2 Changed 9 years ago by rb07

But it doesn't affect all dialogs, only the ones that can be opened from the context menu on the system tray (3 if you count the "Message Log"). The "About" panel doesn't close the app.

There's an alternative, the panels could bring the application out of minimized, not just present the panel.

comment:3 Changed 9 years ago by jordan

It doesn't affect all dialogs, but the global case doesn't hurt the other dialogs either.

comment:4 Changed 9 years ago by rb07

Jordan, I'm not sure, I was thinking of the close button on the main window, if that attribute affects closing the application when that button is used instead of the menu Quit.

Besides, following martonmiklos description it sounds like a very convoluted change (adding closeEvent handlers).

But the change as I proposed is not applicable to the "Open URL" panel, which uses a QInputDialog::getText which I can't find a way to change the WA_QuitOnClose attribute. Not a big deal for me, I was getting rid of that panel and using one with the full set of options (download location, start when added).

comment:5 Changed 8 years ago by mike.dld

Seems to be fixed indirectly by patch from #5206 (r13733).

comment:6 Changed 8 years ago by jordan

  • Milestone changed from None Set to 2.76

comment:7 Changed 8 years ago by Robby

Should this be closed as "fixed"?

comment:8 Changed 8 years ago by jordan

  • Resolution set to fixed
  • Status changed from new to closed

Sounds like it.

Note: See TracTickets for help on using tickets.