Coder Social home page Coder Social logo

Window doesn't respect placement about ksar HOT 14 CLOSED

vlsi avatar vlsi commented on August 20, 2024
Window doesn't respect placement

from ksar.

Comments (14)

Pitterling avatar Pitterling commented on August 20, 2024

This is done within the Desktop constructor
This code has never touched since 2010 ....

  public Desktop() {
    int wmargins = 90;
    int hmargins = 60;
    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
    initComponents();
    setBounds(wmargins, hmargins, screenSize.width - (wmargins * 2),
        screenSize.height - (hmargins * 2));

    DesktopPane.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
    setVisible(true);
  }

In my case (windows 3 multi-monitor) its always displayed on the main screen respecting the defined margins.
image

What is reported in your case ?

from ksar.

Luticus avatar Luticus commented on August 20, 2024

I have 3 separate examples. The first is a Debian 9/KDE 5 four monitor system. On this box the splash appears centered, but the main window appears large and off to the upper left. The second is a Laptop running centos 7 and KDE 4, in the case of a single monitor, everything is fine. In the case of dual monitors, the splash window appears in the middle of the two monitors as if it is treating them as one big unified screen, and the main window appears off to the left, but is not positioned correctly so what happens is that the app hangs over onto the right screen a bit. It's not a show stopper, the app is completely usable, it would just be nice to not have to move them every time.

from ksar.

Luticus avatar Luticus commented on August 20, 2024

If the app has only been designed to account for window placement on a windows desktop then this might not be something that can be done easily. I'm not sure how to go about it myself but I am looking into it. I even tried kde's ability to force windows to behave if they are considered "unmanaged" but in both 4 and 5 it doesn't seem to have much of an effect, yet.

from ksar.

Pitterling avatar Pitterling commented on August 20, 2024

this has not been designed for windows only .. its just to old that it respected multi-monitor support :)

I believe this might be your issue Rendering in a Multi-Screen Environment

Do you have the chance to debug to the mentioned code line and check for the reported screen size?

from ksar.

Pitterling avatar Pitterling commented on August 20, 2024

Could you please run the attached jar version (remove the .zip file extension)
ksar-5.2.4-SNAPSHOT-all.jar.zip

and provide the ksar_all.log output .. it should contain entries like this:

net.atomique.ksar.ui.Desktop - Screensize: java.awt.Dimension[width=1920,height=1200]
net.atomique.ksar.ui.Desktop - Screensize Screen[0][0]: java.awt.Rectangle[x=0,y=0,width=1920,height=1200]
net.atomique.ksar.ui.Desktop - Screensize Screen[1][0]: java.awt.Rectangle[x=1920,y=0,width=1920,height=1200]
net.atomique.ksar.ui.Desktop - Screensize Screen[2][0]: java.awt.Rectangle[x=-1920,y=109,width=1920,height=1080]]

from ksar.

Luticus avatar Luticus commented on August 20, 2024

Here's the log output, this was taken from a 4 monitor Debian 9 system running KDE 5. The montors are in this configuration:

....[X]......[1080].............
...[1080].[..4K..].[1080]

The main window appears about where that X is located and over hangs into the other monitors around it making it much easier to move then if it were completely off screen, so there's that at least. The splash is also off as it seems to simply appear in the center of the entire set of monitors. So in my case here it would be on the 4k monitor, slightly higher than the center of that screen, where as on a dual monitor system it appears halfway on the two screens, in the middle. The main window always appears off to the left somewhere close to but not exactly on the 0,0 point.

ksar_all.log

from ksar.

Pitterling avatar Pitterling commented on August 20, 2024

it seems that KDE returns the virtual coordinates .. even if there is no screen device

Screensize: java.awt.Dimension[width=7680,height=3240]
Screen[0][0]: java.awt.Rectangle[x=1920,y=1080,width=3840,height=2160]
Screen[1][0]: java.awt.Rectangle[x=5760,y=1898,width=1920,height=1080]
Screen[2][0]: java.awt.Rectangle[x=2880,y=0,width=1920,height=1080]
Screen[3][0]: java.awt.Rectangle[x=0,y=1956,width=1920,height=1080]

try this one - it will always only use the boundaries of screen[0] (in your case your 4K)
ksar-5.2.4-SNAPSHOT-all.jar.zip

from ksar.

Luticus avatar Luticus commented on August 20, 2024

Sorry I couldn't get back to you sooner, went out of town over the weekend. Looks like your code fixed the main window on my laptop with dual monitors. I made sure to disable any KDE rules too so it should be good. I'll test the 4 monitor setup when I get home this afternoon. The splash screen, however, is still broken on the dual monitor setup. It still appears right in the middle of them.

from ksar.

Luticus avatar Luticus commented on August 20, 2024

Sorry wanted to test the 4 monitor situation last night for you but got busy with Thanksgiving prep stuff so couldn't get around to it, I'll test it out tonight and let you know how it works.

from ksar.

Luticus avatar Luticus commented on August 20, 2024

I can confirm that the main window shows centered on the primary monitor in the case of both my 4k quad monitor setup, as well as my laptop with dual monitors. The splash still misbehaves but that's just an aesthetic thing. The program is, overall, much nicer for me to use now. Thanks for looking into this!

from ksar.

Luticus avatar Luticus commented on August 20, 2024

oh, did just realize that child windows misbehave too though. Like the about popup and the system preferences dialogue. They appear off screen and up to the left as the main window used to. Might want to check that out.

from ksar.

Pitterling avatar Pitterling commented on August 20, 2024

well, yes that's a mess since 5.1beta .. try this build .. this should fix all dialogs

ksar-5.2.4-SNAPSHOT-all.jar.zip

from ksar.

Luticus avatar Luticus commented on August 20, 2024

Yes, that seems to fix all dialogs, epic! Thanks!

from ksar.

Pitterling avatar Pitterling commented on August 20, 2024

Thanks for your help!

from ksar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.