Index: src/Screen.cc =================================================================== --- src/Screen.cc (revision 4258) +++ src/Screen.cc (working copy) @@ -165,6 +165,7 @@ image_dither(rm, false, scrname+".imageDither", altscrname+".ImageDither"), opaque_move(rm, false, scrname + ".opaqueMove", altscrname+".OpaqueMove"), full_max(rm, true, scrname+".fullMaximization", altscrname+".FullMaximization"), + maximize_geometry(rm, "", scrname+".maximizeGeometry", altscrname+".MaximizeGeometry"), sloppy_window_grouping(rm, true, scrname+".sloppywindowgrouping", altscrname+".SloppyWindowGrouping"), workspace_warping(rm, true, scrname+".workspacewarping", altscrname+".WorkspaceWarping"), Index: src/Window.cc =================================================================== --- src/Window.cc (revision 4258) +++ src/Window.cc (working copy) @@ -1641,6 +1641,10 @@ int orig_max = maximized; + int geom_x, geom_y = 0; + unsigned int geom_w, geom_h = 0; + int mask = XParseGeometry(screen().maximizeGeometry().c_str(), &geom_x, &geom_y, &geom_w, &geom_h); + // These evaluate whether we need to TOGGLE the value for that field // Why? If maximize is only set to zero outside this, // and we only EVER toggle them, then: @@ -1679,6 +1683,8 @@ m_old_height = new_h; new_y = screen().maxTop(head); new_h = screen().maxBottom(head) - new_y - 2*frame().window().borderWidth(); + new_y = (mask & YValue) ? ((mask & YNegative) ? new_y + geom_y : geom_y) : new_y; + new_h = (mask & HeightValue && geom_h > 0) ? geom_h : new_h; } maximized ^= MAX_VERT; } @@ -1698,6 +1704,8 @@ m_old_width = new_w; new_x = screen().maxLeft(head); new_w = screen().maxRight(head) - new_x - 2*frame().window().borderWidth(); + new_x = (mask & XValue) ? ((mask & XNegative) ? new_x + geom_x : geom_x) : new_x; + new_w = (mask & WidthValue && geom_w > 0) ? geom_w : new_w; } maximized ^= MAX_HORZ; } Index: src/Screen.hh =================================================================== --- src/Screen.hh (revision 4258) +++ src/Screen.hh (working copy) @@ -117,6 +117,7 @@ bool clickRaises() const { return *resource.click_raises; } bool doOpaqueMove() const { return *resource.opaque_move; } bool doFullMax() const { return *resource.full_max; } + std::string maximizeGeometry() const { return *resource.maximize_geometry; } bool doShowWindowPos() const { return *resource.show_window_pos; } bool antialias() const { return *resource.antialias; } bool decorateTransient() const { return *resource.decorate_transient; } @@ -433,6 +434,7 @@ antialias, auto_raise, click_raises, decorate_transient; FbTk::Resource rootcommand; FbTk::Resource resize_model; + FbTk::Resource maximize_geometry; FbTk::Resource windowmenufile; FbTk::Resource follow_model; bool ordered_dither;