LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux Mint
User Name
Password
Linux Mint This forum is for the discussion of Linux Mint.

Notices


Reply
  Search this Thread
Old 10-27-2018, 06:50 AM   #1
cantab
Member
 
Registered: Oct 2009
Location: England
Distribution: Kubuntu, Ubuntu, Debian, Proxmox.
Posts: 553

Rep: Reputation: 115Reputation: 115
Cinnamon, one panel per monitor, can I make the window list show windows on all monitors?


Easiest to explain with a picture.

https://imgur.com/OWgnDLb

The window list on the left (primary) monitor shows only Firefox while the window list on the right monitor shows only Calculator. That's not what I want - I want both window lists to show all the windows.

Can I make Cinnamon do this, or should I just use a different desktop? XFCE on my Debian install does what I want.
 
Old 10-27-2018, 06:25 PM   #2
cantab
Member
 
Registered: Oct 2009
Location: England
Distribution: Kubuntu, Ubuntu, Debian, Proxmox.
Posts: 553

Original Poster
Rep: Reputation: 115Reputation: 115
Update. Googling lead me to read the code, line 1195 and on looks like the relevant piece and it appears the window list behaviour can't be changed.

https://github.com/linuxmint/Cinnamo....org/applet.js

(Also looks like it might not be that hard to patch if I really wanted to use Cinnamon, but I'm not a developer and for me that'd be more trouble than it's worth.)
 
Old 12-20-2021, 08:28 AM   #3
BaconCatBug
LQ Newbie
 
Registered: Dec 2021
Posts: 1

Rep: Reputation: Disabled
I am truly sorry for the 4 year necro, but I had this same issue, and this was one of the top results on The Googles so hopefully anyone reading this will be able to make use of it.

Upfront, this is a quick and dirty hack, will probably be reverted if the applet ever updates, has no guarentees, etc.

1) Open a folder.
2) Right Click > Open as Root. All steps up to step 9 are done as Root via this now root folder.
3) Go to the folder "/usr/share/cinnamon/applets/window-list@cinnamon.org"
4) Make a backup of "applet.js"
5) Open applet.js
6) Find the function "_updateWatchedMonitors()"
7) At the time of writing, near the start of this function there should be an if statement stating "else if (instances.length > 1 && !on_primary)"
8) Replace the line of code in this if branch to the code found in the catchall else branch immediately after it.

In my case, that meant replacing
Quote:
this._monitorWatchList = [this.panel.monitorIndex];
with
Quote:
this._monitorWatchList = [this.panel.monitorIndex];

instances = instances.map(function(x) {
return x.panel.monitorIndex;
});

for (let i = 0; i < n_mons; i++)
this._monitorWatchList.push(i);
9) Save the changes to "applet.js"
10) Press Alt+F2 to bring up the Cinnamon control dialog. Type r and then press Enter to restart Cinnamon.
11) Windows from all monitors should now be displayed in Window Lists across all monitors.

Last edited by BaconCatBug; 12-20-2021 at 12:04 PM.
 
Old 04-15-2023, 05:01 AM   #4
aschiffo
LQ Newbie
 
Registered: Apr 2023
Posts: 1

Rep: Reputation: 0
Thanks, that worked!

Quote:
Originally Posted by BaconCatBug View Post
I am truly sorry for the 4 year necro, but I had this same issue, and this was one of the top results on The Googles so hopefully anyone reading this will be able to make use of it.

Upfront, this is a quick and dirty hack, will probably be reverted if the applet ever updates, has no guarentees, etc.

1) Open a folder.
2) Right Click > Open as Root. All steps up to step 9 are done as Root via this now root folder.
3) Go to the folder "/usr/share/cinnamon/applets/window-list@cinnamon.org"
4) Make a backup of "applet.js"
5) Open applet.js
6) Find the function "_updateWatchedMonitors()"
7) At the time of writing, near the start of this function there should be an if statement stating "else if (instances.length > 1 && !on_primary)"
8) Replace the line of code in this if branch to the code found in the catchall else branch immediately after it.

In my case, that meant replacing with

9) Save the changes to "applet.js"
10) Press Alt+F2 to bring up the Cinnamon control dialog. Type r and then press Enter to restart Cinnamon.
11) Windows from all monitors should now be displayed in Window Lists across all monitors.
 
Old 06-07-2023, 04:42 PM   #5
ShesBaldJerry
LQ Newbie
 
Registered: Jun 2023
Posts: 1

Rep: Reputation: 0
Alternate Fix

