Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 404202

Summary: Combo posts modify event instead of just sending it (was: Find/Replace Dialog: First find does not enable Replace button)
Product: [Eclipse Project] Platform Reporter: Kevin Arpe <kevinarpe>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, ericwill, kevinarpe, malaperle, markus.kell.r, mgoldshteyn, pwebster
Version: 4.3Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Linux-GTK   
Whiteboard: stalebug
Bug Depends on:    
Bug Blocks: 410603    
Attachments:
Description Flags
Screenshot of disabled Find/Replace buttons
none
Screenshot of enabled Find/Replace buttons (after focus taken away from Eclipse window)
none
Test Snippet none

Description Kevin Arpe CLA 2013-03-23 01:24:21 EDT
I am using Java JDK 1.7.0_17 from Oracle with "eclipse-java-juno-SR2-linux-gtk".

Steps to reproduce:

Here is some sample text to search (between "BEGIN" & "END" tags):
BEGIN>>>>>>>>>>>>>
	public static <T> int staticCheckListIndexForAccess(
			List<T> list, int index, String listArgName, String indexArgName) {
		_staticCheckContainerIndexForAccess(
			list,
			"List",
			(null == list ? -1 : list.size()),
			index,
			listArgName,
			indexArgName);
		return index;
	}
END<<<<<<<<<<<<<<<
	
1) Launch Eclipse and open any Java source file.  (I suppose this will work with other languages or just plain old text files also.)

2) Ctrl+F to open the Find/Replace dialog.

3) Enter new text into the Find field.  Try: "static" (without double quotes)

4) Press [Enter] on the keyboard to find next match.

5) Match is found, but Replace button is not enabled.

6) Press [Enter] again on the keyboard to find next match.

7) Match is found AND Replace button is enabled.

If this is a feature, please explain.  Otherwise, this feels like a bug to me.

More behavior that seems odd:

1) Close the Find/Replace dialog.

2) Move to the front of the line (or previous line).

3) Ctrl+F to open the Find/Replace dialog.

4) Do not change the Find field.

5) Press [Enter] on the keyboard to find next match.

6) Match is found AND Replace button is enabled.

And more:

1) Close the Find/Replace dialog.

2) Move to the front of the line (or previous line).

3) Ctrl+F to open the Find/Replace dialog.

4) Change the Find field value to another string to be found.

5) Press [Enter] on the keyboard to find next match.

6) Match is found, but Replace button is not enabled.

7) Press [Enter] again on the keyboard to find next match.

8) Match is found AND Replace button is enabled.

I hope these steps help.  If you need more information, please let me know.
Comment 1 Dani Megert CLA 2013-03-25 04:56:49 EDT
Using our latest stable build [1], I cannot reproduce this on Linux and Windows 7 with these steps:

1. download [1] and install into new location
2. start with new workspace and close Welcome page
3. paste the code from comment 0 (this will open the file)
4. Ctrl+F
5. type "static" without quotes
6. press Enter
==> all 3 replace buttons are enabled

[1] http://download.eclipse.org/eclipse/downloads/drops4/S-4.3M6-201303141330/


If you still see this using 4.3 M6 or newer, then please try to provide more detailed steps. Maybe I missed something.
Comment 2 Dani Megert CLA 2013-03-25 04:57:15 EDT
.
Comment 3 Kevin Arpe CLA 2013-04-22 08:39:50 EDT
Re-open after testing with pre-release build.
Comment 4 Dani Megert CLA 2013-04-22 08:42:54 EDT
(In reply to comment #3)
> Re-open after testing with pre-release build.

Did you follow exactly the steps from comment 1?
Comment 5 Kevin Arpe CLA 2013-04-22 08:47:52 EDT
Created attachment 229955 [details]
Screenshot of disabled Find/Replace buttons
Comment 6 Kevin Arpe CLA 2013-04-22 08:50:08 EDT
Using the latest stable build [1], I *can* reproduce this on Linux with these steps:

1. download [1] and install into new location
2. start with new workspace and close Welcome page
3. paste the code from comment 0 (this will open the file)
4. Ctrl+F
5. type "static" without quotes
6. press Enter
==> all 3 replace buttons *not* are enabled

Screenshot is attached.

Ironically, when I changed window focus to Gimp to take a screenshot, I found another symptom!  The buttons become enabled if focus is changed away from Eclipse.  See second screenshot.

[1] http://download.eclipse.org/eclipse/downloads/drops4/S-4.3M6-201303141330/
Comment 7 Kevin Arpe CLA 2013-04-22 08:51:28 EDT
Created attachment 229956 [details]
Screenshot of enabled Find/Replace buttons (after focus taken away from Eclipse window)
Comment 8 Paul Webster CLA 2013-04-25 10:42:19 EDT
I can reproduce the problem in 4.3.0.I20130423-0800 on linux.

1) open any editor

2) open the find/replace dialog (CTRL+F)

3) type in something new and hit enter

It finds the first occurrence but Replace and Replace/Find are not enabled, only Replace All

4) if I hit enter again it finds the second occurrence and the 2 Replace buttons become enabled.

If I open the find dialog and take what's pre-selected, then hitting enter enables the 2 replace buttons.

If I select something else from the combo dropdown, the bug happens in that the first find the 2 buttons are disabled, and the second find they enable.

Clicking Find instead of Enter after entering anything makes the problem go away.

PW
Comment 9 Dani Megert CLA 2013-04-26 09:08:35 EDT
I'm now also able to reproduce on Linux.
Comment 10 Dani Megert CLA 2013-06-12 09:53:36 EDT
This is a bug in Combo on Linux (see Combo#gtk_changed): it posts a modify event instead of sending it directly.

Test Case:
1. run the attached snippet
2. when the combo is up, just press Enter
==> writes Bug! to the console on Linux
Comment 11 Dani Megert CLA 2013-06-12 09:57:30 EDT
Created attachment 232287 [details]
Test Snippet
Comment 12 Dani Megert CLA 2013-07-15 05:40:46 EDT
*** Bug 412867 has been marked as a duplicate of this bug. ***
Comment 13 Eric Williams CLA 2018-05-14 16:06:46 EDT
Still reproducible: GTK3.22/4.8 M7/Fedora 28.
Comment 14 Eclipse Genie CLA 2020-06-15 20:29:26 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.