Kalmat / PyMonCtl

Cross-Platform module which provides a set of features to get info on and control monitors/screens/displays.
BSD 3-Clause "New" or "Revised" License
5 stars 3 forks source link

LINUX: Fix _getAllMonitorsDict() crashes when _NET_WORKAREA is not set #2

Closed odknt closed 1 year ago

odknt commented 1 year ago

_NET_WORKAREA is not always set. Some Window Managers, such as i3-wm and bspwm, do not intentionally set it.

You can use _NET_SUPPORTED to check if _NET_WORKAREA is available, but you will need an alternative anyway.

For the time being, this PR will use the monitor information as it is. This is probably better than crashing.

Kalmat commented 1 year ago

Hi! Sorry for my late reply since I've been out these days, with no access to my "stuff". Thank you so much for your help!!!

I was not aware that _NET_WORKAREA could be unset. Big issue solved thanks to you. I fully agree with your implementation, using DESKTOP_GEOMETRY as fallback values for WORKAREA.

Thank you again!!!