Bug 248943 - Annoying and dangerous number input fields in editor
Summary: Annoying and dangerous number input fields in editor
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Usability-Ergonomy (show other bugs)
Version: 1.2.0
Platform: Ubuntu Linux
: NOR major
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-24 23:29 UTC by Alain Knaff
Modified: 2017-08-09 15:37 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 1.5.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alain Knaff 2010-08-24 23:29:48 UTC
Version:           1.2.0 (using KDE 4.4.2) 
OS:                Linux

In many editor functions (such as free rotation, or Brightness/Contrast/Gamma), focus on number input fields (such as amount of contrast change, or free rotation angle) is lost automatically after a very short time, causing input to be interpreted out of context.

This has potentially disastrous results, as a hesitation is often followed by a correction (using backspace), causing loss of photo.

Reproducible: Always

Steps to Reproduce:
1. Edit picture
2. Enter Brightness/Contrast/Gamma
3. Click on contrast, and start inputting number
4. Hesitate while typing a digit

Actual Results:  
Focus is lost.

Expected Results:  
Focus should not be lost due to hesitation.

OS: Linux (x86_64) release 2.6.32-23-generic
Compiler: cc
Comment 1 caulier.gilles 2010-08-25 16:54:11 UTC
"is lost automatically after a very short time ???"

Gilles Caulier
Comment 2 Alain Knaff 2010-08-25 19:26:32 UTC
Yes, the number input field loses focus after a short while. From then on, most keystrokes are ignored, and backspace is being misinterpreted as "delete current photo". This is not only annoying, but also very dangerous.
Comment 3 caulier.gilles 2010-09-15 09:42:15 UTC
Marcel,

I can reproduce well the problem there.

After investigations, i can said that all EditorToolThreaded tools are affected by this problem, but NOT all EditorTool tools.

To test, BCG tool is multithreaded and settings widget lost focus, ColorEffect tool is not yet multithreaded and do not lost focus.

To add toolSettings()->setFocus() call at en of EditorToolThreaded::slotAbort() do not solve the problem.

Running digiKam through valgrind which slowdown execution, i can see that settings widget do not lost focus when rendering is done, but something take the focus just after that. I can't find which widget exactly.

Any suggestions ?

