From d81f46e77d6f6c0ce351765a1a778cdad9be592a Mon Sep 17 00:00:00 2001 From: sabetts Date: Tue, 27 Feb 2001 03:26:57 +0000 Subject: * actions.h: prototype for force_maximize added * actions.c: the user command "maximize" calls force_maximize (force_maximize): New function --- src/actions.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'src/actions.c') diff --git a/src/actions.c b/src/actions.c index 10779d4..40ea996 100644 --- a/src/actions.c +++ b/src/actions.c @@ -145,7 +145,7 @@ user_command user_commands[] = {"windows", cmd_windows, arg_VOID}, {"title", cmd_rename, arg_STRING}, {"clock", cmd_clock, arg_VOID}, - {"maximize", maximize, arg_VOID}, + {"maximize", force_maximize, arg_VOID}, {"newwm", cmd_newwm, arg_STRING}, {"generate", cmd_generate, arg_STRING}, /* rename to stuff */ {"version", cmd_version, arg_VOID}, @@ -728,7 +728,8 @@ maximize_transient (rp_window *win) win->height = maxy; } -/* set a good standard window's x,y,width,height fields to maximize the window. */ +/* set a good standard window's x,y,width,height fields to maximize + the window. */ static void maximize_normal (rp_window *win) { @@ -806,3 +807,22 @@ maximize (void *data) XSync (dpy, False); } + +/* Maximize the current window but don't treat transient windows + differently. */ +void +force_maximize (void *data) +{ + rp_window *win = (rp_window *)data; + + if (!win) win = rp_current_window; + if (!win) return; + + maximize_normal(win); + + /* Actually do the maximizing */ + XMoveResizeWindow (dpy, win->w, win->x, win->y, win->width+1, win->height+1); + XMoveResizeWindow (dpy, win->w, win->x, win->y, win->width, win->height); + + XSync (dpy, False); +} -- cgit v1.2.3