GNOME Bugzilla – Bug 671054
Add a keyboard shortcut to move window from one monitor to another
Last modified: 2014-04-16 17:52:35 UTC
I have a dual screen setup and I need two (important) keyboard shortcuts to use them efficiently, because otherwise I have to use the mouse: 1. Tiling a window to the left/right of a screen (I think this will be included in 3.4). 2. Sending a window to another screen and vice-versa. Here are some ideas from the top of my head, since my screens are not equal (in size): 1. If a window is maximized/minimized/shaded/etc... on the src screen, it should be maximized/minimized/shaded/etc... on the dst screen. 2. If a window is tiled left/right on the src screen, it should tiled left/right on the dst screen. 3. Otherwise, position the window on the dst screen according to the x/y percentage of the src screen, and DO NOT resize the window. 4. Only resize the window after moving if it gets out of screen borders? (In case of being moved from a large screen to a smaller one). I am not familiar with the Mutter (or any other window manager) codebase at all, but I wouldn't mind hacking on this feature if it's simple enough.
I assume you mean "monitors" (or displays in X terms) rather than "screen" (which is actually unsupported, see bug 648156). (In reply to comment #0) > 1. Tiling a window to the left/right of a screen (I think this will be included > in 3.4). Yes. > 2. Sending a window to another screen and vice-versa. > > Here are some ideas from the top of my head, since my screens are not equal (in > size): > > 1. If a window is maximized/minimized/shaded/etc... on the src screen, it > should be maximized/minimized/shaded/etc... on the dst screen. > 2. If a window is tiled left/right on the src screen, it should tiled > left/right on the dst screen. > 3. Otherwise, position the window on the dst screen according to the x/y > percentage of the src screen, and DO NOT resize the window. > 4. Only resize the window after moving if it gets out of screen borders? (In > case of being moved from a large screen to a smaller one). > > I am not familiar with the Mutter (or any other window manager) codebase at > all, but I wouldn't mind hacking on this feature if it's simple enough. It is, given that we already have meta_window_move_to_monitor() which should behave more or less like outlined above. So it would be mostly a matter of hooking it up with keybindings - in fact, it should be doable either in mutter core or as a GNOME Shell extension.
The alt-space menu should also be supported to have options to move to another monitor, which is mutter area (I think). So gnome shell extension is out.
I too would like to see this feature implemented. Though this feature request is over a year old, should I submit a new one?
No, duplicate reports don't help but create more work, and this report is still open because it's not been fixed. Contributing patches help though, to get things going. :)
OK, that's what I thought. Some communities (like Canonical) like duplicate requests. I'd love to make a patch, though I've not done a lot of work with Metacity/Mutter, so it'd be a be a whole new world. I'll see if I can get some time to work on it.
Created attachment 264001 [details] [review] keybinding: Implement keybindings for moving windows between monitors Currently the only way to move a window to another monitor via keyboard is to start a move operation and move it manually using arrow keys. We do have all the bits of a dedicated keybinding in place already, so offer it as a more comfortable alternative.
I'd rather see this tied to the tiling keybindings, like Windows 7 does it. If we're on the left-hand monitor and press <Super>Right, it tiles on the left of the right-hand monitor.
I've discussed this briefly with Allan, and this didn't make much sense to either of us (<super>right to tile on the left?). Also, tile-tile-unmaximize is a rather unobvious sequence for moving a non-tiled window ...
(In reply to comment #8) > I've discussed this briefly with Allan, and this didn't make much sense to > either of us (<super>right to tile on the left?). It moves it to the slot to the right of where it currently is... > Also, tile-tile-unmaximize is > a rather unobvious sequence for moving a non-tiled window ... It's fairly natural if you try it out.
Note that Win7 also has <Super><Shift>Left / <Super><Shift>Right to directly move monitors, so this probably makes sense separately.
(In reply to comment #10) > Note that Win7 also has <Super><Shift>Left / <Super><Shift>Right to directly > move monitors, so this probably makes sense separately. Ha - guess what the default shortcuts are for these keybindings :-)
Review of attachment 264001 [details] [review]: OK.
Attachment 264001 [details] pushed as 0fe5c4f - keybinding: Implement keybindings for moving windows between monitors
Hi, I'm getting: (mutter-wayland:17782): GLib-GIO-ERROR **: Settings schema 'org.gnome.desktop.wm.keybindings' does not contain a key named 'move-to-monitor-left' is it problem in my system or in this patch? I don't see the reason why the program should abort on unsupported keybinding...
(In reply to comment #14) > is it problem in my system or in this patch? The patch depends on the gsettings-desktop-schemas patch in bug 720278, so you need to make sure to update that module as well.
Yes, it solved the problem Thanks
*** Bug 691549 has been marked as a duplicate of this bug. ***
*** Bug 690064 has been marked as a duplicate of this bug. ***