Skip to content

Commit

Permalink
fix multi-monitor bugs on using menu/distribute/fill-space
Browse files Browse the repository at this point in the history
Previously considered windows from the current workspace.
So when there was 2 windows in Crote#1 monitor and 4 windows in the timbertson#2 monitor, it arranged a 6 places grid for the Crote#1 monitor. When a distribute command was used it arranged following this grid but the windows remained in respective monitor, 2 in Crote#1 and 4 in timbertson#2.

Now consider windows from the monitor of the current window only.
So the windows from the other monitor in the current workarea are not affected and the grid are calculated correctly.
In the example given, it will calculated a 2 places grid for the Crote#1 monitor.
Teste dwith 2 1920x1280 monitors in ubuntu disco.
  • Loading branch information
juarezr committed Aug 1, 2019
1 parent bc74632 commit 1382837
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/gnome_shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,12 @@ module GnomeSystem {
];

function listWindows(win?: MetaWindow): Array<MetaWindow> {
// XXX is this multi-monitor compatible?
const display = (win == null) ? global.display : win.get_display();
const screenNo = display.get_current_monitor();
return display.get_workspace_manager().get_active_workspace().list_windows().filter(function(w: MetaWindow) {
const screenNo = (win == null) ? display.get_current_monitor() : win.get_monitor();
let windows = display.get_workspace_manager().get_active_workspace().list_windows();
return windows.filter(function(w: MetaWindow) {
return (
w.get_display().get_current_monitor() == screenNo
w.get_monitor() == screenNo
&& VISIBLE_WINDOW_TYPES.indexOf(w.get_window_type()) !== -1
);
});
Expand Down

0 comments on commit 1382837

Please sign in to comment.