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

wrong monitor on startup #4451

Open
veksha opened this issue Oct 15, 2022 · 2 comments
Open

wrong monitor on startup #4451

veksha opened this issue Oct 15, 2022 · 2 comments

Comments

@veksha
Copy link
Contributor

veksha commented Oct 15, 2022

  1. move CudaText window to second monitor
  2. maximize window!
  3. restart

CudaText will be opened on 1st monitor.
Windows

@Alexey-T
Copy link
Owner

On Ubuntu it works ok. will test on Win10.

@Alexey-T
Copy link
Owner

Alexey-T commented Oct 16, 2022

LCL function breaks it. Cud does

  procedure _Init_WindowMaximized;
  begin
    if FLastMaximized then
    begin
      FLastMaximized:= false;
      if (FLastMaximizedMonitor>=0) and (FLastMaximizedMonitor<Screen.MonitorCount) then
        BoundsRect:= Screen.Monitors[FLastMaximizedMonitor].BoundsRect;
      WindowState:= wsMaximized; //(1)
    end;
  end;

before (1), BoundsRect is set to the correct monitor's rect. eg to monitor 1. And (1) breaks it, it moves window to another monitor according to the last window position set. if last window position set is monitor 0, (1) moves window from monitor 1 to monitor 0.

cannot find the workaround yet.

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

No branches or pull requests

2 participants