summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorOkan Demirmen <okan@cvs.openbsd.org>2012-07-16 01:53:15 +0000
committerOkan Demirmen <okan@cvs.openbsd.org>2012-07-16 01:53:15 +0000
commit4eea6b997a7570646a4b5f2241dc7840da23ed63 (patch)
tree6a7b64a463e811878415ebf52dfde859d23a57f0 /app
parentb54f9031ff7e2cca08b6c35f970deb20126ebaa1 (diff)
unify various max routines to match client placement and partially menu ones
when calculating screen dimensions.
Diffstat (limited to 'app')
-rw-r--r--app/cwm/client.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/app/cwm/client.c b/app/cwm/client.c
index b9bab580f..3339f55c5 100644
--- a/app/cwm/client.c
+++ b/app/cwm/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.
*
- * $OpenBSD: client.c,v 1.99 2012/07/16 01:36:30 okan Exp $
+ * $OpenBSD: client.c,v 1.100 2012/07/16 01:53:14 okan Exp $
*/
#include <sys/param.h>
@@ -256,8 +256,7 @@ void
client_maximize(struct client_ctx *cc)
{
struct screen_ctx *sc = cc->sc;
- int xmax = sc->view.w, ymax = sc->view.h;
- int x_org = 0, y_org = 0;
+ int x_org, y_org, xmax, ymax;
XineramaScreenInfo *xine;
if (cc->flags & CLIENT_FREEZE)
@@ -293,6 +292,10 @@ client_maximize(struct client_ctx *cc)
y_org = xine->y_org;
xmax = xine->width;
ymax = xine->height;
+ } else {
+ x_org = y_org = 0;
+ xmax = sc->view.w;
+ ymax = sc->view.h;
}
cc->geom.x = x_org + sc->gap.left;
@@ -310,7 +313,7 @@ void
client_vertmaximize(struct client_ctx *cc)
{
struct screen_ctx *sc = cc->sc;
- int y_org = 0, ymax = sc->view.h;
+ int y_org, ymax;
XineramaScreenInfo *xine;
if (cc->flags & CLIENT_FREEZE)
@@ -341,6 +344,9 @@ client_vertmaximize(struct client_ctx *cc)
if (xine) {
y_org = xine->y_org;
ymax = xine->height;
+ } else {
+ y_org = 0;
+ ymax = sc->view.h;
}
cc->geom.y = y_org + sc->gap.top;
@@ -356,7 +362,7 @@ void
client_horizmaximize(struct client_ctx *cc)
{
struct screen_ctx *sc = cc->sc;
- int x_org = 0, xmax = sc->view.w;
+ int x_org, xmax;
XineramaScreenInfo *xine;
if (cc->flags & CLIENT_FREEZE)
@@ -387,6 +393,9 @@ client_horizmaximize(struct client_ctx *cc)
if (xine) {
x_org = xine->x_org;
xmax = xine->width;
+ } else {
+ x_org = 0;
+ xmax = sc->view.w;
}
cc->geom.x = x_org + sc->gap.left;