Review of "Return to Monitor" version 1

Details Page Preview

Gnome-Shell extension to return windows to the right monitor whenever you plug a monitor back in. Currently, it's only well tested with 2 monitors, static workspaces, and "Workspaces only on primary display" turned off, so depending on your setup YMMV. There is also a patch in the works to fix this functionality at https://bugzilla.gnome.org/show_bug.cgi?id=731760 For bug reports, feature requests, contact, etc please go to: https://github.com/aiguofer/return-to-monitor


No comments.

FAQ

Files

Note: Binary files aren't shown on the web site. To see all files, please download the extension zipfile.

All Versions

Version Status
1 Active

Previous Reviews on this Version

fmuellner active
There is the expectation of extensions not running any code when disabled, though doing some simple bookkeeping as updating the _windows array is obviously a gray area. Still, have you consider monkey-patching the windows directly instead of using a set of global variables? Something along the lines of: function saveWindow(window) { window._savedMonitor = window.get_monitor(); } function returnWindows() { let windows = global.get_window_actors().map(function(w) { return w.meta_window; }); for (let i = 0; i < windows.length; i++) { if (windows[i]._savedMonitor != undefined) windows[i].move_to_monitor(windows[i]._savedMonitor); } } This would allow you to get rid of the _windows, _windowSignals and _firstLoad globals. Also, the MetaScreen::window-left-monitor signal has a window parameter similar to MetaDisplay::window-created, so handleMovedWindow() could just be: function handleMovedWindow(screen, oldMonitor, window) { saveWindow(window); } (and to end with a complete nitpick comment: could use global.display instead of global.screen.get_display() :-) ) However none of the above is a reason for rejecting the extension (though not leaving active MetaWindow::unmanaged handlers when disabled would be much appreciated) ...