After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 671054 - Add a keyboard shortcut to move window from one monitor to another
Add a keyboard shortcut to move window from one monitor to another
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
3.2.x
Other Linux
: Normal enhancement
: ---
Assigned To: mutter-maint
mutter-maint
: 690064 691549 (view as bug list)
Depends on: 720278
Blocks:
 
 
Reported: 2012-02-29 12:29 UTC by Fred Morcos
Modified: 2014-04-16 17:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
keybinding: Implement keybindings for moving windows between monitors (4.71 KB, patch)
2013-12-11 17:48 UTC, Florian Müllner
committed Details | Review

Description Fred Morcos 2012-02-29 12:29:50 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.
Comment 1 Florian Müllner 2012-02-29 12:37:53 UTC
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.
Comment 2 Nguyen Thai Ngoc Duy 2013-01-04 16:04:50 UTC
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.
Comment 3 Tom D 2013-08-22 16:02:47 UTC
I too would like to see this feature implemented.  Though this feature request is over a year old, should I submit a new one?
Comment 4 André Klapper 2013-08-22 16:28:15 UTC
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. :)
Comment 5 Tom D 2013-08-22 16:45:02 UTC
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.
Comment 6 Florian Müllner 2013-12-11 17:48:22 UTC
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.
Comment 7 Jasper St. Pierre (not reading bugmail) 2013-12-11 17:56:10 UTC
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.
Comment 8 Florian Müllner 2013-12-11 17:58:51 UTC
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 ...
Comment 9 Jasper St. Pierre (not reading bugmail) 2013-12-11 18:02:35 UTC
(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.
Comment 10 Jasper St. Pierre (not reading bugmail) 2013-12-11 18:04:04 UTC
Note that Win7 also has <Super><Shift>Left / <Super><Shift>Right to directly move monitors, so this probably makes sense separately.
Comment 11 Florian Müllner 2013-12-11 18:05:14 UTC
(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 :-)
Comment 12 Jasper St. Pierre (not reading bugmail) 2013-12-11 18:08:24 UTC
Review of attachment 264001 [details] [review]:

OK.
Comment 13 Florian Müllner 2013-12-12 08:08:52 UTC
Attachment 264001 [details] pushed as 0fe5c4f - keybinding: Implement keybindings for moving windows between monitors
Comment 14 Marek Chalupa 2013-12-20 13:39:27 UTC
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...
Comment 15 Florian Müllner 2013-12-20 13:50:52 UTC
(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.
Comment 16 Marek Chalupa 2014-01-06 14:29:30 UTC
Yes, it solved the problem

Thanks
Comment 17 Florian Müllner 2014-02-13 21:28:34 UTC
*** Bug 691549 has been marked as a duplicate of this bug. ***
Comment 18 Florian Müllner 2014-04-16 17:52:35 UTC
*** Bug 690064 has been marked as a duplicate of this bug. ***