I don't know how universal this is across cinnamon but the applet Window list accomplishes this functionality. It will display windows from both monitors and can even display windows from all desktops. No need to edit the applet.js file but it doesn't allow grouped window lists so if you want to hover over an icon then edit applet.js.

For me I use a grouped window list in the bottom left and a Window List in the middle.

Hope this helps somebody!

Last edited by ShesBaldJerry; 06-07-2023 at 04:56 PM.
 
Old 06-16-2023, 09:40 AM   #6
WACOMalt
LQ Newbie
 
Registered: Jun 2023
Posts: 1

Rep: Reputation: 0
Quote:
Originally Posted by BaconCatBug View Post
I am truly sorry for the 4 year necro, but I had this same issue, and this was one of the top results on The Googles so hopefully anyone reading this will be able to make use of it.

Upfront, this is a quick and dirty hack, will probably be reverted if the applet ever updates, has no guarentees, etc.

1) Open a folder.
2) Right Click > Open as Root. All steps up to step 9 are done as Root via this now root folder.
3) Go to the folder "/usr/share/cinnamon/applets/window-list@cinnamon.org"
4) Make a backup of "applet.js"
5) Open applet.js
6) Find the function "_updateWatchedMonitors()"
7) At the time of writing, near the start of this function there should be an if statement stating "else if (instances.length > 1 && !on_primary)"
8) Replace the line of code in this if branch to the code found in the catchall else branch immediately after it.

In my case, that meant replacing with

9) Save the changes to "applet.js"
10) Press Alt+F2 to bring up the Cinnamon control dialog. Type r and then press Enter to restart Cinnamon.
11) Windows from all monitors should now be displayed in Window Lists across all monitors.
I'm not sure if I was just reading the instructions wrong or what to but I wanted to reply with the exact changes that worked for me.

in applet.js on Cinnamon 5.6.8 here is the full edited "_updateWatchedMonitors() {" block. (line 1273-1368 for me)

Code:
_updateWatchedMonitors() {
        // this can be called after our settings are finalized (and those attributes deleted),
        // so lastWindowOrder won't exist anymore. This can happen when panels are removed, for
        // example due to monitor changes.
        if (this.lastWindowOrder === undefined) {
            return;
        }

        let n_mons = global.display.get_n_monitors();
        let on_primary = this.panel.monitorIndex == Main.layoutManager.primaryIndex;
        let instances = Main.AppletManager.getRunningInstancesForUuid(this._uuid);

        /* Simple cases */
        if (n_mons == 1) {
            this._monitorWatchList = [Main.layoutManager.primaryIndex];
        } else if (instances.length > 1 && !on_primary) {
            this._monitorWatchList = [this.panel.monitorIndex];

            instances = instances.map(function(x) {
            return x.panel.monitorIndex;
            });

            for (let i = 0; i < n_mons; i++)
            this._monitorWatchList.push(i); 
        } else {
            /* This is an instance on the primary monitor - it will be
             * responsible for any monitors not covered individually.  First
             * convert the instances list into a list of the monitor indices,
             * and then add the monitors not present to the monitor watch list
             * */
            this._monitorWatchList = [this.panel.monitorIndex];

            instances = instances.map(function(x) {
            return x.panel.monitorIndex;
            });

            for (let i = 0; i < n_mons; i++)
            this._monitorWatchList.push(i); 
        }

        // Now track the windows in our favorite monitors
        let windows = global.display.list_windows(0);
        if (this.showAllWorkspaces) {
            for (let wks=0; wks<global.workspace_manager.n_workspaces; wks++) {
                let metaWorkspace = global.workspace_manager.get_workspace_by_index(wks);
                let wks_windows = metaWorkspace.list_windows();
                for (let wks_window of wks_windows) {
                    windows.push(wks_window);
                }
            }
        }

        this.refreshing = true;

        for (let window of windows) {
            if (this._shouldAdd(window))
                this._addWindow(window, false);
            else
                this._removeWindow(window);
        }

        this.refreshing = false;

        this._applySavedOrder();
        this._updateAllIconGeometry();
    }
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Configuring window list (panel) applet to function like in Windows (7-10) AAGaming Linux - Software 3 05-30-2017 08:26 AM
gtkmm: show() doesn't show the window when adding windows from other places than main() Hvl Programming 0 06-21-2012 09:54 AM
Gnome Window List in Panel linux-rulz Linux - General 2 06-10-2005 04:50 PM
XFCE - window list on panel, or panel objects on window list? nagromo Linux - Software 3 01-29-2005 09:19 PM
Gnome panel - window list (sorting) dnar Linux - General 0 06-06-2004 10:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux Mint

All times are GMT -5. The time now is 03:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration