public inbox for cygwin-xfree@sourceware.org
help / color / mirror / Atom feed
* Running Java application with drag and drop support in cygwin
@ 2009-10-28  5:57 Dees
  2009-10-29 14:41 ` Jon TURNEY
  0 siblings, 1 reply; 9+ messages in thread
From: Dees @ 2009-10-28  5:57 UTC (permalink / raw)
  To: cygwin-xfree

Hi,

I have developed a Java application involving jTree with extensive
drag and drop support, which runs correctly in my Linux box. However,
when I switch to a windows box and access the same Linux box using
cygwin x-server, the drag and drop in jTree stops working.
Interestingly, rest of the application still works fine. After
analyzing a bit I found that x-server is able to recognize the drag
event but fails to recognize a drop event.

Is there any setting, which should be done prior to running the Java
swing applications?

Here is a sample code which behaves in exactly same way.
http://www.java2s.com/Code/Java/Swing-JFC/TreeDragandDrop.htm

May be my problem is related to some setting. Though, not sure.
Has anybody come across something similar? What should be done then?
Please let me know.

TIA
Shefali

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Running Java application with drag and drop support in cygwin
  2009-10-28  5:57 Running Java application with drag and drop support in cygwin Dees
@ 2009-10-29 14:41 ` Jon TURNEY
  2009-10-30  9:06   ` Dees
  0 siblings, 1 reply; 9+ messages in thread
From: Jon TURNEY @ 2009-10-29 14:41 UTC (permalink / raw)
  To: cygwin-xfree, deepali.shefali

On 28/10/2009 05:57, Dees wrote:
> I have developed a Java application involving jTree with extensive
> drag and drop support, which runs correctly in my Linux box. However,
> when I switch to a windows box and access the same Linux box using
> cygwin x-server, the drag and drop in jTree stops working.
> Interestingly, rest of the application still works fine. After
> analyzing a bit I found that x-server is able to recognize the drag
> event but fails to recognize a drop event.

Details?

> Is there any setting, which should be done prior to running the Java
> swing applications?
>
> Here is a sample code which behaves in exactly same way.
> http://www.java2s.com/Code/Java/Swing-JFC/TreeDragandDrop.htm

I have no idea how to use that java code to reproduce the problem you are seeing.

> May be my problem is related to some setting. Though, not sure.
> Has anybody come across something similar? What should be done then?
> Please let me know.

No it's probably a bug in Cygwin/X.  But you're going to need to be a lot more 
specific about the problem before any progress can be made on fixing it.

-- 
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Running Java application with drag and drop support in cygwin
  2009-10-29 14:41 ` Jon TURNEY
@ 2009-10-30  9:06   ` Dees
  2009-11-03  9:08     ` Dees
  2009-11-13 14:56     ` Jon TURNEY
  0 siblings, 2 replies; 9+ messages in thread
From: Dees @ 2009-10-30  9:06 UTC (permalink / raw)
  To: cygwin-xfree

[-- Attachment #1: Type: text/plain, Size: 3538 bytes --]

Your reply is much appreciated Jon. I will try to be more specific
about the problem in further mails.

On Thu, Oct 29, 2009 at 8:11 PM, Jon TURNEY <jon.turney@dronecode.org.uk> wrote:
> On 28/10/2009 05:57, Dees wrote:
>>
>> I have developed a Java application involving jTree with extensive
>> drag and drop support, which runs correctly in my Linux box. However,
>> when I switch to a windows box and access the same Linux box using
>> cygwin x-server, the drag and drop in jTree stops working.
>> Interestingly, rest of the application still works fine. After
>> analyzing a bit I found that x-server is able to recognize the drag
>> event but fails to recognize a drop event.
>
> Details?

OS : Suse Linux Enterprise Server 10 (i586)
Version : 10
Patch level : 3
Other version information:
Java : JDK 5
Cygwin setup-version: 2.573.2.3
Also tried using Xming 6.9.0.31 ssh same Linux setup from Windows, but
that also doesn't solve the problem.

>
>> Is there any setting, which should be done prior to running the Java
>> swing applications?
>>
>> Here is a sample code which behaves in exactly same way.
>> http://www.java2s.com/Code/Java/Swing-JFC/TreeDragandDrop.htm
>
> I have no idea how to use that java code to reproduce the problem you are
> seeing.

Using the above java code in Linux:
1. Download and Install Java Development Toolkit on your Linux box
(Java sun download site:
http://java.sun.com/javase/downloads/index.jsp), if you do not have it
already.
2. Save the sample code in the above link with the file name
TreeTester.java, say in /home/user/
3. Navigate to TreeTester.java from shell, and compile the java code:
	# cd /home/user/
	# /usr/java/jdk1.5.0_14/bin/javac TreeTester.java
   Ignore any warnings of deprecated APIs.
4. This will create a few .class files in /home/user/ directory. Final
step is to run the Java code, using:
	# /usr/java/jdk1.5.0_14/bin/java -classpath . TreeTester
   This will open up a GUI, with a jTree each on left and right pane.
You can drag and drop any of the leaf nodes from one jTree to the root
node of the other jTree and this should add a new node in the other
jTree. You will get messages on console for the operations being
performed. Now ssh the same box using cygwin/xming from any other
windows box, and run the application using command in step 4. You
should be able to drag (a small icon will come under cursor indicating
that something is being dragged) but when you will drop it, the new
node would not be added to the tree. Thats where lies my problem!!!

>
>> May be my problem is related to some setting. Though, not sure.
>> Has anybody come across something similar? What should be done then?
>> Please let me know.
>
> No it's probably a bug in Cygwin/X.  But you're going to need to be a lot
> more specific about the problem before any progress can be made on fixing
> it.

I have been using Netbeans IDE for compiling and running java code,
which creates an executable jar. For your convenience, I am attaching
the same with this mail. You can observe the current behavior by
running directly this file without the need to compile the source code
(as specified above), using:
	# /usr/java/jdk1.5.0_14/bin/java -jar TreeTester.jar
Also, putting some debug messages in the code lets me conclude that
it's the drop event which is not being recognized, as the main control
never reaches there.

Let me know if you need any other specific details or come across any
other issue.

>
> --
> Jon TURNEY
> Volunteer Cygwin/X X Server maintainer
>

Regards,
Shefali

[-- Attachment #2: TreeTester.jar --]
[-- Type: application/java-archive, Size: 19192 bytes --]

[-- Attachment #3: Type: text/plain, Size: 223 bytes --]

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Running Java application with drag and drop support in cygwin
  2009-10-30  9:06   ` Dees
