Created attachment 5573 Use bounding rectangle of all monitors I normally connect an external VGA monitor to my laptop in the following setup: Screen 0: minimum 8 x 8, current 2646 x 1024, maximum 32767 x 32767 LVDS1 connected 1366x768+0+0 VGA1 connected 1280x1024+1366+0 Unplugging the VGA monitor gives the following setup: Screen 0: minimum 8 x 8, current 2646 x 1024, maximum 32767 x 32767 LVDS1 connected 1366x768+0+0 VGA1 disconnected 1280x1024+1366+0 Note that only the laptop display is connected, but the X11 screen is still larger enough to encompass both monitors. xfce4-panel currently doesn't handle this situation correctly, and the panel, which is normally at the bottom of the laptop display, moves down to the bottom of the X11 screen, below the edge of the laptop display, and becomes invisible. The cause of the problem is the "fast path" in panel-window.c that calculates the panel position for only one monitor (or for a panel spanning all monitors). The current "fast path" code looks only at the X11 screen size, whereas it should be looking at the monitor layout. My patch fixes the problem by calculating the bounding rectangle of all monitors and using that rectangle in place of the X11 screen size.
(In reply to John Lindgren from comment #0) > I normally connect an external VGA monitor to my laptop in the following > setup: > > Screen 0: minimum 8 x 8, current 2646 x 1024, maximum 32767 x 32767 > LVDS1 connected 1366x768+0+0 > VGA1 connected 1280x1024+1366+0 > > Unplugging the VGA monitor gives the following setup: > > Screen 0: minimum 8 x 8, current 2646 x 1024, maximum 32767 x 32767 > LVDS1 connected 1366x768+0+0 > VGA1 disconnected 1280x1024+1366+0 Can't see any difference between the values before and after.
(In reply to Olivier Fourdan from comment #1) > Can't see any difference between the values before and after. (Except it's disconnected of course)
What version of Xorg is this? With which DDX/version as well? I cannot reproduce the issue.
xorg-server 1.17.1 xf86-video-intel 2.99.917
(In reply to Olivier Fourdan from comment #1) > Can't see any difference between the values before and after. It is the same "not normal" case you responded to here: https://bugzilla.xfce.org/show_bug.cgi?id=5795#c28 To reproduce, it's necessary to get the logical X11 screen size larger than the only remaining connected monitor. Disconnecting a VGA monitor (and *not* running e.g. xrandr --auto afterwards to adjust the logical screen size) is one way to do this.
(In reply to John Lindgren from comment #5) > (In reply to Olivier Fourdan from comment #1) > > Can't see any difference between the values before and after. > > It is the same "not normal" case you responded to here: > https://bugzilla.xfce.org/show_bug.cgi?id=5795#c28 > > To reproduce, it's necessary to get the logical X11 screen size larger than > the only remaining connected monitor. Disconnecting a VGA monitor (and > *not* running e.g. xrandr --auto afterwards to adjust the logical screen > size) is one way to do this. As commented in bug 11059, strut is relative to the screen edge, and not the edge of the xinerama monitor so the current behavior seems correct. The /logical/ screen size should be updated when a monitor is disconnected.
(In reply to Olivier Fourdan from comment #6) > As commented in bug 11059, strut is relative to the screen edge, and not the > edge of the xinerama monitor so the current behavior seems correct. This patch doesn't change the strut calculation. See https://bugzilla.xfce.org/show_bug.cgi?id=11059#c7. > The /logical/ screen size should be updated when a monitor is disconnected. I agree, in theory. However, in practice this doesn't always happen.
(In reply to John Lindgren from comment #7) > > The /logical/ screen size should be updated when a monitor is disconnected. > > I agree, in theory. However, in practice this doesn't always happen. The question is, are we trying to work around bugs in xorg or intel driver here?
If you think Xorg or the driver should be ensuring that the logical screen size remains consistent with the connected monitors, then I'm willing to report a bug to the relevant component (but I wouldn't know which). On the other hand, I don't see any problem with coding XFCE a little more carefully so that it doesn't break in this (admittedly abnormal) scenario. Theoretical questions of what "ought" to happen aside, do you think it's realistic that Xorg will fix a long-standing issue like this (around since at least 2009, according to bug #5795) in a reasonable timeframe?
(In reply to John Lindgren from comment #9) > On the other hand, I don't see any problem with coding XFCE a little more > carefully so that it doesn't break in this (admittedly abnormal) scenario. That came out wrong; I didn't mean to imply that the current code was carelessly coded. On the whole I'm very impressed with the code. It's just this unusual case where it happens to break.
No worries, I didn't take it in a wrong way. My main (and only) concern here is do make the right choice, if there is a bug in xfce it should be fixed here obviously, but if the bug is elsewhere it should be fixed elsewhere (and not as a workaround here). What about the opposite operation, what if you don't have the VGA monitor plugged, then you plug it in, what gives "xrandr -query" in this case for the overall screen size vs. each monitor size/position? Is there still any discrepancy?
(In reply to Olivier Fourdan from comment #11) > What about the opposite operation, what if you don't have the VGA monitor > plugged, then you plug it in, what gives "xrandr -query" in this case for > the overall screen size vs. each monitor size/position? Is there still any > discrepancy? I will get you the exact xrandr output once I get home tonight, but I believe the VGA monitor remains in standby (no picture) after plugging it in, and the logical screen size remains the same (so it only encompasses the laptop panel). Then I have to run "xrandr --output VGA1 --auto" to turn the monitor on, which also updates the logical screen size.
Before plugging in VGA cable: Screen 0: minimum 8 x 8, current 1366 x 768, maximum 32767 x 32767 LVDS1 connected 1366x768+0+0 VGA1 disconnected After plugging in VGA cable: Screen 0: minimum 8 x 8, current 1366 x 768, maximum 32767 x 32767 LVDS1 connected 1366x768+0+0 VGA1 connected After "xrandr --output VGA1 --auto --right-of LVDS1": Screen 0: minimum 8 x 8, current 2646 x 1024, maximum 32767 x 32767 LVDS1 connected 1366x768+0+0 VGA1 connected 1280x1024+1366+0
I suspect this patch is incomplete, I trust it fixes the panel positioning but the struts are still computed based on the (wrong, in this case) X11 screen size, thus causing bug 11059.
(In reply to Olivier Fourdan from comment #14) > I suspect this patch is incomplete, I trust it fixes the panel positioning > but the struts are still computed based on the (wrong, in this case) X11 > screen size, thus causing bug 11059. That is exactly what the patch does, and it was intentional on my part. The struts are supposed to be based on the X11 screen size, whether it matches the monitor size or not. As I said before, if you think it is wrong for the X11 screen size to be larger than the one connected monitor, I am happy to report a bug to Xorg. But I do not see the problem with making xfce4-panel (and xfwm4) handle that case correctly.
xfwm4 part has been pushed now, means that the stuts may be wrong when unplugging an output until this patch is merged.
Pushed to git, thanks.