News:

--

Main Menu

Avidemux 2.6.4 - Minimize to notification area

Started by thany, August 12, 2013, 07:24:34 PM

Previous topic - Next topic

thany

Please add an option to mimize to the notification area*. I do remember this being requested many times over, even years ago...
Anyway, once a process has been started, it glued onto the desktop. The Avidemux main window is immovable, and it cannot be minimzed, nor put to the notification area.

Yes, I KNOW there's an option for this in the preferences. But first of all: it doesn't work. It's checked and the encoding process DOESN'T go to the notification area. Secondly, it doesn't solve the problem of when restoring it from the notification area, you need to be able to put it back in. Which you can't. So again, for those who insist this is the solution: isn't not.

* some people strangely still prefer the term systray.

/edit
Ok, so moving to the notification area by the preferences only works for pass 2. That's clearly a bug. But it still doesn't offer any way of putting it back after restoring it from the notification area.

mm0359

v2.6.8 - v2.6.14(_161031): (Windows XP and Vista, win32.)

1- Preference works, but for pass 2 only.

I don't know. (I think I use 1-pass only.)

2- Open Avidemux (= "Unminimizing") doesn't restore maximized state, if the window was maximized before.

Could it be possible to save and restore the maximized state?

3- No way to minimize (again) from the GUI.

Could it be possible to add a button (for example) to do that?

eumagga0x2a

#2
Quote from: mm0359 on November 03, 2016, 04:56:46 PM
v2.6.8 - v2.6.14(_161031): (Windows XP and Vista, win32.)

1- Preference works, but for pass 2 only.

I don't know. (I think I use 1-pass only.)

2- Open Avidemux (= "Unminimizing") doesn't restore maximized state, if the window was maximized before.

Could it be possible to save and restore the maximized state?

This won't help you, sure, but both 1. and 2. work on Linux/GNOME impeccably (edit: yes, you're right, the first pass doesn't minimize).

Quote3- No way to minimize (again) from the GUI.

Could it be possible to add a button (for example) to do that?

Again, works fine on Linux using the context menu of the window manager. I already offered you help evaluating and performing migration.

eumagga0x2a

Quote from: eumagga0x2a on November 03, 2016, 05:26:09 PM
Quote from: mm0359 on November 03, 2016, 04:56:46 PM
v2.6.8 - v2.6.14(_161031): (Windows XP and Vista, win32.)

1- Preference works, but for pass 2 only.

I don't know. (I think I use 1-pass only.)

[...] yes, you're right, the first pass doesn't minimize.

"Minimize to tray" is implemented in DIA_encodingQt4::DIA_encodingQt4 within the encoding dialog, which gets called from ADM_muxer::initUI which gets called from muxerFFmpeg::saveLoop which gets called from the respective muxer's save function.

A different dialog is created (and destroyed) for the first pass from within admSaver::handleFirstPass in avidemux/common/gui_savenew.cpp. As gui_savenew.cpp can't include Qt stuff directly, I don't see how this issue could be solved without major undertakings like creating a unified dialog for the first and the second pass.

eumagga0x2a

Quote from: eumagga0x2a on November 03, 2016, 05:26:09 PM
Quote from: mm0359 on November 03, 2016, 04:56:46 PM
3- No way to minimize (again) from the GUI.

Could it be possible to add a button (for example) to do that?

Again, works fine on Linux using the context menu of the window manager.

Upon looking closer, this minimizing is not the real thing. It is the normal minimizing which doesn't remove the window from the gnome-shell overview. Additionally, while Avidemux stays minimized to the notification area (more precisely, a surrogate solution gnome-shell can offer), at least gnome-shell doesn't display any progress information (don't know how Plasma would behave).

Even more, while unminimizing Avidemux from the notification area on Linux during encoding preserves the maximized state of the window, the window normalizes itself once the encoding is completed (the window returns correctly to the maximized state if Avidemux has been allowed to finish the encoding minimized to the notification area).

On Linux, where all desktop environments offer multiple virtual workspaces, this whole feature is entirely redundant IMHO. It is a valid feature on Windows pre Windows 10, of course.

I feel the most sympathy with an option to add a button to the encoding dialog to minimize the Avidemux window at any moment (again) to the tray as this thing is called throughout the code. As a bonus, such solution would allow to remove the preference setting.

eumagga0x2a

Quote from: eumagga0x2a on November 05, 2016, 10:41:04 PM
I feel the most sympathy with an option to add a button to the encoding dialog to minimize the Avidemux window at any moment (again) to the tray as this thing is called throughout the code. As a bonus, such solution would allow to remove the preference setting.

I pushed a patch implementing this to https://github.com/eumagga0x2a/avidemux2/commits/encoding-minimize-to-ntfa, but did not open a pull request yet pending feedback from Mean.

I do feel that minimizing to notification area is not a decision a user has to make in advance, thus moving it to the dialog which ultimately gives this decision a context and removing a preference setting which raised the expectation articulated in the opening of this topic would be a reasonable step.

mean

I'll be away for a couple of days
I can take the merge now, it will be reverted if it is not ok

eumagga0x2a

I wanted to know...

a) if you are okay with removal of the preference setting;

