Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misplaced Java Menu in Dual Screen #1411

Closed
totaam opened this issue Jan 16, 2017 · 24 comments
Closed

Misplaced Java Menu in Dual Screen #1411

totaam opened this issue Jan 16, 2017 · 24 comments
Labels

Comments

@totaam
Copy link
Collaborator

totaam commented Jan 16, 2017

Issue migrated from trac ticket # 1411

component: java | priority: trivial | resolution: needinfo | keywords: Java Menu Dual-Screen

2017-01-16 15:01:44: adarrab created the issue


Hi,
[[BR]]
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.
[[BR]]
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.
[[BR]]

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

xpra start :100 --start-child=policytool --dpi=96
xpra.exe  attach SERVER123:100
@totaam
Copy link
Collaborator Author

totaam commented Jan 17, 2017

2017-01-17 04:43:51: adarrab changed component from client to server

@totaam
Copy link
Collaborator Author

totaam commented Jan 17, 2017

2017-01-17 04:43:51: adarrab commented


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

Server (xpra v0.15.5) with Client (1.0.2-14780) is working fine.
[[BR]]

Best regards,

@totaam
Copy link
Collaborator Author

totaam commented Jan 19, 2017

2017-01-19 07:57:33: antoine changed owner from antoine to adarrab

@totaam
Copy link
Collaborator Author

totaam commented Jan 19, 2017

2017-01-19 07:57:33: antoine commented


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".

@totaam
Copy link
Collaborator Author

totaam commented Jan 19, 2017

2017-01-19 10:43:59: adarrab commented


Replying to [comment:2 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".

[[BR]]

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

@totaam
Copy link
Collaborator Author

totaam commented Jan 19, 2017

2017-01-19 11:42:52: adarrab commented


Ok it is java dependant
[[BR]]
1.8.0_101 (Working fine)
1.7.0_40 (bug occurs)
1.6_64 (bug occurs)
[[BR]]
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-14734) and client (1.0.2-14780)

Thanks,

@totaam
Copy link
Collaborator Author

totaam commented Jan 19, 2017

2017-01-19 11:46:29: adarrab uploaded file image.jpeg (161.4 KiB)

screenshot

@totaam
Copy link
Collaborator Author

totaam commented Jan 19, 2017

2017-01-19 12:01:53: antoine commented


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:

  • uptodate 1.7 is release u80: [http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html]
  • uptodate 1.6 is release u45: [http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html]

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

@totaam
Copy link
Collaborator Author

totaam commented Jan 19, 2017

2017-01-19 13:05:22: adarrab uploaded file Xpra_Defect_1411.log (92.5 KiB)

log file

@totaam
Copy link
Collaborator Author

totaam commented Jan 19, 2017

2017-01-19 13:11:23: adarrab commented


Log is attached,
[[BR]]
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.
[[BR]]
Thank you,

@totaam
Copy link
Collaborator Author

totaam commented Jan 19, 2017

2017-01-19 13:18:29: antoine commented


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.

@totaam
Copy link
Collaborator Author

totaam commented Jan 19, 2017

2017-01-19 14:22:32: adarrab commented


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

@totaam
Copy link
Collaborator Author

totaam commented Jan 19, 2017

2017-01-19 16:02:06: adarrab commented


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

  • java-1.7.0-openjdk & java-1.7.0-openjdk-devel (1.7.0_121)[[BR]]

  • xpra v1.0.1-14734
    [[BR]]

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

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. [[BR]]
[[BR]]

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

@totaam
Copy link
Collaborator Author

totaam commented Jan 19, 2017

2017-01-19 16:05:13: adarrab uploaded file Xpra_Defect_1411.jpg (126.1 KiB)

Screenshot 2
Xpra_Defect_1411.jpg

@totaam
Copy link
Collaborator Author

totaam commented Jan 19, 2017

2017-01-19 17:51:54: antoine commented


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 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.

@totaam
Copy link
Collaborator Author

totaam commented Feb 21, 2017

2017-02-21 12:45:04: antoine changed status from new to closed

@totaam
Copy link
Collaborator Author

totaam commented Feb 21, 2017

2017-02-21 12:45:04: antoine set resolution to needinfo

@totaam
Copy link
Collaborator Author

totaam commented Feb 21, 2017

2017-02-21 12:45:04: antoine commented


Not heard back, closing.

@totaam totaam closed this as completed Feb 21, 2017
@totaam
Copy link
Collaborator Author

totaam commented Apr 25, 2017

2017-04-25 16:50:42: adarrab commented


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-15455 ; 1.0.2-14941 ; 1.0.2-14780 ; 1.0.1-14723)

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

Thanks,

@totaam
Copy link
Collaborator Author

totaam commented Apr 22, 2019

2019-04-22 11:44:25: heenwu changed priority from major to critical

@totaam
Copy link
Collaborator Author

totaam commented Apr 22, 2019

2019-04-22 11:44:25: heenwu commented


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

@totaam
Copy link
Collaborator Author

totaam commented Apr 29, 2019

2019-04-29 11:30:17: irony changed priority from critical to trivial

@totaam
Copy link
Collaborator Author

totaam commented Apr 29, 2019

2019-04-29 11:30:17: irony changed component from server to java

@totaam
Copy link
Collaborator Author

totaam commented Apr 29, 2019

2019-04-29 11:30:17: irony commented


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant