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

Dialogs appear on different monitors in dual display setup #885

Open
w3333 opened this issue Jun 29, 2021 · 8 comments
Open

Dialogs appear on different monitors in dual display setup #885

w3333 opened this issue Jun 29, 2021 · 8 comments

Comments

@w3333
Copy link

w3333 commented Jun 29, 2021

Would it be possible to fix that? I have 2 monitors (running Linux), Lizzie main window is on the secondary screen. All dialogs (analyze-all, open, delete-node-warning ...) will still appear on the primary monitor. Would be so nice if they appear on the same monitor where the main window is located. Otherwise such a great tool, still my favorite for analysis.

@kaorahi
Copy link
Contributor

kaorahi commented Jun 30, 2021

Can you try this for "a" key (run automatic analysis of game), for example?

--- a/src/main/java/featurecat/lizzie/rules/Board.java
+++ b/src/main/java/featurecat/lizzie/rules/Board.java
@@ -1388,7 +1388,7 @@ public class Board implements LeelazListener {
       if (!getNextMove().isPresent()) return;
       String answer =
           JOptionPane.showInputDialog(
-              "# playouts for analysis (e.g. 100 (fast) or 50000 (slow)): ");
+              Lizzie.frame, "# playouts for analysis (e.g. 100 (fast) or 50000 (slow)): ");
       try {
         playoutsAnalysis = Integer.parseInt(answer);
       } catch (NumberFormatException err) {

@w3333
Copy link
Author

w3333 commented Jun 30, 2021

Hi kaorahi,

you mean fumble around in the code? I mean, I was a programmer, but I have no clue about Lizzie or what to do to make these changes... but I could try. But I see what you do there, that looks like it would be the fix.

kaorahi pushed a commit to kaorahi/lizzie that referenced this issue Jul 1, 2021
@kaorahi
Copy link
Contributor

kaorahi commented Jul 1, 2021

Would you test this if you can compile it?

https://github.com/kaorahi/lizzie/tree/fix885_dual

I dare to make the patch on #884 (patched 0.7.4) because we also need to fix several patches in #884 for #885.

@w3333
Copy link
Author

w3333 commented Jul 1, 2021

Is it the official build process described in https://github.com/kaorahi/lizzie/blob/fix885_dual/README.md ? Then I could try.

@kaorahi
Copy link
Contributor

kaorahi commented Jul 1, 2021

Yes. Just two steps if the environment is ready.

$ mvn package
$ java -jar target/lizzie-0.7.4-shaded.jar

@w3333
Copy link
Author

w3333 commented Jul 1, 2021

I think I'm too stupid... I did
git clone https://github.com/kaorahi/lizzie.git
cd lizzie
In src/main/java there is no "featurecat"-dir, only "wagner", then "stephanie". And there in rules/Board.java I cannot find the line you mention. Even the class header doesn't have an implements-clause...

@kaorahi
Copy link
Contributor

kaorahi commented Jul 1, 2021

Ah, my words were too few. Please forget my first post. You don't need to edit the source code by yourself. I checked all such flaws and made a fixed version.

You may need to install some packages for Java beforehand. This step depends on your Linux distribution. In my case:

$ sudo apt-get install default-jdk maven

To test my fixed version, just open https://github.com/kaorahi/lizzie/tree/fix885_dual, click the green "Code" button, and click "Download ZIP". Then...

$ unzip lizzie-fix885_dual.zip
$ cd lizzie-fix885_dual
$ cp ~/SOMEWHERE/LEELAZ_BINARY/leelaz ./leelaz
$ cp ~/SOMEWHERE/LEELAZ_NETWORK_WEIGHTS/XXXXXX.gz ./lznetwork.gz
$ mvn package
$ java -jar target/lizzie-0.7.4-shaded.jar

@w3333
Copy link
Author

w3333 commented Jul 1, 2021

Yep, looks good! Thanks!

kaorahi pushed a commit to kaorahi/lizzie that referenced this issue Jul 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants