aboutsummaryrefslogtreecommitdiffstats
path: root/client.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--client.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/client.c b/client.c
index f4073ab..d599684 100644
--- a/client.c
+++ b/client.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: client.c,v 1.13 2008/03/22 15:09:45 oga Exp $
+ * $Id: client.c,v 1.14 2008/03/26 15:45:42 oga Exp $
*/
#include "headers.h"
@@ -331,19 +331,19 @@ void
client_maximize(struct client_ctx *cc)
{
if (cc->flags & CLIENT_MAXIMIZED) {
- cc->flags &= ~CLIENT_MAXIMIZED;
cc->geom = cc->savegeom;
} else {
XWindowAttributes rootwin_geom;
struct screen_ctx *sc = CCTOSC(cc);
XGetWindowAttributes(X_Dpy, sc->rootwin, &rootwin_geom);
- cc->savegeom = cc->geom;
+ if (!(cc->flags & CLIENT_VMAXIMIZED))
+ cc->savegeom = cc->geom;
cc->geom.x = 0;
cc->geom.y = 0;
cc->geom.height = rootwin_geom.height;
cc->geom.width = rootwin_geom.width;
- cc->flags |= CLIENT_MAXIMIZED;
+ cc->flags |= CLIENT_DOMAXIMIZE;
}
client_resize(cc);
@@ -352,6 +352,17 @@ client_maximize(struct client_ctx *cc)
void
client_resize(struct client_ctx *cc)
{
+ if (cc->flags & (CLIENT_MAXIMIZED | CLIENT_VMAXIMIZED))
+ cc->flags &= ~(CLIENT_MAXIMIZED | CLIENT_VMAXIMIZED);
+
+ if (cc->flags & CLIENT_DOMAXIMIZE) {
+ cc->flags &= ~CLIENT_DOMAXIMIZE;
+ cc->flags |= CLIENT_MAXIMIZED;
+ } else if (cc->flags & CLIENT_DOVMAXIMIZE) {
+ cc->flags &= ~CLIENT_DOVMAXIMIZE;
+ cc->flags |= CLIENT_VMAXIMIZED;
+ }
+
XMoveResizeWindow(X_Dpy, cc->pwin, cc->geom.x - cc->bwidth,
cc->geom.y - cc->bwidth, cc->geom.width + cc->bwidth*2,
cc->geom.height + cc->bwidth*2);
@@ -830,22 +841,22 @@ client_placecalc(struct client_ctx *cc)
void
client_vertmaximize(struct client_ctx *cc)
{
- if (cc->flags & CLIENT_MAXIMIZED) {
- cc->flags &= ~CLIENT_MAXIMIZED;
+ if (cc->flags & CLIENT_VMAXIMIZED) {
cc->geom = cc->savegeom;
} else {
struct screen_ctx *sc = CCTOSC(cc);
int display_height = DisplayHeight(X_Dpy, sc->which) -
cc->bwidth*2;
- cc->savegeom = cc->geom;
+ if (!(cc->flags & CLIENT_MAXIMIZED))
+ cc->savegeom = cc->geom;
cc->geom.y = cc->bwidth;
if (cc->geom.min_dx == 0)
cc->geom.height = display_height;
else
cc->geom.height = display_height -
(display_height % cc->geom.min_dx);
- cc->flags |= CLIENT_MAXIMIZED;
+ cc->flags |= CLIENT_DOVMAXIMIZE;
}
client_resize(cc);