Dual head overview behaviour



Hi everybody,

First some introduction. I am using Gnome Shell in a dual head setup
composed by two 22 inches wide monitors. I have unchecked the
"workspaces_only_on_primary_monitor" (or whatever its name) key so that
I can use different workspaces also on my second monitor, since I have
multiple tasks that I want to keep in different workspaces and each of
these tasks benefits from the dual head setup.

What still bugs me is that when activating the overview, windows from
all workspaces are shown on the second monitor. I would rather see only
windows pertaining to the current workspace, to aid my work-flow
perception that each workspace is a different task. I did dig into the
Shell's code and found out that the function that decides which windows
are shown in the overview is:

workspace.js:
    _isMyWindow : function (win) {
        return (this.metaWorkspace == null ||
Main.isWindowActorDisplayedOnWorkspace(win, this.metaWorkspace.index()))
&&
            (!win.get_meta_window() ||
win.get_meta_window().get_monitor() == this.monitorIndex);
    },


If I am correct this checks whether the window is shown on the current
monitor and for the primary monitor if the window is in the current
workspace. Conversely, the check NULL part is for other monitors and
where the index check is skipped, since the metaWorkspace is defined as
NULL, as seen in:

workspacesView.js-
       for (let i = 0; i < monitors.length; i++) {
            if (i == Main.layoutManager.primaryIndex)
                continue;
            let ws = new Workspace.Workspace(null, i);
            this._extraWorkspaces[m++] = ws;
            ws.setGeometry(monitors[i].x, monitors[i].y,
monitors[i].width, monitors[i].height);
            global.overlay_group.add_actor(ws.actor);
        }

Finally, here are my questions:

1) How can I change the behaviour of _isMyWindow to show only windows of
the current workspace also on the second monitor? I tried something
like:

workspace.js:
    _isMyWindow : function (win) {
        if (this.metaWorkspace != null)
            return (Main.isWindowActorDisplayedOnWorkspace(win,
this.metaWorkspace.index())) &&
                (!win.get_meta_window() ||
win.get_meta_window().get_monitor() == this.monitorIndex);
        else
            return (win.get_workspace().index() ==
global.get_active_workspace_index()) &&
                (!win.get_meta_window() ||
win.get_meta_window().get_monitor() == this.monitorIndex);
    },

This works when I enter the overview, but if I click on the workspace
selector and I change workspace, windows on the second monitor are not
updated (that is, if I go into the overview and I am on workspace 3 only
windows from that workspace are show, but then if I click on the
workspace selector and switch to workspace 1 on the second monitor the
overview still shows windows from workspace 3). I though about changing
the workspaces on other monitors to something that is not null, so that
I can get their index with metaWorkspace.index(), but that seems far
different from what is currently done. Any other suggestions?

2) Would you, devs of Gnome Shell (if you are reading this), be
interested in changing the behaviour (read, should I send a patch) or
would you better like this to sit in an extension?

Many thanks and sorry for the long post,
Alessandro

PS: Alexander, I CCed you since you submitted patches for the dual head
setup. Sorry for the spam if you didn't want to received this email



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]