[Bug 715587] Re: [workspace switcher] Inconsistency between workspace layout in graphical switcher and that seen when using keyboard shortcuts
** Changed in: unity-2d Assignee: (unassigned) = Florian Boucault (fboucault) ** Changed in: unity-2d Status: Fix Committed = Fix Released ** Changed in: unity-2d (Ubuntu) Status: Confirmed = Fix Released -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/715587 Title: [workspace switcher] Inconsistency between workspace layout in graphical switcher and that seen when using keyboard shortcuts To manage notifications about this bug go to: https://bugs.launchpad.net/unity-2d/+bug/715587/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 715587] Re: [workspace switcher] Inconsistency between workspace layout in graphical switcher and that seen when using keyboard shortcuts
** Changed in: unity-2d Status: Confirmed = Fix Committed -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/715587 Title: [workspace switcher] Inconsistency between workspace layout in graphical switcher and that seen when using keyboard shortcuts To manage notifications about this bug go to: https://bugs.launchpad.net/unity-2d/+bug/715587/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 715587] Re: [workspace switcher] Inconsistency between workspace layout in graphical switcher and that seen when using keyboard shortcuts
Thanks a lot for that patch Jouni. Some functional testing shows that it works pretty reliably, thank you. Let's dig deep in the code side of things. foreword: below _NET_NUMBER_OF_DESKTOPS and _NET_DESKTOP_LAYOUT refer to the root window's X properties WorkspacesInfo::updateWorkspaceGeometry() has 3 functions: - deciding on the number of workspaces (_NET_NUMBER_OF_DESKTOPS) if not done so by an external program (e.g. metacity) - deciding on the layout of the workspaces (_NET_DESKTOP_LAYOUT) if not done so by an external program (often called pager) (e.g. gnome-panel) - maintaining WorskpacesInfo's properties 'count', 'rows', 'columns', 'orientation' and 'startingCorner' up to date and in sync with _NET_NUMBER_OF_DESKTOPS and _NET_DESKTOP_LAYOUT As it is in trunk the code has the following issues: - if _NET_NUMBER_OF_DESKTOPS is not set and WorkspacesInfo::updateWorkspaceGeometry decides to default to 4, the property _NET_NUMBER_OF_DESKTOPS should be set to 4 as well - sanity checks performed when _NET_DESKTOP_LAYOUT is set but incomplete should be: 1) applied in all cases, even when _NET_DESKTOP_LAYOUT is not set 2) the case rows == 0 columns == 0 should be smarter than just setting the number of rows to 2 and instead compute a number of rows and columns that make the layout be as close as possible to a square (as done in the patch) - the function is simply too long to be easily understood. Here is a proposal pseudo-code reorganisation: getWorkspaceCountFromX(workspaceCount) getWorkspacesLayoutFromX(orientation, columns, rows, startingCorner) if workspaceCount not set: workspaceCount = 4 setWorkspaceCountToX(workspaceCount) if orientation not set: orientation = horizontal XLayoutNeedsUpdate = true if columns and rows not set: columns, rows = values to make up a square XLayoutNeedsUpdate = true else if columns not set: columns = ceil(workspaceCount / rows) XLayoutNeedsUpdate = true else if rows not set: rows = ceil(workspaceCount / columns) XLayoutNeedsUpdate = true if startingCorner not set: startingCorner = topLeft XLayoutNeedsUpdate = true if XLayoutNeedsUpdate: setWorkspacesLayoutToX(orientation, columns, rows, startingCorner) updateLocalProperties(workspaceCount, orientation, columns, rows, startingCorner) The patch you propose has the following shortcomings of its own: - the best approximation for number of rows and cols is improving on what was done before (just setting the number of rows to 2) but yet duplicating the logic making the code harder to follow - 'updateX' is set to true when the member variable differs from the local variable (e.g. m_rows != rows); that covers a more cases than it should and we end up resetting _NET_DESKTOP_LAYOUT more than necessary. For example: the very first time WorkspacesInfo::updateWorkspaceGeometry is called by the constructor _NET_DESKTOP_LAYOUT is going to be set even though it might already contain all the right values. _NET_DESKTOP_LAYOUT should only be set when it does not contain one of the values needed to know the layout entirely (e.g. columns is not set). Currently we end up not respecting the layout that an external pager may have set. - updating local members (m_columns, m_rows, etc.) and emitting changed signals should be done at the very last moment in order to avoid the function being re-entered. Concretely, setX11IntProperty(_NET_DESKTOP_LAYOUT, (unsigned char*)newvalues, 4) should be done before. - tiny niggles * 'updateX' could be slightly more explicit. 'XLayoutNeedsUpdate' is one possibility. * 'newvalues' could be more explicit. For example 'newLayout' or even just 'layout' if we reuse it to also fetch the current _NET_DESKTOP_LAYOUT -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/715587 Title: [workspace switcher] Inconsistency between workspace layout in graphical switcher and that seen when using keyboard shortcuts To manage notifications about this bug go to: https://bugs.launchpad.net/unity-2d/+bug/715587/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 715587] Re: [workspace switcher] Inconsistency between workspace layout in graphical switcher and that seen when using keyboard shortcuts
I implemented that vision in https://code.launchpad.net/~fboucault /unity-2d/workspaces_sync_spread_with_wm/+merge/81891 Let me know what you guys think. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/715587 Title: [workspace switcher] Inconsistency between workspace layout in graphical switcher and that seen when using keyboard shortcuts To manage notifications about this bug go to: https://bugs.launchpad.net/unity-2d/+bug/715587/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 715587] Re: [workspace switcher] Inconsistency between workspace layout in graphical switcher and that seen when using keyboard shortcuts
** Branch linked: lp:~fboucault/unity-2d/workspaces_sync_spread_with_wm -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/715587 Title: [workspace switcher] Inconsistency between workspace layout in graphical switcher and that seen when using keyboard shortcuts To manage notifications about this bug go to: https://bugs.launchpad.net/unity-2d/+bug/715587/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 715587] Re: [workspace switcher] Inconsistency between workspace layout in graphical switcher and that seen when using keyboard shortcuts
Attached a little patch against unity-2d which updates _NET_DESKTOP_LAYOUT atom back to the root window as proposed. It seems to fix this issue on my installation. However this patch won't still fix a problem when changing gconf key /apps/metacity/general/num_workspace to another value. Changing that value does not automatically update layout right away on Unity but needs a restart (for example logout - login). ** Patch added: unity-2d-workspaces-update.patch https://bugs.launchpad.net/unity-2d/+bug/715587/+attachment/2583915/+files/unity-2d-workspaces-update.patch -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/715587 Title: [workspace switcher] Inconsistency between workspace layout in graphical switcher and that seen when using keyboard shortcuts To manage notifications about this bug go to: https://bugs.launchpad.net/unity-2d/+bug/715587/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 715587] Re: [workspace switcher] Inconsistency between workspace layout in graphical switcher and that seen when using keyboard shortcuts
The attachment unity-2d-workspaces-update.patch of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-sponsors please also unsubscribe the team from this bug report. [This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.] ** Tags added: patch -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/715587 Title: [workspace switcher] Inconsistency between workspace layout in graphical switcher and that seen when using keyboard shortcuts To manage notifications about this bug go to: https://bugs.launchpad.net/unity-2d/+bug/715587/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 715587] Re: [workspace switcher] Inconsistency between workspace layout in graphical switcher and that seen when using keyboard shortcuts
Please see revised patch which keeps number of workspaces in sync. It makes assumptions about row and columns on Unity side by the number of workspaces. Now one can change the gconf value at /apps/metacity/general/num_workspace and Unity-2d should update its contents and contents of the switcher accordingly. ** Patch added: unity-2d-workspaces-update2.patch https://bugs.launchpad.net/unity-2d/+bug/715587/+attachment/2584194/+files/unity-2d-workspaces-update2.patch -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/715587 Title: [workspace switcher] Inconsistency between workspace layout in graphical switcher and that seen when using keyboard shortcuts To manage notifications about this bug go to: https://bugs.launchpad.net/unity-2d/+bug/715587/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 715587] Re: [workspace switcher] Inconsistency between workspace layout in graphical switcher and that seen when using keyboard shortcuts
I just tested gnome-shell and returned to unity2d, I found just 2 workspaces. Thanks for mentioning /apps/metacity/general/num_workspaces in gconf here. It fixed my problem. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/715587 Title: [workspace switcher] Inconsistency between workspace layout in graphical switcher and that seen when using keyboard shortcuts To manage notifications about this bug go to: https://bugs.launchpad.net/unity-2d/+bug/715587/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 715587] Re: [workspace switcher] Inconsistency between workspace layout in graphical switcher and that seen when using keyboard shortcuts
From the duplicate: @Olivier Tilloy (osomon) wrote on 2011-05-06: Note that configuring the workspaces layout involves two separate mechanisms: - the total number of workspaces, set by metacity and stored in the GConf key /apps/metacity/general/num_workspaces - the layout of the desktop, set using the _NET_DESKTOP_LAYOUT atom on the root window (see http://standards.freedesktop.org/wm-spec/wm-spec- latest.html#id2550891) -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/715587 Title: [workspace switcher] Inconsistency between workspace layout in graphical switcher and that seen when using keyboard shortcuts To manage notifications about this bug go to: https://bugs.launchpad.net/unity-2d/+bug/715587/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 715587] Re: [workspace switcher] Inconsistency between workspace layout in graphical switcher and that seen when using keyboard shortcuts
I think unity-2d should set the _NET_DESKTOP_LAYOUT atom on the root window when metacity is running to ensure the layout is as it claims. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/715587 Title: [workspace switcher] Inconsistency between workspace layout in graphical switcher and that seen when using keyboard shortcuts To manage notifications about this bug go to: https://bugs.launchpad.net/unity-2d/+bug/715587/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 715587] Re: [workspace switcher] Inconsistency between workspace layout in graphical switcher and that seen when using keyboard shortcuts
Attached is a python script that will fix Metacity's layout of the workspaces. This is a practical hack. You can add this to Startup Application if you always run unity-2d with Metacity window manager. I am running it as needed since I use Unity most of the time. This hack illustrates what unity-2d must do to cooperate with Metacity. ** Attachment added: sync metacity workspaces to unity layout https://bugs.launchpad.net/unity-2d/+bug/715587/+attachment/2489159/+files/sync-workspaces.py -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/715587 Title: [workspace switcher] Inconsistency between workspace layout in graphical switcher and that seen when using keyboard shortcuts To manage notifications about this bug go to: https://bugs.launchpad.net/unity-2d/+bug/715587/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs