Bug 66549 - Debug tab on configuration page repainted multiple times
Summary: Debug tab on configuration page repainted multiple times
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 2.1   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2004-06-10 12:49 EDT by David Pickens CLA
Modified: 2008-06-18 18:46 EDT (History)
1 user (show)

See Also:


Attachments
Patch to reduce the number of repaints of Debugger Launch tab (12.98 KB, patch)
2004-07-29 12:39 EDT, David Pickens CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Pickens CLA 2004-06-10 12:49:31 EDT
The Debug tab of the launch configuration is repainted multiple times 
unnecessarily. This causes a flicker and unnecessary delay.

From what I can tell from the source, here is the cause:

Render #1: The method org.eclipse.cdt.launch.ui.CDebuggerTab.activated()
calls "super.activated()", which renders the Debug tab fully. 

Render #2: The CDebugTab.activated() method then immediately 
invokes "loadDebuggerComboBox()" without first checking if this call is
unnecessary. This call invokes "fDCombo.select()" which fires an event that 
causes "ModifyListener" to invoke "updateComboFromSelection()". This method 
indirectly calls AbstractCDebugTab.handleDebuggerChanged(), which re-generates 
the Debug tab again!

Render #3: After "loadDebuggerComboBox()" invokes "fDCombo.select()" it 
redundantly invokes "updateComboFromSelection()" explicitly! This throws away 
the previous rendering and regenerates the Debug tab yet again!

I don't know the code that well, but it seems like CDebugTab.activated() 
should not invoke "loadDebuggerComboBox()" unless the "id" has changed. 
And "updateComboFromSelection()" should be removed after the call 
to "fDCombo.select()" in CDebugTab.loadDebuggerComboBox(), since the 
ModifyListener already invokes it.
Comment 1 Nobody - feel free to take it CLA 2004-06-23 15:15:40 EDT
Deffered.
Comment 2 David Pickens CLA 2004-07-29 12:39:21 EDT
Created attachment 13668 [details]
Patch to reduce the number of repaints of Debugger Launch tab

Attached is a copy of the latest CDebuggerTab.java file (from plugin
org.eclipse.cdt.launch), with some changes to correct this problem (or, at
least reduce the number of repaints).

Basically, it remembers the ID of the debugger whose launch dialog is being
rendered, and avoids unnecessarily invoking "loadDebuggerComboBox" if the ID
has not changed. With this fix, you can select the Debugger tab of the Launch
dialog without the tab being re-generated.
Comment 3 Nobody - feel free to take it CLA 2004-07-29 15:07:58 EDT
Thank you. The Debug tab of the launch configuration dialog currently has bugs 
and needs changes. I am planning to look at it in the near future and I will 
use your suggestions and comments.
Comment 4 Nobody - feel free to take it CLA 2004-08-23 16:55:56 EDT
Fixed.
Comment: the render#3 is needed because on some platforms (Motif) 
fDCombo.select doesn't fire a modification event.
Comment 5 David Pickens CLA 2004-08-24 12:29:50 EDT
Such a difference in the behavior of combos between SWT ports seems significant.
Shouldn't this be reported as a bug in SWT if it hasn't been already?
Comment 6 Doug Schaefer CLA 2008-06-03 14:14:28 EDT
reopening to assign
Comment 7 Doug Schaefer CLA 2008-06-03 14:14:52 EDT
putting back