ice-wm / icewm

IceWM releases only, see Wiki
https://github.com/ice-wm/icewm/releases
Other
289 stars 16 forks source link

Issues with multi-monitor setup #116

Closed vincele closed 1 year ago

vincele commented 1 year ago

Hello,

I'm trying to use a second monitor, and I've met issues...

The primary monitor is not rotated. It is placed a bit lower than the second one's top. The second monitor is rotated and placed to the left of the primary. The panel is on the primary monitor, at the top.

$ icesh randr
0: 2560x1440+1080+176
1: 1080x1920+0+0
2: 0x0+0+0
3: 0x0+0+0
4: 0x0+0+0

$  icesh xinerama
0: 2560x1440+1080+176
1: 1080x1920+0+0

After enabling the second monitor by using xrandr to place & rotate appropriately:

xrandr \
  --output DisplayPort-0 --primary --mode 2560x1440 --pos 1080x176 --rotate normal \
  --output HDMI-A-0 --mode 1920x1080 --pos 0x0 --rotate left \
  --output DVI-D-0 --off

The maximized apps on the first monitor are remaximized not taking the panel size in account, i.e. they are maximized to the screen size, not to the screen size minus the panel size, like they were in single monitor mode.

Some applications are moved to the second monitor. I don't know why, and would rather they stay where they were.

Maximizing on the second monitor is also having problems, there the panel height is used, so the apps are not really maximized.

Then if I disable the second monitor by using xrandr:

xrandr \
  --output DisplayPort-0 --primary --mode 2560x1440 --pos 0x0 --rotate normal \
  --output HDMI-A-0 --off \
  --output DVI-D-0 --off

The apps then maximize to a smaller area than the screen, 202 pixels lower than the top: 2560x1220+0+202

Those 202 pixels look suspiciously like 176 (the primary screen offset from the secondary) + 26 (the taskbar height)

I've had a look at the wmframe.cc::YFrameWindow::getNewPos() code, there's a check for taskbar's screen being the same as app frame, this may be where one of the the problems is.

gijsbers commented 1 year ago

Does this help?

gijsbers commented 1 year ago

Monitor the _NET_WORKAREA property on the root window with xprop -root _NET_WORKAREA.

Experiment with different settings for the NetWorkAreaBehaviour preference.

vincele commented 1 year ago

it's fixed, thanks