PR# 16056 Pasting text into EV_TEXT_FIELD under CDE with Click to Type does not fire change_actions

Problem Report Summary
Submitter: prestoat2000
Category: EiffelVision
Priority: High
Date: 2009/07/23
Class: Bug
Severity: Serious
Number: 16056
Release: 6.3.76070
Confidential: No
Status: Closed
Responsible: misterieking
Environment: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.9.0.10) Gecko/2009042715 Firefox/3.0.10 Solaris 10 on SPARC
Synopsis: Pasting text into EV_TEXT_FIELD under CDE with Click to Type does not fire change_actions

Description
Previously, I reported a bug where pasting text into an EV_TEXT_FIELD did not
fire the change_actions for that field.  The provided hack for that bug
works fine on Java Desktop System (GNOME) on Solaris 10 on SPARC, whether the
focus  behavior of windows is "Click to Type" or "moving mouse into window 
gives it focus".  But under CDE, if I set window behavior to be Click to Type,
pasting text into a text field when the window does not have focus does
not change the focus to that window, so the change actions for the field are
not executed.  I stepped through with the debugger and verified that
`focused_widget' is Void in this case.  

Click to Type can be enabled under CDE by click on Tools drawer, selecting
Desktop Controls, double-clickng on Window Style Manager icon in the
resulting window and then choosing "Click in Window to Make Active".
(If the window behavior is instead "Point to Window to Make Active", then
the change actions are fired correctly when text is pasted into a field
in the window).

I can partially work around this problem, but I really need a fix that
works for both CDE and JDS.  I can't ask users to change their window
behavior settings, which they are very accustomed to.

Help!


To Reproduce
Use attached test program for testing.  Display on Solaris SPARC host running
CDE with window behavior set to "Click in Window to Make Active".
Problem Report Interactions
From:misterieking    Date:2010/05/27    Status: Closed    Download   
Closing as the fix is now included in both main and compatible library versions of Vision2.

From:prestoat2000    Date:2010/05/26    Download   
It would be best if you could integrate it into the compatible version of
the library.  I want to use the standard version (previously "experimental")
but we have some code that depends on conformance of ARRAYED_LIST
to ARRAY so we might have to use the compatible branch for awhile, until
we fix that code.  I'm not yet sure how much effort is involved in removing
that dependency from our code.


From:misterieking    Date:2010/05/26    Download   
Hi David,

We have now converted the experimental branch to be the main branch, with the previous main branch now being the compatible branch for backwards compatibility.  Do you still need this change integrated with the compatible layer?

From:prestoat2000    Date:2010/01/19    Status: Analyzed    Download   
The fix for this bug is present in the experimental Vision2 library but
not in the non-experimental version of EV_APPLICATION_IMP.  I had
to add it manually to the non-experimental version.  Please propagate
the change so that I don't have to do this manually again.

From:misterieking    Date:2009/07/24    Status: Closed    Download   
No, the call isn't needed.  I'm glad that it works, I'm looking in to a better solution that makes use of the event data but so far I can't retrieve a gtk object from them so I need to delve more in to the gdk code.

From:prestoat2000    Date:2009/07/24    Download   
This appears to work on both JDS and CDE, with either Click to Type or
Focus Follows Mouse.  I noticed that the new code does not check 
`is_destroyed' on the text field.  Is that test not needed?

From:misterieking    Date:2009/07/24    Status: Analyzed    Download   
Hi David,

Can you try the following hack in replace of the one I gave previously to see if this works with the middle click on CDE?


if attached focused_widget as l_focus_widget then
	l_widget_imp ?= l_focus_widget.implementation
elseif attached (create {EV_SCREEN}).widget_at_mouse_pointer as l_focus_widget then
	l_widget_imp ?= l_focus_widget.implementation
end
if
	attached {EV_TEXT_FIELD_IMP} l_widget_imp as l_text_field_imp
then
		-- We need to explicitly check for selection actions on text fields
	l_call_event := False
	{EV_GTK_EXTERNALS}.gtk_main_do_event (gdk_event)
	l_text_field_imp.on_change_actions
end
l_widget_imp := Void

From:prestoat2000    Date:2009/07/23    Download   
Attachments for problem report #16056

Attachment: test.e     Size:723
Attachment: test.ecf     Size:1020