Xpra: Ticket #1411: Misplaced Java Menu in Dual Screen

Hi,
Happens with some java applications, when you launch them on monitor 1, then drag the main window to monitor 2, clicking on the menu will launch the menu in monitor 1.
If the application stays in monitor 1 (where it started) then the menu appears where it should. The problem only when the main is moved to the second monitor.

Server: CentOS 6.5 (xpra v1.0.1-r14734) Client: Windows 7 64 (xpra 1.0.2-r14780). Dual display 1920x1200 - Orientation: Landscape, mode: Extended.
To reproduce, you can use the simple java application "policytool"

xpra start :100 --start-child=policytool --dpi=96
xpra.exe  attach SERVER123:100


Tue, 17 Jan 2017 04:43:51 GMT - adarrab: component changed

After few more tests, I think the problem is with recent versions of server component.

Server (xpra v0.15.5) with Client (1.0.2-r14780) is working fine.

Best regards,


Thu, 19 Jan 2017 07:57:33 GMT - Antoine Martin: owner changed

I cannot reproduce: I've tried with JDK 5, 6, 7 and 8 on Fedora, and openjdk 1.7.0.121 on centos 6.8, all connecting from a dual monitor Windows 7 Ultimate running 1.0.2.

If you can still reproduce this bug, please include a screenshot and post the client and server output when running with the debug option "-d geometry".


Thu, 19 Jan 2017 10:43:58 GMT - adarrab:

Replying to Antoine Martin:

I cannot reproduce: I've tried with JDK 5, 6, 7 and 8 on Fedora, and openjdk 1.7.0.121 on centos 6.8, all connecting from a dual monitor Windows 7 Ultimate running 1.0.2.

If you can still reproduce this bug, please include a screenshot and post the client and server output when running with the debug option "-d geometry".


I guess there are other variables i.e. tried "policytool" on RHEL 6.6 and couldn't reproduce the problem.
I'll try to reproduce it on a wide range of RHEL/Centos releases and get back to you.


Thu, 19 Jan 2017 11:42:51 GMT - adarrab:

Ok it is java dependant
1.8.0_101 (Working fine) 1.7.0_40 (bug occurs) 1.6_64 (bug occurs)
Here is a simple code to reproduce:

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class menu extends JPanel implements ActionListener {
	public menu() {	}
	public void actionPerformed(ActionEvent e) {}
	public static void main(String[] args) {
		JFrame frame = new JFrame();
		JMenuBar menuBar = new JMenuBar();
		JMenu fileMenu = new JMenu("File");
		JMenuItem openMenuItem = new JMenuItem("Open");
		JMenuItem item1 = new JMenuItem("item1");
		JMenuItem item2 = new JMenuItem("item2");
		JMenuItem item3 = new JMenuItem("item3");
		JMenuItem item4 = new JMenuItem("item4");
		JMenuItem item5 = new JMenuItem("item5");
		fileMenu.add(openMenuItem);
		fileMenu.add(item1);
		fileMenu.add(item2);
		fileMenu.add(item3);
		fileMenu.add(item4);
		fileMenu.add(item5);
		menuBar.add(fileMenu);
		frame.setJMenuBar(menuBar);
		frame.setTitle("Java Menu");
		frame.setSize(300, 200);
		frame.addWindowListener(new WindowAdapter() {
			public void windowClosing(WindowEvent e) {
				System.exit(0);
			}
		});
		Container contentPane = frame.getContentPane();
		contentPane.add(new menu());
		frame.setVisible(true);
	}
}

Save as menu.java Compile: javac menu.java run: java menu

with jdk1.6_64 or 1.7.0_40 , the problem appears when running on xpra server (xpra v1.0.1-r14734) and client (1.0.2-r14780)

Thanks,


Thu, 19 Jan 2017 11:46:28 GMT - adarrab: attachment set

screenshot


Thu, 19 Jan 2017 12:01:53 GMT - Antoine Martin:

Not the first time that Java does odd things with window management (#770, #705 and many more).

Please try with an up to date version of each JDK:

Please also make sure that your server system uses the patched dummy driver, and include "xpra info" for one of the "buggy" running instances.


Thu, 19 Jan 2017 13:05:22 GMT - adarrab: attachment set

log file


Thu, 19 Jan 2017 13:11:23 GMT - adarrab:

Log is attached,
Unfortunately, controlling java is not always possible especially that applications are provided by different vendors and some ship with their own runtime. Of course ideally will use the java that works, but I was hoping for a fix within Xpra since that older release 0.15.5 doesn’t have this issue.
Thank you,


Thu, 19 Jan 2017 13:18:28 GMT - Antoine Martin:

Still cannot reproduce, I've tried your example running on a Fedora 25 which had an old JDK 1.6 already installed, I also installed the latest 1.6 SDK on a centos 6.8 system. (and connected from a win7 system with dual 1920x1440 displays) There must be something else at play here.


Thu, 19 Jan 2017 14:22:32 GMT - adarrab:

The same steps reproduces it on Centos 6.5 , Java 1.7.0_45.
Since you have Centos 6.8, I'll download it and try to reproduce it there.
Best regards,


Thu, 19 Jan 2017 16:02:06 GMT - adarrab:

I installed a fresh copy of CentOS 6.8 (final)
Also installed:


Same problem and it is reproducible using the procedure above with the simple menu.java example.

I've attached another snapshot of my other windows machine (mentioned in the initial inquiry) the problem in this one is that the menu is stuck to the edge of the screen and can't pass to the second one.

Any hints on what else I can do to get to the root cause?


Thu, 19 Jan 2017 16:05:13 GMT - adarrab: attachment set

Screenshot 2


Thu, 19 Jan 2017 17:51:54 GMT - Antoine Martin:

I definitely cannot reproduce the bug with this setup. I've just tried again.

So there must be a difference between what you're doing and how I am trying to reproduce it. Please try to answer as many questions as possible from wiki/ReportingBugs. Maybe your installation is different? Maybe a package is missing? (patched dummy driver? etc) Please post your full (minimal) list of packages for reproducing the problem. Exact command lines, etc.


Tue, 21 Feb 2017 12:45:04 GMT - Antoine Martin: status changed; resolution set

Not heard back, closing.


Tue, 25 Apr 2017 15:50:42 GMT - adarrab:

This bug is actually gone with xpra-1.0.6-1.r15523 (server on CentOS 6.8)

Tried many clients from the 1.x branch and they all seem to work fine (1.0.5-r15455 ; 1.0.2-r14941 ; 1.0.2-r14780 ; 1.0.1-r14723)

So, I guess this was a server bug which was resolved somewhere between 1.0.1 - 1.0.6

Thanks,


Mon, 22 Apr 2019 10:44:25 GMT - heenwu: priority, version changed

is this a server or client bug? I always cannot resolve it.


Mon, 29 Apr 2019 10:30:17 GMT - Irony: priority, component changed

Just now, I test on jdk 1.8 and 1.7

result: 1.8 is ok 1.7 is wrong

I think this is java's bug


Sat, 23 Jan 2021 05:23:34 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1411