8000 [Bug] [Linux] New floating windows placement on multi-monitor setup · Issue #747 · DanWBR/dwsim · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Bug] [Linux] New floating windows placement on multi-monitor setup #747

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

Open
einhander opened this issue Mar 4, 2025 · 5 comments
Open
Labels
bug Something isn't working

Comments

@einhander
Copy link

Describe the bug
Some new floating window placement are wrong in multi-monitor setup. See the screencast in this comment: #744 (comment)

To Reproduce

  1. Use multimonitor setup
  2. Create new flowsheet

Expected behavior
All new windows appear in center of active monitor.

Desktop:

  • OS: Linux Debian Testing with Awesome WM as window manager
  • Version 9.0.0

Additional context

It's a minor problem

@einhander einhander added the bug Something isn't working label Mar 4, 2025
@DanWBR
Copy link
Owner
DanWBR commented Mar 5, 2025

@einhander it seems that Screen.PrimaryScreen.WorkingArea.Center in

public static void Center(this Form form)
{
if (!Application.Instance.Platform.IsGtk)
{
var center = Screen.PrimaryScreen.WorkingArea.Center;
center.X -= form.Width / 2;
center.Y -= form.Height / 2;
form.Location = new Point(center);
}
else
{
if (GlobalSettings.Settings.RunningPlatform() != GlobalSettings.Settings.Platform.Linux)
{
var center = Screen.PrimaryScreen.WorkingArea.Center;
center.X -= form.Width / 2;
center.Y -= form.Height / 2;
form.Location = new Point(center);
}
else
{
var center = Screen.DisplayBounds.Center;
center.X -= form.Width / 2;
center.Y -= form.Height / 2;
form.Location = new Point((int)center.X, (int)center.Y);
}
}
}

is returning the total area of all monitors. Last time I tried Screen.DisplayBounds.Center, it was returning null on Linux.

@einhander
Copy link
Author

The placement of normal windows is OK for me. The dialog windows are also OK.

@DanWBR
Copy link
Owner
DanWBR commented Mar 6, 2025

@einhander how is it doing in v9.0.1? same behavior?

@einhander
Copy link
Author

@DanWBR thank you. Please, wait till end of next week. I'll have to check it with my multi-monitor setup in university.

@einhander
Copy link
Author

@DanWBR That's better, but not perfect, see screencast

output1.mp4

The new window only appears on a non-active monitor. I think you are using the primary monitor instead of the active monitor.
Here is xrandr output for primary monitor:

eDP connected primary 1920x1080+3840+0

So using the primary monitor as the spawn point will result in new windows only appearing on one fixed monitor.
I briefly checked the eto documentation and can't see if it's possible to get an active monitor.
The workaround for this problem is to set to these windows properties to _NET_WM_WINDOW_TYPE_NORMAL instead of _NET_WM_WINDOW_TYPE_UTILITY as it is now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants
0