You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into an issue using the interactive graphics mode with a multi-monitor setup on Linux/X11. When launching a simulation, the fullscreen window launches on my main monitor, but the actual visualization inside the window is off-center. The same off-centeredness is also apparent for where the cursor gets picked up. This seems to be caused by DisplayWidth() and DisplayHeight() returning the total/combined size of all monitors, instead of only the size of the main monitor, causing the calculation of the center to be off. See attached screenshot.
I noticed that direct PRs are not accepted, but I wanted to share a workaround for anyone else facing this issue. If it suits the project, feel free to incorporate this into the codebase. The patch uses Xrandr to obtain the dimensions of the primary monitor, which ensures correct positioning of the simulation and mouse cursor. Note that this fix adds a dependency to Xrandr and could probably benefit from some better error handling.
To build, you'll have to add -lXrandr to the linker flags, e.g. g++ src/*.cpp -o bin/FluidX3D -std=c++17 -pthread -I./src/OpenCL/include -L./src/OpenCL/lib -lOpenCL -I./src/X11/include -L./src/X11/lib -lXrandr -lX11
I don't think it should matter, but for reference, I'm using:
Gnome 45
Xorg 21.1.10-1
Nvidia RTX 4090 with version 545.29.06 of the proprietary drivers
Kernel 6.7.0
The resolution of my 3 displays are (xrandr --query | grep " connected"):
HDMI-0 connected 1920x1080+0+1268 (normal left inverted right x axis y axis) 344mm x 193mm
DP-2 connected 1440x2560+5360+0 right (normal left inverted right x axis y axis) 597mm x 336mm
DP-4 connected primary 3440x1440+1920+306 (normal left inverted right x axis y axis) 797mm x 334mm
Cheers, and have a great weekend.
The text was updated successfully, but these errors were encountered:
thank you so much for reporting this bug AND proposing a fix!
I have fixed the multi-monitor issues now:
your fixes are the main part, to get the resolution of the primary monitor
to place the fullscreen window always on the primary monitor, I had to query the offset coordinates and apply them with XSetNormalHints
catch the cursor from anywhere on the multi-monitor area and place it on the primary monitor
to make it work on any system without the packages libx11-dev, x11proto-dev, libxrandr-dev and libxrender-dev installed (in case users don't have sudo permissions), I've pulled the additional headers and the additional lib from these packages and included them directly in the FluidX3D repo
Hi, and thanks for the cool software.
I ran into an issue using the interactive graphics mode with a multi-monitor setup on Linux/X11. When launching a simulation, the fullscreen window launches on my main monitor, but the actual visualization inside the window is off-center. The same off-centeredness is also apparent for where the cursor gets picked up. This seems to be caused by DisplayWidth() and DisplayHeight() returning the total/combined size of all monitors, instead of only the size of the main monitor, causing the calculation of the center to be off. See attached screenshot.
I noticed that direct PRs are not accepted, but I wanted to share a workaround for anyone else facing this issue. If it suits the project, feel free to incorporate this into the codebase. The patch uses Xrandr to obtain the dimensions of the primary monitor, which ensures correct positioning of the simulation and mouse cursor. Note that this fix adds a dependency to Xrandr and could probably benefit from some better error handling.
To build, you'll have to add -lXrandr to the linker flags, e.g.
g++ src/*.cpp -o bin/FluidX3D -std=c++17 -pthread -I./src/OpenCL/include -L./src/OpenCL/lib -lOpenCL -I./src/X11/include -L./src/X11/lib -lXrandr -lX11
I don't think it should matter, but for reference, I'm using:
HDMI-0 connected 1920x1080+0+1268 (normal left inverted right x axis y axis) 344mm x 193mm
DP-2 connected 1440x2560+5360+0 right (normal left inverted right x axis y axis) 597mm x 336mm
DP-4 connected primary 3440x1440+1920+306 (normal left inverted right x axis y axis) 797mm x 334mm
Cheers, and have a great weekend.
The text was updated successfully, but these errors were encountered: