_NET_WORKAREA and multiple monitors

Brian J. Tarricone brian at tarricone.org
Tue Aug 4 00:58:39 CEST 2009


On 08/03/2009 07:47 AM, Olivier Fourdan wrote:
> 2009/8/3 Olivier Fourdan<fourdan at gmail.com>:
>> Hi Brian,
>>
>> 2009/7/23 Brian J. Tarricone<brian at tarricone.org>:
>>> Jerome is working on proper positioning of notifications for xfce4-notifyd,
>>> and he's running into a problem with multi-monitor setups.  We want to
>>> follow _NET_WORKAREA to avoid trying to place notifications over panels and
>>> such (actually, I think Jerome says if he tries to, the WM moves them out of
>>> the panel's strut area, which screws up the rest of our positioning).
>>>
>>> However, with multiple monitors, this doesn't work.  Jerome made a little
>>> mockup to illustrate:
>>>
>>> http://pocentek.net/~jeromeg/misc/screen.png
 >>
>> I think this should be more appropriate on the devel mailing list :)

Heh, yeah, good point.  Forwarded...

>>> The two blue rectangles are the actual monitor areas, and the dashed red
>>> rectangle is what _NET_WORKAREA reports.  Obviously, we lose a bit of screen
>>> space here.  (This is also a problem for xfdesktop's icon placement, though
>>> I'd never had a dual-head setup to test this with).
>>>
>>> I can understand how, logically, you wouldn't want _NET_WORKAREA to contain
>>> regions that aren't visible, but in my mind, you most likely eliminate a lot
>>> of 'real' space that way.
>>>
>>> I would think the better way would be for _NET_WORKAREA to contain the space
>>> enclosed by both monitors, and then a user of that property would be
>>> required to check monitor geometry (by using
>>> gdk_screen_get_monitor_geometry() or whatever) and then only place things in
>>> the intersection of _NET_WORKAREA and the real monitor geom.
>>>
>>> I looked at the netwm spec, and it didn't say anything about how
>>> _NET_WORKAREA should behave with multiple monitors of different resolutions,
>>> so I'm not sure if there's a real "right" and "wrong" here according to the
>>> spec.
>>>
>>> What do you think?
 >>
>> Basically, the spec says:
>>
>> "Work area SHOULD be used by desktop applications to place desktop
>> icons appropriately"
>>
>> If you include non visible area, you will end up with icons
>> potentially being invisible, which defeats the benefits of having
>> _NET_WORKAREA

Right, but _NET_WORKAREA is then useless on multihead when you have 
monitors with different resolutions if you follow that interpretation. 
Well, maybe not "useless" -- it does serve the purpose of ensuring that 
you don't place things in non-visible areas.  But it also artificially 
"hides" some (potentially large) areas that *are* visible.

>> But then it gets totally confusing, because it's a standard and kwin
>> and metacity give different results from xfwm4, for example here I
>> get:
>>
>>
>> xfwm4:
>> _NET_WORKAREA(CARDINAL) = 0, 0, 2944, 745, 0, 0, 2944, 745, 0, 0,
>> 2944, 745, 0, 0, 2944, 745
>>
>> metacity:
>> _NET_WORKAREA(CARDINAL) = 1024, 0, 1920, 1200, 1024, 0, 1920, 1200,
>> 1024, 0, 1920, 1200, 1024, 0, 1920, 1200
>>
>> kwin:
>> _NET_WORKAREA(CARDINAL) = 0, 0, 2944, 1200, 0, 0, 2944, 1200, 0, 0,
>> 2944, 1200, 0, 0, 2944, 1200

What's your monitor resolution?  (And is that dual head?)  I'm having a 
hard time interpreting that without knowing...

> Humm, but...
>
> The spec says:
>
> "The Window Manager SHOULD calculate this space by taking the current
> page minus space occupied by dock and panel windows, as indicated by
> the _NET_WM_STRUT or _NET_WM_STRUT_PARTIAL properties set on client
> windows."
>
> And the panel sets its struts to:
>
> _NET_WM_STRUT(CARDINAL) = 0, 0, 0, 455
> _NET_WM_STRUT_PARTIAL(CARDINAL) = 0, 0, 0, 455, 0, 0, 0, 0, 0, 0, 0, 1023
>
> So the height should be 1200 - 455 = 745
>
> The calculation is therefoer correct and in line with the spec (while
> both metacity and kwin have it wrong IMHO).

Yes, I suppose it is indeed in line with the spec, but... that's still 
not helpful.  It makes _NET_WORKAREA useless for xfce4-notifyd 
placement[1], and, now that I know about it, also useless for xfdesktop 
icon placement.

	-brian

[1] And, actually, it's actively harmful.  If the user wants a default 
position of "bottom right" for notifications, and you have a setup like 
Jerome's graphic, then notifications will show up completely wrong on 
the second monitor because xfce4-notifyd thinks there's a panel or 
something in the bottom quarter or so of the screen.



More information about the Xfce4-dev mailing list