Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion doc/xdo.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ Actions
*resize*::
Resize the window.

*reparent*::
Reparent the window into the target (see *-t*).

*activate*::
Activate the window.

Expand Down Expand Up @@ -111,7 +114,7 @@ When options are provided, the action applies to all the children of the root wi
The window has the given wm name.

*-t* 'WID'::
The target window for the *below* and *above* actions.
The target window for the *below*, *above* and *reparent* actions.

*-p* 'PID'::
The window has the given pid.
Expand Down
9 changes: 9 additions & 0 deletions xdo.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ int main(int argc, char *argv[])
action = window_move;
} else if (strcmp(argv[1], "resize") == 0) {
action = window_resize;
} else if (strcmp(argv[1], "reparent") == 0) {
action = window_reparent;
} else if (strcmp(argv[1], "close") == 0) {
action = window_close;
} else if (strcmp(argv[1], "kill") == 0) {
Expand Down Expand Up @@ -452,6 +454,13 @@ void window_resize(xcb_window_t win)

#undef SETGEOM

void window_reparent(xcb_window_t win)
{
if (cfg.target == 0)
err("reparent requires target (-t) argument\n");
xcb_reparent_window(dpy, win, cfg.target, 0, 0);
}

void window_activate(xcb_window_t win)
{
xcb_ewmh_request_change_active_window(ewmh, default_screen, win, XCB_EWMH_CLIENT_SOURCE_TYPE_OTHER, XCB_CURRENT_TIME, XCB_NONE);
Expand Down
1 change: 1 addition & 0 deletions xdo.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ void window_above(xcb_window_t win);
void window_below(xcb_window_t win);
void window_move(xcb_window_t win);
void window_resize(xcb_window_t win);
void window_reparent(xcb_window_t win);
void window_activate(xcb_window_t win);
void window_id(xcb_window_t win);
void window_pid(xcb_window_t win);
Expand Down