This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Kawa patch for -w option


Francisco Vides Fernández (aka pax!) tracked down (thanks!) the
apparent cause of the problem preventing focus in windows created
using -w under jdk 1.4.  It was the doFocus flag used by the
isFocusTraversable method.  I went further, and removed the whole
isFocusTraversable method (I don't remember why it was there in the
first place), resulting in the attached patch.

I've tried it on JDK 1.4, 1.3, and even 1.1.  There is a problem
with the first window created with -w, but that problem seems to
abel have been there without the patch, so that is ok.  Still, it
would be helpful if people could try it out on different OSes,
VMs, and vresions, and see if there are any changes.  (I've tried
it only on RedHat Linux 7.3.)
--
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/
Index: MessageArea.java
===================================================================
RCS file: /cvs/kawa/kawa/kawa/MessageArea.java,v
retrieving revision 1.7
diff -u -r1.7 MessageArea.java
--- MessageArea.java	25 Jan 2000 02:44:40 -0000	1.7
+++ MessageArea.java	15 Oct 2002 16:20:42 -0000
@@ -14,7 +14,6 @@
  */
 public class MessageArea extends TextArea
   implements KeyListener, TextListener {
-  private boolean doFocus = false;
   private kawa.TextAreaWriter out_stream;
   private PrintWriter out;
   private PrintWriter err;
@@ -31,10 +30,9 @@
    *
    * @param     focus    specifies if this is focus traversable
    */
-  public MessageArea(boolean focus, gnu.text.QueueReader in) {
+  public MessageArea(gnu.text.QueueReader in) {
     super();
 
-    this.doFocus = focus;
     this.in = in;
 
     out_stream = new kawa.TextAreaWriter(this);
@@ -46,11 +44,8 @@
     addTextListener(this);
   }
 
-  public boolean isFocusTraversable() {
-    return(doFocus && super.isFocusTraversable());
-  }
-
-  void enter () {
+  void enter ()
+  {
 	int pos = getCaretPosition();
 	String str = getText();
 	int len = str.length();
Index: GuiConsole.java
===================================================================
RCS file: /cvs/kawa/kawa/kawa/GuiConsole.java,v
retrieving revision 1.14
diff -u -r1.14 GuiConsole.java
--- GuiConsole.java	18 Apr 2002 21:14:09 -0000	1.14
+++ GuiConsole.java	15 Oct 2002 16:20:42 -0000
@@ -47,7 +47,7 @@
     this.environment = environment;
 
     in_r = new gnu.text.QueueReader ();
-    message = new MessageArea(false, in_r);
+    message = new MessageArea(in_r);
     window_number++;
     kawa.repl.exitIncrement();
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]