b) if the "minimize to notification area" feature works on Mac at all. Otherwise some precautions must be taken not to expose a dysfunctional button on MacOS.

The patch has been tested on Linux and WFM.

eumagga0x2a


mean



eumagga0x2a

A few takeaways from a brief testing of the latest nightly on Windows 7:

a) Confirming the issue with window always unmaximizing when restoring from a notification area icon, will look into it;

b) The first pass should be redesigned, maybe later;

c) The add filter dialog needs a solution for selection marks extending into the right column, no idea if I could be of any help here, but will look into it.

Minimizing again to "tray" again works nicely now.

eumagga0x2a

Quote from: eumagga0x2a on November 08, 2016, 07:22:21 AM
a) Confirming the issue with window always unmaximizing when restoring from a notification area icon, will look into it;

I've pushed [Qt] Restore correct window state upon finishing encoding while minimized to notification area which fixes for sure the only thing which was wrong on Linux as well: If a maximized Avidemux window was minimized to notification area (ntfa) while encoding and subsequently restored from ntfa with encoding still running, the window unmaximized itself at the same moment the encoding was over.

I can't test if the changes for UI_iconify and UI_deiconify functions fix the more broad issue on Windows because I don't have a working build environment for cross-compiling Avidemux and all the stuff it relies on. Once Mean is back, I'll probably open a new pull request.

eumagga0x2a

After looking at ADM_qtray_signalReceiver::restore in avidemux/qt4/ADM_userInterfaces/ADM_gui/ADM_qtray.cpp, I'm now pretty confident that the issue on Windows is completely fixed by the last commit.

eumagga0x2a

Quote from: eumagga0x2a on November 08, 2016, 07:22:21 AM
a) Confirming the issue with window always unmaximizing when restoring from a notification area icon, will look into it;

b) The first pass should be redesigned, maybe later;

c) The add filter dialog needs a solution for selection marks extending into the right column, no idea if I could be of any help here, but will look into it.

While "a" should be fixed now, "c" can be worked around by forcing some background color for QListWidget with a stylesheet:

diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_filters/Q_mainfilter.cpp b/avidemux/qt4/ADM_userInterfaces/ADM_filters/Q_mainfilter.cpp
index cb9c0e6..f8ecb18 100644
--- a/avidemux/qt4/ADM_userInterfaces/ADM_filters/Q_mainfilter.cpp
+++ b/avidemux/qt4/ADM_userInterfaces/ADM_filters/Q_mainfilter.cpp
@@ -460,6 +460,8 @@ filtermainWindow::filtermainWindow(QWidget* parent) : QDialog(parent)
     
#if 1 //def NO_DELEGATE   
     activeList->setSelectionMode(QAbstractItemView::SingleSelection);
+    // ugly hack to stop selected list items from the list of available filters getting painted over the active list
+    activeList->setStyleSheet("QListWidget { background-color: #ffffff; }");
     activeList->setDragEnabled(true);
     activeList->setDragDropMode(QAbstractItemView::InternalMove);
     activeList->setDropIndicatorShown(true);


But we can't assume that QPalette::Base is always white, can we? A more civilized approach

diff --git a/avidemux/qt4/ADM_userInterfaces/ADM_filters/Q_mainfilter.cpp b/avidemux/qt4/ADM_userInterfaces/ADM_filters/Q_mainfilter.cpp
index cb9c0e6..2a4bf04 100644
--- a/avidemux/qt4/ADM_userInterfaces/ADM_filters/Q_mainfilter.cpp
+++ b/avidemux/qt4/ADM_userInterfaces/ADM_filters/Q_mainfilter.cpp
@@ -460,6 +460,8 @@ filtermainWindow::filtermainWindow(QWidget* parent) : QDialog(parent)
     
#if 1 //def NO_DELEGATE   
     activeList->setSelectionMode(QAbstractItemView::SingleSelection);
+    activeList->setBackgroundRole(QPalette::Base);
+    activeList->setAutoFillBackground(true);
     activeList->setDragEnabled(true);
     activeList->setDragDropMode(QAbstractItemView::InternalMove);
     activeList->setDropIndicatorShown(true);


doesn't work.