Gilles Caulier
Comment 4 Marcel Wiesweg 2010-09-15 10:43:29 UTC
void BCGTool::prepareEffect()
{
    kapp->setOverrideCursor(Qt::WaitCursor);
    toolSettings()->setEnabled(false); // HERE
    toolView()->setEnabled(false);

I think the problem reported is a side effect of a general bad habit of this plugin: All the widgets are disabled while rendering. This is acceptable when the user clicked OK, but not if the user was typing in a widget and the preview is generated only because a timer expired.

Is there a technical necessity for calling setEnabled(false)?
Comment 5 caulier.gilles 2010-09-15 10:59:07 UTC
Marcel,

As the preview is rendered in a separate thread, the goal is to prevent that user change settings during rendering process.

Also, why QWidget::setEnabled(false) remove focus to widget. When QWidget::setEnabled(true) is called, Qt4 must set back the focus on the widget.

Gilles
Comment 6 caulier.gilles 2010-09-15 11:31:01 UTC
Marcel,

I commented these lines:

void BCGTool::prepareEffect()
{
...
    toolSettings()->setEnabled(false);
    toolView()->setEnabled(false);
...
}

and these lines :

void BCGTool::renderingFinished()
{
...
    toolSettings()->setEnabled(true);
    toolView()->setEnabled(true);
...
}

This is not solve the problem. The focus is not lost by setEnabled() calls

Note : After to rendre on time the preview, when i press enter, the tool apply the effect. So the keyboard focus are reaffected to buttons on the bottom of tool settings view.

Gilles
Comment 7 Marcel Wiesweg 2010-09-15 19:15:33 UTC
It works fine for me. Did you reinstall the plugin?
You can put a kDebug() << QApplication::focusWidget(); before and after the setEnabled(false) and see that it changes from the spin box to 0x0.

I dont think there is a problem with keeping the boxes enabled. Our filters should be cancellable.
Comment 8 caulier.gilles 2010-09-15 21:21:49 UTC
Marcel,

You has right. It work now at home... I don't know why today, in my office, this patch failed.

I will fix editor tools in this way...

Gilles Caulier
Comment 9 caulier.gilles 2010-09-16 11:16:51 UTC
SVN commit 1175974 by cgilles:

Do not disable settings view from EditorToolthreaded filters during computation, else, keyboard focus is lost into settings view
BUGS: 248943


 M  +0 -15     imageplugins/color/adjustcurvestool.cpp  
 M  +1 -2      imageplugins/color/adjustcurvestool.h  
 M  +0 -15     imageplugins/color/adjustlevelstool.cpp  
 M  +2 -3      imageplugins/color/adjustlevelstool.h  
 M  +0 -18     imageplugins/color/autocorrectiontool.cpp  
 M  +0 -1      imageplugins/color/autocorrectiontool.h  
 M  +0 -14     imageplugins/color/bcgtool.cpp  
 M  +0 -1      imageplugins/color/bcgtool.h  
 M  +0 -14     imageplugins/color/bwsepiatool.cpp  
 M  +0 -1      imageplugins/color/bwsepiatool.h  
 M  +0 -15     imageplugins/color/cbtool.cpp  
 M  +0 -1      imageplugins/color/cbtool.h  
 M  +0 -15     imageplugins/color/channelmixertool.cpp  
 M  +0 -1      imageplugins/color/channelmixertool.h  
 M  +0 -15     imageplugins/color/hsltool.cpp  
 M  +0 -1      imageplugins/color/hsltool.h  
 M  +0 -12     imageplugins/color/profileconversiontool.cpp  
 M  +1 -1      imageplugins/color/profileconversiontool.h  
 M  +0 -15     imageplugins/color/whitebalancetool.cpp  
 M  +2 -3      imageplugins/color/whitebalancetool.h  
 M  +0 -12     imageplugins/decorate/bordertool.cpp  
 M  +0 -1      imageplugins/decorate/bordertool.h  
 M  +0 -12     imageplugins/decorate/texturetool.cpp  
 M  +0 -1      imageplugins/decorate/texturetool.h  
 M  +0 -11     imageplugins/enhance/antivignettingtool.cpp  
 M  +0 -1      imageplugins/enhance/antivignettingtool.h  
 M  +0 -14     imageplugins/enhance/blurtool.cpp  
 M  +0 -1      imageplugins/enhance/blurtool.h  
 M  +0 -15     imageplugins/enhance/hotpixels/hotpixelstool.cpp  
 M  +0 -1      imageplugins/enhance/hotpixels/hotpixelstool.h  
 M  +0 -7      imageplugins/enhance/inpaintingtool.cpp  
 M  +0 -1      imageplugins/enhance/inpaintingtool.h  
 M  +0 -13     imageplugins/enhance/lensautofixtool.cpp  
 M  +0 -1      imageplugins/enhance/lensautofixtool.h  
 M  +0 -18     imageplugins/enhance/lensdistortiontool.cpp  
 M  +1 -1      imageplugins/enhance/lensdistortiontool.h  
 M  +0 -12     imageplugins/enhance/localcontrasttool.cpp  
 M  +0 -1      imageplugins/enhance/localcontrasttool.h  
 M  +0 -14     imageplugins/enhance/noisereductiontool.cpp  
 M  +0 -1      imageplugins/enhance/noisereductiontool.h  
 M  +11 -11    imageplugins/enhance/redeyetool.cpp  
 M  +3 -3      imageplugins/enhance/redeyetool.h  
 M  +0 -12     imageplugins/enhance/restorationtool.cpp  
 M  +0 -1      imageplugins/enhance/restorationtool.h  
 M  +0 -7      imageplugins/enhance/sharpentool.cpp  
 M  +0 -3      imageplugins/filters/blurfxtool.cpp  
 M  +0 -12     imageplugins/filters/charcoaltool.cpp  
 M  +0 -1      imageplugins/filters/charcoaltool.h  
 U             imageplugins/filters/distortionfxtool.cpp  
 M  +0 -12     imageplugins/filters/embosstool.cpp  
 M  +0 -1      imageplugins/filters/embosstool.h  
 M  +0 -8      imageplugins/filters/filmgraintool.cpp  
 M  +0 -12     imageplugins/filters/oilpainttool.cpp  
 M  +0 -1      imageplugins/filters/oilpainttool.h  
 M  +0 -15     imageplugins/filters/raindroptool.cpp  
 M  +1 -1      imageplugins/filters/raindroptool.h  
 M  +1 -13     imageplugins/transform/freerotationtool.cpp  
 M  +0 -1      imageplugins/transform/freerotationtool.h  
 M  +0 -21     imageplugins/transform/resizetool.cpp  
 M  +0 -23     imageplugins/transform/sheartool.cpp  
 M  +0 -1      imageplugins/transform/sheartool.h  
 M  +6 -1      utilities/imageeditor/editor/editortool.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1175974