Removing secondary display does not resize workspace.

Bug #1241895 reported by Redoubts on 2013-10-19
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Xfce panel
Fix Released
Medium
xfce4-panel (Ubuntu)
Undecided
Unassigned
xfce4-settings (Ubuntu)
Undecided
Unassigned

Bug Description

I'm trying to use my laptop with a second monitor on occasion. Plugging it in, and using xfce4-display-settings to extend the workspace functions as desired. However, simply removing the monitor does two bad things:

1) The workspace does not resize automatically, and I am unable to use xfce-display-settings to drop the former additional monitor, or remove the now invisible screen real estate.
2) my xfce panel suddenly goes wide, and now half of it is invisible. It has likely extended itself into the phantom workspace. Note that when the second monitor was connected, the panel was bound to only one screen, as desired. it is only the disconnection that expands the panel.

Using Lenovo X1 Carbon.

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: xfwm4 4.10.1-2ubuntu1
ProcVersionSignature: Ubuntu 3.11.0-12.19-generic 3.11.3
Uname: Linux 3.11.0-12-generic x86_64
ApportVersion: 2.12.5-0ubuntu2
Architecture: amd64
Date: Fri Oct 18 18:06:19 2013
InstallationDate: Installed on 2013-10-18 (0 days ago)
InstallationMedia: Xubuntu 13.10 "Saucy Salamander" - Release amd64 (20131016)
MarkForUpload: True
SourcePackage: xfwm4
UpgradeStatus: No upgrade log present (probably fresh install)

Workspace switcher doesn't recognize screen changes done by xrandr.

Steps to reproduce:

1) Start with a single-monitor configuration. For this example, I use the external screen VGA-0 attached to the laptop, while the laptop's LVDS is turned off.

2) `xrandr --output LVDS --auto --below VGA-0' makes the desktop extend to the laptop's LVDS, putting it below the external screen while the panels stay where they are.

Expected results:
Workspace switcher resembles the new screen size in its miniature view.

Actual results:
Workspace switcher still resembles the old screen size in its miniature view and seems not to know about the new screen configuration.

Workaround:
`xfce4-panel -r'

Note that adding or removing a workspace seems to make the pager notice the layout change.

In , 8-nick (8-nick) wrote :

*** Bug 7849 has been marked as a duplicate of this bug. ***

I seem to suffer from this bug, except in a different way - and the workaround doesn't work for me. I started using XFCE a few weeks ago and initially I had a single-monitor setup and everything was fine. Then, through xrandr (using the arandr GUI tool), I expanded my desktop to cover the second monitor that I have hooked up, everything was still fine and the workspace switcher reflected that change.

However when I now run an xrandr command to switch back to single-monitor, the workspace switcher doesn't update and keeps taking up space as though I have a dual-monitor setup. Running 'xfce4-panel -r', removing and re-adding the workspace switcher applet, restarting my XFCE session, or using the display settings application to fiddle with things (toggling my 2nd monitor to see if it would case everything to go back to normal) doesn't seem to help either. I've gone over all the settings under the settings editor to see if anything was left behind there but couldn't find anything wrong there either.

So now I'm wondering; is what I'm having the same as this bug, but manifesting in a different way, or should I file a separate bug report for this?

I forgot to mention; adding or removing a workspace doesn't seem to help either, the workspace switcher does update to reflect the new number of workspaces, but each individual workspace is still too wide as though I have two monitors active.

Created attachment 4894
display the X11 root window property _NET_DESKTOP_GEOMETRY

TL;DR: The pager itself is (presumably) fine. Xfwm needs to be fixed to update the _NET_DESKTOP_GEOMETRY property.

Long story:
I have the same problem as Hans Nieser. I might have located the source of this bug. The Xfce pager uses libwnck, which uses the _NET_DESKTOP_GEOMETRY property to determine the full desktop size. However, it seems that Xfwm does not update the _NET_DESKTOP_GEOMETRY property
http://standards.freedesktop.org/wm-spec/1.5/ar01s03.html
According to the page above, this property should be set by the window manager.

I verified that Xfwm indeed does not modify this property using the attached C file, which can be compiled via
    gcc test.c -lX11 -o test

Steps:
1. Log in and enter xfce desktop.
2. Compile test.c and run ./test to verify that the desktop geometry is correct.
3. Change the screen configuration via xrandr by adding/removing a monitor, or change the virtual desktop size via "xrandr --fb widthxheight" (as along as the new size is big enough to hold the existing screen configuration).
4. Run ./test again and observe that the desktop geometry stays unchanged.

(In reply to comment #5)
> Created attachment 4894 [details]
> display the X11 root window property _NET_DESKTOP_GEOMETRY
>
> TL;DR: The pager itself is (presumably) fine. Xfwm needs to be fixed to
> update the _NET_DESKTOP_GEOMETRY property.
>

Thank you for that insight - I finally got enough of this bug so I spent today trying to come up with a patch that I have attached to bug 9922. This fixes the issue that _NET_DESKTOP_GEOMETRY doesn't update, and makes the pager widget relayout correctly.

One minor remaining issue (that I assume has nothing to do with xfwm4) is that I do need to click the pager widget once, or change workspace (or anything that forces it to update itself) to make it relayout correctly immediately after login, but that beats having to restart xfwm4 every time (`xfce-panel -r` never worked for me, btw, not sure why that worked for OP)

(In reply to comment #6)
> One minor remaining issue (that I assume has nothing to do with xfwm4) is
> that I do need to click the pager widget once, or change workspace (or
> anything that forces it to update itself) to make it relayout correctly
> immediately after login, but that beats having to restart xfwm4 every time
> (`xfce-panel -r` never worked for me, btw, not sure why that worked for OP)

It was always the case, see comment #1.

Redoubts (redoubts) wrote :

And by "simply removing the monitor" I mean unplugging it, without toggling the software first.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xfwm4 (Ubuntu):
status: New → Confirmed

I think that I am also suffering from this bug, so I would love to see Hans Nieser's patch in some official release. As far as I can tell, it seems not to be included. Would it be possible to push this somehow?

Changed in xfwm4:
importance: Unknown → Medium
status: Unknown → Confirmed
affects: xfwm4 → xfce4-panel
affects: xfwm4 (Ubuntu) → xfce4-settings (Ubuntu)
Changed in xfce4-panel (Ubuntu):
status: New → Confirmed

Created attachment 5786
patch to update _NET_DESKTOP_GEOMETRY from monitor/resize events as well (by Hans Nieser)

Moved the patch from bug #9922 over to this one, as the latter is actually a duplicate.

*** Bug 9922 has been marked as a duplicate of this bug. ***

Created attachment 5851
properly formatted patch

Pushed, thanks!

Changed in xfce4-panel:
status: Confirmed → Fix Released

Downstream bug (Fedora 21 and EPEL7 with Xfce 4.10):
https://bugzilla.redhat.com/show_bug.cgi?id=1093998

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.