mirror of
https://github.com/amiwm/amiwm.git
synced 2026-03-24 01:24:15 +00:00
[amiwm] Implement a keyboard shortcut to move a client to a different screen
This allows a keyboard shortcut to move a client to a different amiwm screen. That way when you have things like Firefox restart every window in a single screen, you can quickly move screens to where they should be.
This commit is contained in:
15
module.c
15
module.c
@@ -45,6 +45,7 @@ extern void remove_fd_from_set(int);
|
||||
extern void screentoback();
|
||||
extern void raiselowerclient(Client *, int);
|
||||
extern void wberror(Scrn *, char *);
|
||||
extern void reparent(Client *);
|
||||
|
||||
extern Icon *createappicon(struct module *, Window, char *,
|
||||
Pixmap, Pixmap, Pixmap, int, int);
|
||||
@@ -525,6 +526,20 @@ static void handle_module_cmd(struct module *m, char *data, int data_len)
|
||||
reply_module(m, NULL, 0);
|
||||
break;
|
||||
}
|
||||
case MCMD_WINDOW_MOVE_NEXT_DESKTOP:
|
||||
/* Move the current window, if any, to the next desktop */
|
||||
c = NULL;
|
||||
if(! XFindContext(dpy, id, client_context, (XPointer*)&c)) {
|
||||
/* Get the current screen */
|
||||
scr=getscreen(id);
|
||||
/* Rotate screen, get the now front screen */
|
||||
screentoback();
|
||||
scr = get_front_scr();
|
||||
/* Assign this client to next screen */
|
||||
reparent_client(scr, c);
|
||||
}
|
||||
reply_module(m, NULL, 0);
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
reply_module(m, NULL, -1);
|
||||
|
||||
Reference in New Issue
Block a user