summaryrefslogtreecommitdiff
path: root/src/actions.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/actions.c')
-rw-r--r--src/actions.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/actions.c b/src/actions.c
index 095604b..5bb0964 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -31,6 +31,7 @@ rp_action key_actions[] = { {KEY_PREFIX, 0, 0, generate_prefix},
{XK_7, -1, 0, goto_window_7},
{XK_8, -1, 0, goto_window_8},
{XK_9, -1, 0, goto_window_9},
+ {XK_m, -1, 0, maximize},
{ 0, 0, 0, 0 } };
void
@@ -327,3 +328,20 @@ generate_prefix (void *data)
XSendEvent (dpy, rp_current_window->w, False, KeyPressMask, &ev);
XSync (dpy, False);
}
+
+/* Maximize the current window if data = 0, otherwise assume it is a
+ pointer to a window that should be maximized */
+void
+maximize (void *data)
+{
+ rp_window *win = (rp_window *)data;
+
+ if (!win) win = rp_current_window;
+ if (!win) return;
+
+ XMoveResizeWindow (dpy, win->w,
+ PADDING_LEFT,
+ PADDING_TOP,
+ win->scr->root_attr.width - PADDING_LEFT - PADDING_RIGHT,
+ win->scr->root_attr.height - PADDING_TOP - PADDING_BOTTOM);
+}