@ 2009-11-03  9:08     ` Dees
  2009-11-13 14:56     ` Jon TURNEY
  1 sibling, 0 replies; 9+ messages in thread
From: Dees @ 2009-11-03  9:08 UTC (permalink / raw)
  To: cygwin-xfree

Jon/others in list,
Any updates? Let me know if you are stuck somewhere.
Many Thanks,
Shefali

On Fri, Oct 30, 2009 at 2:36 PM, Dees <deepali.shefali@gmail.com> wrote:
> Your reply is much appreciated Jon. I will try to be more specific
> about the problem in further mails.
>
> On Thu, Oct 29, 2009 at 8:11 PM, Jon TURNEY <jon.turney@dronecode.org.uk> wrote:
>> On 28/10/2009 05:57, Dees wrote:
>>>
>>> I have developed a Java application involving jTree with extensive
>>> drag and drop support, which runs correctly in my Linux box. However,
>>> when I switch to a windows box and access the same Linux box using
>>> cygwin x-server, the drag and drop in jTree stops working.
>>> Interestingly, rest of the application still works fine. After
>>> analyzing a bit I found that x-server is able to recognize the drag
>>> event but fails to recognize a drop event.
>>
>> Details?
>
> OS : Suse Linux Enterprise Server 10 (i586)
> Version : 10
> Patch level : 3
> Other version information:
> Java : JDK 5
> Cygwin setup-version: 2.573.2.3
> Also tried using Xming 6.9.0.31 ssh same Linux setup from Windows, but
> that also doesn't solve the problem.
>
>>
>>> Is there any setting, which should be done prior to running the Java
>>> swing applications?
>>>
>>> Here is a sample code which behaves in exactly same way.
>>> http://www.java2s.com/Code/Java/Swing-JFC/TreeDragandDrop.htm
>>
>> I have no idea how to use that java code to reproduce the problem you are
>> seeing.
>
> Using the above java code in Linux:
> 1. Download and Install Java Development Toolkit on your Linux box
> (Java sun download site:
> http://java.sun.com/javase/downloads/index.jsp), if you do not have it
> already.
> 2. Save the sample code in the above link with the file name
> TreeTester.java, say in /home/user/
> 3. Navigate to TreeTester.java from shell, and compile the java code:
>        # cd /home/user/
>        # /usr/java/jdk1.5.0_14/bin/javac TreeTester.java
>   Ignore any warnings of deprecated APIs.
> 4. This will create a few .class files in /home/user/ directory. Final
> step is to run the Java code, using:
>        # /usr/java/jdk1.5.0_14/bin/java -classpath . TreeTester
>   This will open up a GUI, with a jTree each on left and right pane.
> You can drag and drop any of the leaf nodes from one jTree to the root
> node of the other jTree and this should add a new node in the other
> jTree. You will get messages on console for the operations being
> performed. Now ssh the same box using cygwin/xming from any other
> windows box, and run the application using command in step 4. You
> should be able to drag (a small icon will come under cursor indicating
> that something is being dragged) but when you will drop it, the new
> node would not be added to the tree. Thats where lies my problem!!!
>
>>
>>> May be my problem is related to some setting. Though, not sure.
>>> Has anybody come across something similar? What should be done then?
>>> Please let me know.
>>
>> No it's probably a bug in Cygwin/X.  But you're going to need to be a lot
>> more specific about the problem before any progress can be made on fixing
>> it.
>
> I have been using Netbeans IDE for compiling and running java code,
> which creates an executable jar. For your convenience, I am attaching
> the same with this mail. You can observe the current behavior by
> running directly this file without the need to compile the source code
> (as specified above), using:
>        # /usr/java/jdk1.5.0_14/bin/java -jar TreeTester.jar
> Also, putting some debug messages in the code lets me conclude that
> it's the drop event which is not being recognized, as the main control
> never reaches there.
>
> Let me know if you need any other specific details or come across any
> other issue.
>
>>
>> --
>> Jon TURNEY
>> Volunteer Cygwin/X X Server maintainer
>>
>
> Regards,
> Shefali
>

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Running Java application with drag and drop support in cygwin
  2009-10-30  9:06   ` Dees
  2009-11-03  9:08     ` Dees
@ 2009-11-13 14:56     ` Jon TURNEY
  2009-12-14  6:42       ` Dees
  1 sibling, 1 reply; 9+ messages in thread
From: Jon TURNEY @ 2009-11-13 14:56 UTC (permalink / raw)
  To: cygwin-xfree; +Cc: deepali.shefali

On 30/10/2009 09:06, Dees wrote:
> Your reply is much appreciated Jon. I will try to be more specific
> about the problem in further mails.
>
> On Thu, Oct 29, 2009 at 8:11 PM, Jon TURNEY<jon.turney@dronecode.org.uk>  wrote:
>> On 28/10/2009 05:57, Dees wrote:
>>>
>>> I have developed a Java application involving jTree with extensive
>>> drag and drop support, which runs correctly in my Linux box. However,
>>> when I switch to a windows box and access the same Linux box using
>>> cygwin x-server, the drag and drop in jTree stops working.
>>> Interestingly, rest of the application still works fine. After
>>> analyzing a bit I found that x-server is able to recognize the drag
>>> event but fails to recognize a drop event.
>>
>> Details?
>
> OS : Suse Linux Enterprise Server 10 (i586)
> Version : 10
> Patch level : 3
> Other version information:
> Java : JDK 5
> Cygwin setup-version: 2.573.2.3
> Also tried using Xming 6.9.0.31 ssh same Linux setup from Windows, but
> that also doesn't solve the problem.
>
>>
>>> Is there any setting, which should be done prior to running the Java
>>> swing applications?
>>>
>>> Here is a sample code which behaves in exactly same way.
>>> http://www.java2s.com/Code/Java/Swing-JFC/TreeDragandDrop.htm
>>
>> I have no idea how to use that java code to reproduce the problem you are
>> seeing.
>
> Using the above java code in Linux:
> 1. Download and Install Java Development Toolkit on your Linux box
> (Java sun download site:
> http://java.sun.com/javase/downloads/index.jsp), if you do not have it
> already.
> 2. Save the sample code in the above link with the file name
> TreeTester.java, say in /home/user/
> 3. Navigate to TreeTester.java from shell, and compile the java code:
> 	# cd /home/user/
> 	# /usr/java/jdk1.5.0_14/bin/javac TreeTester.java
>     Ignore any warnings of deprecated APIs.
> 4. This will create a few .class files in /home/user/ directory. Final
> step is to run the Java code, using:
> 	# /usr/java/jdk1.5.0_14/bin/java -classpath . TreeTester
>     This will open up a GUI, with a jTree each on left and right pane.
> You can drag and drop any of the leaf nodes from one jTree to the root
> node of the other jTree and this should add a new node in the other
> jTree. You will get messages on console for the operations being
> performed. Now ssh the same box using cygwin/xming from any other
> windows box, and run the application using command in step 4. You
> should be able to drag (a small icon will come under cursor indicating
> that something is being dragged) but when you will drop it, the new
> node would not be added to the tree. Thats where lies my problem!!!

Thanks for the test case and instructions, this makes it much easier for me to 
try it out.

However, this testcase and your jar archive both work fine for me (using 
Xserver 1.7.1-3)!

>>> May be my problem is related to some setting. Though, not sure.
>>> Has anybody come across something similar? What should be done then?
>>> Please let me know.
>>
>> No it's probably a bug in Cygwin/X.  But you're going to need to be a lot
>> more specific about the problem before any progress can be made on fixing
>> it.

> Also, putting some debug messages in the code lets me conclude that
> it's the drop event which is not being recognized, as the main control
> never reaches there.

There is not really any drop event, as far as the X server is concerned, just 
mouse click and motion events, which are passed on to you application (which 
has a framework to interpret them as dragging and dropping an item).

Now having a better idea of the problem, it seems less likely it is an Xserver 
bug at all.  The only Xserver cause I can think of would be if it was somehow 
not sending the correct events to your applications window, which you could 
test using xev -id <your applications window id> (you can use xwininfo to find 
the window id)

-- 
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Running Java application with drag and drop support in cygwin
  2009-11-13 14:56     ` Jon TURNEY
@ 2009-12-14  6:42       ` Dees
       [not found]         ` <15fe165d0912172153o5c48e300s63d80704d0c504c8@mail.gmail.com>
  0 siblings, 1 reply; 9+ messages in thread
From: Dees @ 2009-12-14  6:42 UTC (permalink / raw)
  To: cygwin-xfree

On Fri, Nov 13, 2009 at 8:26 PM, Jon TURNEY <jon.turney@dronecode.org.uk> wrote:
> On 30/10/2009 09:06, Dees wrote:
>>
>> Your reply is much appreciated Jon. I will try to be more specific
>> about the problem in further mails.
>>
>> On Thu, Oct 29, 2009 at 8:11 PM, Jon TURNEY<jon.turney@dronecode.org.uk>
>>  wrote:
>>>
>>> On 28/10/2009 05:57, Dees wrote:
>>>>
>>>> I have developed a Java application involving jTree with extensive
>>>> drag and drop support, which runs correctly in my Linux box. However,
>>>> when I switch to a windows box and access the same Linux box using
>>>> cygwin x-server, the drag and drop in jTree stops working.
>>>> Interestingly, rest of the application still works fine. After
>>>> analyzing a bit I found that x-server is able to recognize the drag
>>>> event but fails to recognize a drop event.
>>>
>>> Details?
>>
>> OS : Suse Linux Enterprise Server 10 (i586)
>> Version : 10
>> Patch level : 3
>> Other version information:
>> Java : JDK 5
>> Cygwin setup-version: 2.573.2.3
>> Also tried using Xming 6.9.0.31 ssh same Linux setup from Windows, but
>> that also doesn't solve the problem.
>>
>>>
>>>> Is there any setting, which should be done prior to running the Java
>>>> swing applications?
>>>>
>>>> Here is a sample code which behaves in exactly same way.
>>>> http://www.java2s.com/Code/Java/Swing-JFC/TreeDragandDrop.htm
>>>
>>> I have no idea how to use that java code to reproduce the problem you are
>>> seeing.
>>
>> Using the above java code in Linux:
>> 1. Download and Install Java Development Toolkit on your Linux box
>> (Java sun download site:
>> http://java.sun.com/javase/downloads/index.jsp), if you do not have it
>> already.
>> 2. Save the sample code in the above link with the file name
>> TreeTester.java, say in /home/user/
>> 3. Navigate to TreeTester.java from shell, and compile the java code:
>>        # cd /home/user/
>>        # /usr/java/jdk1.5.0_14/bin/javac TreeTester.java
>>    Ignore any warnings of deprecated APIs.
>> 4. This will create a few .class files in /home/user/ directory. Final
>> step is to run the Java code, using:
>>        # /usr/java/jdk1.5.0_14/bin/java -classpath . TreeTester
>>    This will open up a GUI, with a jTree each on left and right pane.
>> You can drag and drop any of the leaf nodes from one jTree to the root
>> node of the other jTree and this should add a new node in the other
>> jTree. You will get messages on console for the operations being
>> performed. Now ssh the same box using cygwin/xming from any other
>> windows box, and run the application using command in step 4. You
>> should be able to drag (a small icon will come under cursor indicating
>> that something is being dragged) but when you will drop it, the new
>> node would not be added to the tree. Thats where lies my problem!!!
>
> Thanks for the test case and instructions, this makes it much easier for me
> to try it out.
>
> However, this testcase and your jar archive both work fine for me (using
> Xserver 1.7.1-3)!
>
>>>> May be my problem is related to some setting. Though, not sure.
>>>> Has anybody come across something similar? What should be done then?
>>>> Please let me know.
>>>
>>> No it's probably a bug in Cygwin/X.  But you're going to need to be a lot
>>> more specific about the problem before any progress can be made on fixing
>>> it.
>
>> Also, putting some debug messages in the code lets me conclude that
>> it's the drop event which is not being recognized, as the main control
>> never reaches there.
>
> There is not really any drop event, as far as the X server is concerned,
> just mouse click and motion events, which are passed on to you application
> (which has a framework to interpret them as dragging and dropping an item).
>
> Now having a better idea of the problem, it seems less likely it is an
> Xserver bug at all.  The only Xserver cause I can think of would be if it
> was somehow not sending the correct events to your applications window,
> which you could test using xev -id <your applications window id> (you can
> use xwininfo to find the window id)
>
I have tried this, but could not get any idea if any event is going wrong.
Here is the output of xev -id 0xe00021 (only for drag and drop event):

LeaveNotify event, serial 13, synthetic NO, window 0xe00021,
    root 0x5a, subw 0xe00025, time 3560250, (87,65), root:(91,95),
    mode NotifyGrab, detail NotifyVirtual, same_screen YES,
    focus YES, state 256

FocusOut event, serial 13, synthetic NO, window 0xe00021,
    mode NotifyGrab, detail NotifyAncestor

EnterNotify event, serial 13, synthetic NO, window 0xe00021,
    root 0x5a, subw 0xe00025, time 3565375, (212,48), root:(216,78),
    mode NotifyUngrab, detail NotifyVirtual, same_screen YES,
    focus YES, state 0

KeymapNotify event, serial 13, synthetic NO, window 0x0,
    keys:  90  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0

FocusIn event, serial 13, synthetic NO, window 0xe00021,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 13, synthetic NO, window 0x0,
    keys:  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0

LeaveNotify event, serial 13, synthetic NO, window 0xe00021,
    root 0x5a, subw 0xe00025, time 3569046, (205,211), root:(209,241),
    mode NotifyNormal, detail NotifyNonlinearVirtual, same_screen YES,
    focus YES, state 0

Does the window 0x0 in two events in the log(above) signify anything
misbehaving?
Your reply is much awaited and appreciated.


> --
> Jon TURNEY
> Volunteer Cygwin/X X Server maintainer
>

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Running Java application with drag and drop support in cygwin
       [not found]         ` <15fe165d0912172153o5c48e300s63d80704d0c504c8@mail.gmail.com>
@ 2009-12-23 12:56           ` Dees
  2010-09-20 10:31             ` Dees
  0 siblings, 1 reply; 9+ messages in thread
From: Dees @ 2009-12-23 12:56 UTC (permalink / raw)
  To: cygwin-xfree

People, any clue? Struggling really hard.

On Fri, Dec 18, 2009 at 11:23 AM, Dees <deepali.shefali@gmail.com> wrote:
> Hi Jon,
>
> Did you get a chance to look at this?
> From whatever posts available online, I could not get a clue what is
> going wrong.
> Please respond.
>
> Thanks,
> Shefali
>
> On Mon, Dec 14, 2009 at 12:12 PM, Dees <deepali.shefali@gmail.com> wrote:
>> On Fri, Nov 13, 2009 at 8:26 PM, Jon TURNEY <jon.turney@dronecode.org.uk> wrote:
>>> On 30/10/2009 09:06, Dees wrote:
>>>>
>>>> Your reply is much appreciated Jon. I will try to be more specific
>>>> about the problem in further mails.
>>>>
>>>> On Thu, Oct 29, 2009 at 8:11 PM, Jon TURNEY<jon.turney@dronecode.org.uk>
>>>>  wrote:
>>>>>
>>>>> On 28/10/2009 05:57, Dees wrote:
>>>>>>
>>>>>> I have developed a Java application involving jTree with extensive
>>>>>> drag and drop support, which runs correctly in my Linux box. However,
>>>>>> when I switch to a windows box and access the same Linux box using
>>>>>> cygwin x-server, the drag and drop in jTree stops working.
>>>>>> Interestingly, rest of the application still works fine. After
>>>>>> analyzing a bit I found that x-server is able to recognize the drag
>>>>>> event but fails to recognize a drop event.
>>>>>
>>>>> Details?
>>>>
>>>> OS : Suse Linux Enterprise Server 10 (i586)
>>>> Version : 10
>>>> Patch level : 3
>>>> Other version information:
>>>> Java : JDK 5
>>>> Cygwin setup-version: 2.573.2.3
>>>> Also tried using Xming 6.9.0.31 ssh same Linux setup from Windows, but
>>>> that also doesn't solve the problem.
>>>>
>>>>>
>>>>>> Is there any setting, which should be done prior to running the Java
>>>>>> swing applications?
>>>>>>
>>>>>> Here is a sample code which behaves in exactly same way.
>>>>>> http://www.java2s.com/Code/Java/Swing-JFC/TreeDragandDrop.htm
>>>>>
>>>>> I have no idea how to use that java code to reproduce the problem you are
>>>>> seeing.
>>>>
>>>> Using the above java code in Linux:
>>>> 1. Download and Install Java Development Toolkit on your Linux box
>>>> (Java sun download site:
>>>> http://java.sun.com/javase/downloads/index.jsp), if you do not have it
>>>> already.
>>>> 2. Save the sample code in the above link with the file name
>>>> TreeTester.java, say in /home/user/
>>>> 3. Navigate to TreeTester.java from shell, and compile the java code:
>>>>        # cd /home/user/
>>>>        # /usr/java/jdk1.5.0_14/bin/javac TreeTester.java
>>>>    Ignore any warnings of deprecated APIs.
>>>> 4. This will create a few .class files in /home/user/ directory. Final
>>>> step is to run the Java code, using:
>>>>        # /usr/java/jdk1.5.0_14/bin/java -classpath . TreeTester
>>>>    This will open up a GUI, with a jTree each on left and right pane.
>>>> You can drag and drop any of the leaf nodes from one jTree to the root
>>>> node of the other jTree and this should add a new node in the other
>>>> jTree. You will get messages on console for the operations being
>>>> performed. Now ssh the same box using cygwin/xming from any other
>>>> windows box, and run the application using command in step 4. You
>>>> should be able to drag (a small icon will come under cursor indicating
>>>> that something is being dragged) but when you will drop it, the new
>>>> node would not be added to the tree. Thats where lies my problem!!!
>>>
>>> Thanks for the test case and instructions, this makes it much easier for me
>>> to try it out.
>>>
>>> However, this testcase and your jar archive both work fine for me (using
>>> Xserver 1.7.1-3)!
>>>
>>>>>> May be my problem is related to some setting. Though, not sure.
>>>>>> Has anybody come across something similar? What should be done then?
>>>>>> Please let me know.
>>>>>
>>>>> No it's probably a bug in Cygwin/X.  But you're going to need to be a lot
>>>>> more specific about the problem before any progress can be made on fixing
>>>>> it.
>>>
>>>> Also, putting some debug messages in the code lets me conclude that
>>>> it's the drop event which is not being recognized, as the main control
>>>> never reaches there.
>>>
>>> There is not really any drop event, as far as the X server is concerned,
>>> just mouse click and motion events, which are passed on to you application
>>> (which has a framework to interpret them as dragging and dropping an item).
>>>
>>> Now having a better idea of the problem, it seems less likely it is an
>>> Xserver bug at all.  The only Xserver cause I can think of would be if it
>>> was somehow not sending the correct events to your applications window,
>>> which you could test using xev -id <your applications window id> (you can
>>> use xwininfo to find the window id)
>>>
>> I have tried this, but could not get any idea if any event is going wrong.
>> Here is the output of xev -id 0xe00021 (only for drag and drop event):
>>
>> LeaveNotify event, serial 13, synthetic NO, window 0xe00021,
>>    root 0x5a, subw 0xe00025, time 3560250, (87,65), root:(91,95),
>>    mode NotifyGrab, detail NotifyVirtual, same_screen YES,
>>    focus YES, state 256
>>
>> FocusOut event, serial 13, synthetic NO, window 0xe00021,
>>    mode NotifyGrab, detail NotifyAncestor
>>
>> EnterNotify event, serial 13, synthetic NO, window 0xe00021,
>>    root 0x5a, subw 0xe00025, time 3565375, (212,48), root:(216,78),
>>    mode NotifyUngrab, detail NotifyVirtual, same_screen YES,
>>    focus YES, state 0
>>
>> KeymapNotify event, serial 13, synthetic NO, window 0x0,
>>    keys:  90  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
>>           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
>>
>> FocusIn event, serial 13, synthetic NO, window 0xe00021,
>>    mode NotifyUngrab, detail NotifyAncestor
>>
>> KeymapNotify event, serial 13, synthetic NO, window 0x0,
>>    keys:  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
>>           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
>>
>> LeaveNotify event, serial 13, synthetic NO, window 0xe00021,
>>    root 0x5a, subw 0xe00025, time 3569046, (205,211), root:(209,241),
>>    mode NotifyNormal, detail NotifyNonlinearVirtual, same_screen YES,
>>    focus YES, state 0
>>
>> Does the window 0x0 in two events in the log(above) signify anything
>> misbehaving?
>> Your reply is much awaited and appreciated.
>>
>>
>>> --
>>> Jon TURNEY
>>> Volunteer Cygwin/X X Server maintainer
>>>
>>
>

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Running Java application with drag and drop support in cygwin
  2009-12-23 12:56           ` Dees
@ 2010-09-20 10:31             ` Dees
  2010-09-27 15:21               ` Jon TURNEY
  0 siblings, 1 reply; 9+ messages in thread
From: Dees @ 2010-09-20 10:31 UTC (permalink / raw)
  To: cygwin-xfree

Any update?

On Wed, Dec 23, 2009 at 6:26 PM, Dees <deepali.shefali@gmail.com> wrote:
>
> People, any clue? Struggling really hard.
>
> On Fri, Dec 18, 2009 at 11:23 AM, Dees <deepali.shefali@gmail.com> wrote:
> > Hi Jon,
> >
> > Did you get a chance to look at this?
> > From whatever posts available online, I could not get a clue what is
> > going wrong.
> > Please respond.
> >
> > Thanks,
> > Shefali
> >
> > On Mon, Dec 14, 2009 at 12:12 PM, Dees <deepali.shefali@gmail.com> wrote:
> >> On Fri, Nov 13, 2009 at 8:26 PM, Jon TURNEY <jon.turney@dronecode.org.uk> wrote:
> >>> On 30/10/2009 09:06, Dees wrote:
> >>>>
> >>>> Your reply is much appreciated Jon. I will try to be more specific
> >>>> about the problem in further mails.
> >>>>
> >>>> On Thu, Oct 29, 2009 at 8:11 PM, Jon TURNEY<jon.turney@dronecode.org.uk>
> >>>>  wrote:
> >>>>>
> >>>>> On 28/10/2009 05:57, Dees wrote:
> >>>>>>
> >>>>>> I have developed a Java application involving jTree with extensive
> >>>>>> drag and drop support, which runs correctly in my Linux box. However,
> >>>>>> when I switch to a windows box and access the same Linux box using
> >>>>>> cygwin x-server, the drag and drop in jTree stops working.
> >>>>>> Interestingly, rest of the application still works fine. After
> >>>>>> analyzing a bit I found that x-server is able to recognize the drag
> >>>>>> event but fails to recognize a drop event.
> >>>>>
> >>>>> Details?
> >>>>
> >>>> OS : Suse Linux Enterprise Server 10 (i586)
> >>>> Version : 10
> >>>> Patch level : 3
> >>>> Other version information:
> >>>> Java : JDK 5
> >>>> Cygwin setup-version: 2.573.2.3
> >>>> Also tried using Xming 6.9.0.31 ssh same Linux setup from Windows, but
> >>>> that also doesn't solve the problem.
> >>>>
> >>>>>
> >>>>>> Is there any setting, which should be done prior to running the Java
> >>>>>> swing applications?
> >>>>>>
> >>>>>> Here is a sample code which behaves in exactly same way.
> >>>>>> http://www.java2s.com/Code/Java/Swing-JFC/TreeDragandDrop.htm
> >>>>>
> >>>>> I have no idea how to use that java code to reproduce the problem you are
> >>>>> seeing.
> >>>>
> >>>> Using the above java code in Linux:
> >>>> 1. Download and Install Java Development Toolkit on your Linux box
> >>>> (Java sun download site:
> >>>> http://java.sun.com/javase/downloads/index.jsp), if you do not have it
> >>>> already.
> >>>> 2. Save the sample code in the above link with the file name
> >>>> TreeTester.java, say in /home/user/
> >>>> 3. Navigate to TreeTester.java from shell, and compile the java code:
> >>>>        # cd /home/user/
> >>>>        # /usr/java/jdk1.5.0_14/bin/javac TreeTester.java
> >>>>    Ignore any warnings of deprecated APIs.
> >>>> 4. This will create a few .class files in /home/user/ directory. Final
> >>>> step is to run the Java code, using:
> >>>>        # /usr/java/jdk1.5.0_14/bin/java -classpath . TreeTester
> >>>>    This will open up a GUI, with a jTree each on left and right pane.
> >>>> You can drag and drop any of the leaf nodes from one jTree to the root
> >>>> node of the other jTree and this should add a new node in the other
> >>>> jTree. You will get messages on console for the operations being
> >>>> performed. Now ssh the same box using cygwin/xming from any other
> >>>> windows box, and run the application using command in step 4. You
> >>>> should be able to drag (a small icon will come under cursor indicating
> >>>> that something is being dragged) but when you will drop it, the new
> >>>> node would not be added to the tree. Thats where lies my problem!!!
> >>>
> >>> Thanks for the test case and instructions, this makes it much easier for me
> >>> to try it out.
> >>>
> >>> However, this testcase and your jar archive both work fine for me (using
> >>> Xserver 1.7.1-3)!
> >>>
> >>>>>> May be my problem is related to some setting. Though, not sure.
> >>>>>> Has anybody come across something similar? What should be done then?
> >>>>>> Please let me know.
> >>>>>
> >>>>> No it's probably a bug in Cygwin/X.  But you're going to need to be a lot
> >>>>> more specific about the problem before any progress can be made on fixing
> >>>>> it.
> >>>
> >>>> Also, putting some debug messages in the code lets me conclude that
> >>>> it's the drop event which is not being recognized, as the main control
> >>>> never reaches there.
> >>>
> >>> There is not really any drop event, as far as the X server is concerned,
> >>> just mouse click and motion events, which are passed on to you application
> >>> (which has a framework to interpret them as dragging and dropping an item).
> >>>
> >>> Now having a better idea of the problem, it seems less likely it is an
> >>> Xserver bug at all.  The only Xserver cause I can think of would be if it
> >>> was somehow not sending the correct events to your applications window,
> >>> which you could test using xev -id <your applications window id> (you can
> >>> use xwininfo to find the window id)
> >>>
> >> I have tried this, but could not get any idea if any event is going wrong.
> >> Here is the output of xev -id 0xe00021 (only for drag and drop event):
> >>
> >> LeaveNotify event, serial 13, synthetic NO, window 0xe00021,
> >>    root 0x5a, subw 0xe00025, time 3560250, (87,65), root:(91,95),
> >>    mode NotifyGrab, detail NotifyVirtual, same_screen YES,
> >>    focus YES, state 256
> >>
> >> FocusOut event, serial 13, synthetic NO, window 0xe00021,
> >>    mode NotifyGrab, detail NotifyAncestor
> >>
> >> EnterNotify event, serial 13, synthetic NO, window 0xe00021,
> >>    root 0x5a, subw 0xe00025, time 3565375, (212,48), root:(216,78),
> >>    mode NotifyUngrab, detail NotifyVirtual, same_screen YES,
> >>    focus YES, state 0
> >>
> >> KeymapNotify event, serial 13, synthetic NO, window 0x0,
> >>    keys:  90  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
> >>           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
> >>
> >> FocusIn event, serial 13, synthetic NO, window 0xe00021,
> >>    mode NotifyUngrab, detail NotifyAncestor
> >>
> >> KeymapNotify event, serial 13, synthetic NO, window 0x0,
> >>    keys:  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
> >>           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
> >>
> >> LeaveNotify event, serial 13, synthetic NO, window 0xe00021,
> >>    root 0x5a, subw 0xe00025, time 3569046, (205,211), root:(209,241),
> >>    mode NotifyNormal, detail NotifyNonlinearVirtual, same_screen YES,
> >>    focus YES, state 0
> >>
> >> Does the window 0x0 in two events in the log(above) signify anything
> >> misbehaving?
> >> Your reply is much awaited and appreciated.
> >>
> >>
> >>> --
> >>> Jon TURNEY
> >>> Volunteer Cygwin/X X Server maintainer
> >>>
> >>
> >

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Running Java application with drag and drop support in cygwin
  2010-09-20 10:31             ` Dees
@ 2010-09-27 15:21               ` Jon TURNEY
  0 siblings, 0 replies; 9+ messages in thread
From: Jon TURNEY @ 2010-09-27 15:21 UTC (permalink / raw)
  To: cygwin-xfree; +Cc: deepali.shefali

On 20/09/2010 11:31, Dees wrote:
> Any update?
>
> On Wed, Dec 23, 2009 at 6:26 PM, Dees<deepali.shefali@gmail.com>  wrote:
>>
>> People, any clue? Struggling really hard.
>>
>> On Fri, Dec 18, 2009 at 11:23 AM, Dees<deepali.shefali@gmail.com>  wrote:
>>> Hi Jon,
>>>
>>> Did you get a chance to look at this?
>>>  From whatever posts available online, I could not get a clue what is
>>> going wrong.
>>> Please respond.
>>>
>>> Thanks,
>>> Shefali
>>>
>>> On Mon, Dec 14, 2009 at 12:12 PM, Dees<deepali.shefali@gmail.com>  wrote:
>>>> On Fri, Nov 13, 2009 at 8:26 PM, Jon TURNEY<jon.turney@dronecode.org.uk>  wrote:
>>>>> On 30/10/2009 09:06, Dees wrote:
>>>>>>
>>>>>> Your reply is much appreciated Jon. I will try to be more specific
>>>>>> about the problem in further mails.
>>>>>>
>>>>>> On Thu, Oct 29, 2009 at 8:11 PM, Jon TURNEY<jon.turney@dronecode.org.uk>
>>>>>>   wrote:
>>>>>>>
>>>>>>> On 28/10/2009 05:57, Dees wrote:
>>>>>>>>
>>>>>>>> I have developed a Java application involving jTree with extensive
>>>>>>>> drag and drop support, which runs correctly in my Linux box. However,
>>>>>>>> when I switch to a windows box and access the same Linux box using
>>>>>>>> cygwin x-server, the drag and drop in jTree stops working.
>>>>>>>> Interestingly, rest of the application still works fine. After
>>>>>>>> analyzing a bit I found that x-server is able to recognize the drag
>>>>>>>> event but fails to recognize a drop event.
>>>>>>>
>>>>>>> Details?
>>>>>>
>>>>>> OS : Suse Linux Enterprise Server 10 (i586)
>>>>>> Version : 10
>>>>>> Patch level : 3
>>>>>> Other version information:
>>>>>> Java : JDK 5
>>>>>> Cygwin setup-version: 2.573.2.3
>>>>>> Also tried using Xming 6.9.0.31 ssh same Linux setup from Windows, but
>>>>>> that also doesn't solve the problem.
>>>>>>
>>>>>>>
>>>>>>>> Is there any setting, which should be done prior to running the Java
>>>>>>>> swing applications?
>>>>>>>>
>>>>>>>> Here is a sample code which behaves in exactly same way.
>>>>>>>> http://www.java2s.com/Code/Java/Swing-JFC/TreeDragandDrop.htm
>>>>>>>
>>>>>>> I have no idea how to use that java code to reproduce the problem you are
>>>>>>> seeing.
>>>>>>
>>>>>> Using the above java code in Linux:
>>>>>> 1. Download and Install Java Development Toolkit on your Linux box
>>>>>> (Java sun download site:
>>>>>> http://java.sun.com/javase/downloads/index.jsp), if you do not have it
>>>>>> already.
>>>>>> 2. Save the sample code in the above link with the file name
>>>>>> TreeTester.java, say in /home/user/
>>>>>> 3. Navigate to TreeTester.java from shell, and compile the java code:
>>>>>>         # cd /home/user/
>>>>>>         # /usr/java/jdk1.5.0_14/bin/javac TreeTester.java
>>>>>>     Ignore any warnings of deprecated APIs.
>>>>>> 4. This will create a few .class files in /home/user/ directory. Final
>>>>>> step is to run the Java code, using:
>>>>>>         # /usr/java/jdk1.5.0_14/bin/java -classpath . TreeTester
>>>>>>     This will open up a GUI, with a jTree each on left and right pane.
>>>>>> You can drag and drop any of the leaf nodes from one jTree to the root
>>>>>> node of the other jTree and this should add a new node in the other
>>>>>> jTree. You will get messages on console for the operations being
>>>>>> performed. Now ssh the same box using cygwin/xming from any other
>>>>>> windows box, and run the application using command in step 4. You
>>>>>> should be able to drag (a small icon will come under cursor indicating
>>>>>> that something is being dragged) but when you will drop it, the new
>>>>>> node would not be added to the tree. Thats where lies my problem!!!
>>>>>
>>>>> Thanks for the test case and instructions, this makes it much easier for me
>>>>> to try it out.
>>>>>
>>>>> However, this testcase and your jar archive both work fine for me (using
>>>>> Xserver 1.7.1-3)!

Given that the test case works for me, but not for you, I suspect this going 
to be another Java bug (e.g. [1],[2]), which is fixed in the JDK I am using.

If this isn't fixed with the latest Xserver, I guess it might be possible to 
put another workaround into the Xserver, if I knew what the problem was, but 
since JDK 5 was EOL November 2009 [3], I'm not sure if it's worth the effort. 
   Looking at that, you don't seem to be using the last update (update 22), 
either.

[1] http://cygwin.com/ml/cygwin-xfree/2010-07/msg00034.html
[2] http://sourceware.org/bugzilla/show_bug.cgi?id=9848
[3] 
http://www.oracle.com/technetwork/java/javase/downloads/index-jdk5-jsp-142662.html

-- 
Jon TURNEY
Volunteer Cygwin/X X Server maintainer

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-09-27 15:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-28  5:57 Running Java application with drag and drop support in cygwin Dees
2009-10-29 14:41 ` Jon TURNEY
2009-10-30  9:06   ` Dees
2009-11-03  9:08     ` Dees
2009-11-13 14:56     ` Jon TURNEY
2009-12-14  6:42       ` Dees
     [not found]         ` <15fe165d0912172153o5c48e300s63d80704d0c504c8@mail.gmail.com>
2009-12-23 12:56           ` Dees
2010-09-20 10:31             ` Dees
2010-09-27 15:21               ` Jon TURNEY

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).