featurecat / lizzie

Lizzie - Leela Zero Interface
GNU General Public License v3.0
972 stars 228 forks source link

Deals deals badly with portrait mode resolutions #395

Open fsh opened 6 years ago

fsh commented 6 years ago

Starting current next branch on a monitor in portrait mode (rotated 90 degrees) gives the following exception in a loop:

Exception in thread "AWT-EventQueue-1" java.lang.IllegalArgumentException: Width (0) and height (32) cannot be <= 0
    at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1016)
    at java.awt.image.BufferedImage.<init>(BufferedImage.java:333)
    at featurecat.lizzie.gui.LizzieFrame.drawPonderingState(LizzieFrame.java:571)
    at featurecat.lizzie.gui.LizzieFrame.paint(LizzieFrame.java:449)
    at javax.swing.RepaintManager$4.run(RepaintManager.java:842)
    at javax.swing.RepaintManager$4.run(RepaintManager.java:814)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814)
    at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:789)
    at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:738)
    at javax.swing.RepaintManager.access$1200(RepaintManager.java:64)
    at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1732)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at org.GNOME.Accessibility.AtkWrapper$6.dispatchEvent(AtkWrapper.java:715)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

This is merely the latest symptom of a larger problem though, in that Lizzie has always been poor at dealing with resolutions that are taller than they are wide, e.g. for a programmer/work setup like this, which is similar to mine: http://www.computeraideddesignguide.com/wp-content/uploads/2017/01/stacked-monitors-portrait-mode-300x216.jpg

Using a tiling window manager (such as xmonad) which automatically manage your windows, you have to create a special rule / manually set up the Lizzie window every time you start it, which is kind of disruptive. And even then you get a pretty small display with lots of wasted space on the workspace.

For example some option (or automatic inference) to place variation tree, graph, and miniboard on top/bottom instead of on the sides (or an option to have them in separate windows like the "mylizzie" fork, which also works very well).

zsalch commented 6 years ago

I think it be better to be able to provide a blended and separated mode. It is interesting to display different windows on different monitors.

zsalch commented 6 years ago

Btw, how to reproduce this problem, I tried it, it seems that there is no such an exception.

fsh commented 6 years ago

It manages to paint only once: it paints the board and also a HUGE black stone in the upper left on x=0 coordinate. See screenshot. But after this it doesn't repaint while spewing out the above exceptions (and window becomes white if I alt-tab to something else).

Gives same result for 1440x2560 or 1080x1920 resolution (screenshot is on 1440x2560 monitor, but looks the same on 1080x1920). Linux, xmonad window manager, 390.77 NVIDIA drivers. Doesn't seem to matter if I set AWT_TOOLKIT environment variable or not.

This is as I said on the next branch, latest commit (e2c7991622dd47e6520ebf8c718b62fe9a5ba2a8).

Of course I can work around it, either by making my window manager handle it specially to start in a smaller and wider window, or by manually popping it out and resizing it with the mouse each time, but it's kind of annoying.

2018-10-09_07 42_1440x2560

zsalch commented 6 years ago

I see, currently the lizzie supports only landscape mode, it needs adjust posisions of panels to support portrait mode. May be I'll do the work later.

zsalch commented 6 years ago

@fsh I have released a beta version: here You can to try. It can support portrait mode, although it is not perfect, but it works. In this mode, I feel that the layout is very crowded. Maybe you can have some good suggestions.