Bug 38090 - "new project" dialog not usable
Summary: "new project" dialog not usable
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.1   Edit
Hardware: PC Linux-GTK
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Felipe Heidrich CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 39491 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-05-25 08:32 EDT by Felix Bucherer CLA
Modified: 2003-07-04 11:40 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Bucherer CLA 2003-05-25 08:32:35 EDT
my config:
redhat linux 9 on a dell laptop
running gnome
jdk 1.4.1_02
eclipse-SDK-M20030521-linux-gtk.zip

starts up, but when i want to start a new project
(eg. file->new->project), a new window pops up, contents
flash quickly but then disappear and i'm left with an all-white
panel.

when i close the dialog (via window widget) i see the contents again
for a split second before the dialog disappears.

downgraded to release version (2.1), now it works.
Comment 1 Debbie Wilson CLA 2003-05-26 14:27:25 EDT
I'm unable to reproduce this problem (M20030521, on linux/gtk with jdk1.4.1_02).
 Is there something in your .log file?  Do you have any non-standard plugins
installed?  Perhaps give us your configuration details (Help -> About Eclipse
Platform -> Configuration Details).
Comment 2 Debbie Wilson CLA 2003-05-28 14:55:33 EDT
Moving to SWT for comment.  May be a GTK 2.2 specific problem.
Comment 3 Tod Creasey CLA 2003-05-29 09:22:50 EDT
The problem is that the modify event is being sent before the text is set in the
widget.

If I call setText and then in the modifyListener call getText I will get back
the text before it was set. As a result my dialog determines that there is an
error and displays it.

The flash is due to an unneccessary second validation going on that does get it
right.

This is a GTK only problem. Downbgrading priority as this is only annoying but
does not prevent people from working.
Comment 4 Tod Creasey CLA 2003-05-29 10:12:51 EDT
The problem is that OS.gtk_editable_delete_text (handle, 0, -1); is called
before the text is inserted. This method fires the modified callback which
causes the error.
Comment 5 Felipe Heidrich CLA 2003-05-29 17:33:11 EDT
I know how to fix this, but I not able to reproduce this bug on eclipse build#
200305280800.

Tod, could come to see me so we can check this bug out ?

Here is the fix for it (according with your description of the problem):
this is bug-free implementation of Text.setText ;)
public void setText (String string) {
		checkWidget ();
		if (string == null) error (SWT.ERROR_NULL_ARGUMENT);
		/*
		* Feature in GTK.
		*/
		string = verifyText (string, 0, getCharCount ());
		if (string == null) return;
		byte [] buffer = Converter.wcsToMbcs (null, string, false);
		int blockHandle = (style & SWT.SINGLE) != 0 ? handle : bufferHandle; 
		OS.g_signal_handlers_block_matched (blockHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0,
0, 0, CHANGED);
		OS.g_signal_handlers_block_matched (blockHandle, OS.G_SIGNAL_MATCH_DATA, 0, 0,
0, 0, INSERT_TEXT);
		if ((style & SWT.SINGLE) != 0) {
				OS.g_signal_handlers_block_matched (blockHandle, OS.G_SIGNAL_MATCH_DATA, 0,
0, 0, 0, DELETE_TEXT);
				OS.gtk_editable_delete_text (handle, 0, -1);
				int [] position = new int [1];
				OS.gtk_editable_insert_text (handle, buffer, buffer.length, position);
				OS.gtk_editable_set_position (handle, 0);
				OS.g_signal_handlers_unblock_matched (blockHandle, OS.G_SIGNAL_MATCH_DATA,
0, 0, 0, 0, DELETE_TEXT);        
		} else {
				OS.g_signal_handlers_block_matched (blockHandle, OS.G_SIGNAL_MATCH_DATA, 0,
0, 0, 0, DELETE_RANGE);
				byte [] position =  new byte [ITER_SIZEOF];
				OS.gtk_text_buffer_set_text (bufferHandle, buffer, buffer.length);
				OS.gtk_text_buffer_get_iter_at_offset (bufferHandle, position, 0);
				OS.gtk_text_buffer_place_cursor (bufferHandle, position);
				OS.g_signal_handlers_unblock_matched (blockHandle, OS.G_SIGNAL_MATCH_DATA,
0, 0, 0, 0, DELETE_RANGE);
		}
		OS.g_signal_handlers_unblock_matched (blockHandle, OS.G_SIGNAL_MATCH_DATA, 0,
0, 0, 0, CHANGED);
		OS.g_signal_handlers_unblock_matched (blockHandle, OS.G_SIGNAL_MATCH_DATA, 0,
0, 0, 0, INSERT_TEXT);
		sendEvent (SWT.Modify);
}
Comment 6 David Russell CLA 2003-06-03 13:20:31 EDT
Could someone give me an update of the status of this bug on Windows on the 
2.1.1 stream?  This is a dependency for 37787, and I'm just trying to find out 
where we are with this.
Comment 7 Felipe Heidrich CLA 2003-06-03 18:26:29 EDT
This problem occurs on:
Eclipse 2.1.1 on RedHat 9 and 8.
This problem does not occur on:
Eclipse 2.1 on RedHat 9 and 8.

This can also be fixed by fixing the bug Bug#38349.

Comment 8 Tod Creasey CLA 2003-06-04 08:16:24 EDT
Not sure how changing a label to a text affects a redraw Felipe? Are you sure 
this is related to Bug 38349?
Comment 9 Steve Northover CLA 2003-06-04 09:38:24 EDT
The problem is that on @#!$!@#%@#!%$ GTK we need to run an event loop inside 
of computeSize() to get it to work.  Amazing and bad.
Comment 10 Felipe Heidrich CLA 2003-06-04 10:39:11 EDT
This bug is not related with computeSize, Bug#38213 is.
I test this bug on Eclipse 2.1 and it works fine, I'm also sure that the SWT 
code released on 2.1.maintenance is not responsible for this.
Maybe gtk label merges the paints drawing just after the second modify (hiding 
the bug), hard to tell though.

I forgot to mention: if you type fast on the Text (project name) the caret gets 
behind. Is that true for you too Tod ?
Comment 11 Tod Creasey CLA 2003-06-04 10:51:58 EDT
Yes but I think this is an OS bug and nothing to do with SWT - I get it in the 
base applications (like the file browser) in Redhat 9.0 as well.
Comment 12 Jeff McAffer CLA 2003-06-04 17:23:30 EDT
This is addressed (hidden) by the fix for bug 38213 which is going into 2.1.1.  
No action required for 2.1.1.  Should look at a real fix in 3.0.
Comment 13 Felipe Heidrich CLA 2003-06-04 19:17:52 EDT
fix for  bug#38213 was released.
Comment 14 Felipe Heidrich CLA 2003-06-23 13:21:51 EDT
I'm closing this bug as won't fix since:

- Although I can workaround this GTK bug for the Text widget I can't fix it for 
Combo. 

- There is a bug report againt GTK for this:
http://bugzilla.gnome.org/show_bug.cgi?id=64998

- The problem with the dialogs is fixed in HEAD and 2.1.1.

Comment 15 Felipe Heidrich CLA 2003-07-04 11:40:39 EDT
*** Bug 39491 has been marked as a duplicate of this bug. ***