layout: Fix togglemax function

This commit is contained in:
Martin Duquesnoy 2009-01-01 18:52:57 +01:00
parent edd7ec5363
commit 24e0212c3b
5 changed files with 17 additions and 14 deletions

View File

@ -432,7 +432,7 @@ client_manage(Window w, XWindowAttributes *wa)
* \param r Bool for resize hint or not
*/
void
client_moveresize(Client *c, XRectangle geo, bool r)
client_moveresize(Client *c, XRectangle geo, Bool r)
{
if(!c || c->state_dock)
return;
@ -511,12 +511,11 @@ client_moveresize(Client *c, XRectangle geo, bool r)
void
client_maximize(Client *c)
{
CHECK(c);
XRectangle geo;
CHECK(c);
client_raise(c);
client_focus(c);
c->screen = screen_get_with_geo(c->geo.x, c->geo.y);
@ -533,7 +532,6 @@ client_maximize(Client *c)
client_moveresize(c, geo, False);
return;
}

View File

@ -239,6 +239,7 @@ ewmh_manage_net_wm_state(long data_l[], Client *c)
if(c->free)
c->ogeo = c->geo;
client_maximize(c);
client_raise(c);
}
else if(data_l[0] == _NET_WM_STATE_REMOVE && c->state_fullscreen)
{

View File

@ -491,15 +491,19 @@ uicb_togglemax(uicb_t cmd)
if(!sel->max)
{
sel->tile = sel->free = False;
sel->ogeo = sel->geo;
sel->tile = False;
client_maximize(sel);
client_raise(sel);
sel->max = True;
}
else if(sel->max)
else
{
sel->max = False;
tags[selscreen][seltag[selscreen]].layout.func();
}
return;
}

View File

@ -48,6 +48,8 @@ typedef unsigned char uchar;
/* Enum */
enum { CurNormal, CurResize, CurMove, CurLast };
typedef enum { Top, Bottom, Right, Left, Center, PositionLast } Position;
/* Ewmh hints list */
enum
{
@ -80,7 +82,6 @@ enum
wmfs_current_layout,
net_last
};
typedef enum { Top, Bottom, Right, Left, Center, PositionLast } Position;
/*
* BarWindow Structure
@ -201,9 +202,9 @@ typedef struct
{
/* Misc option */
char *font;
bool raisefocus;
bool raiseswitch;
bool bartop;
Bool raisefocus;
Bool raiseswitch;
Bool bartop;
struct
{
/*
@ -247,7 +248,7 @@ typedef struct
Alias alias[256];
Layout layout[NUM_OF_LAYOUT];
int *ntag;
bool tag_round;
Bool tag_round;
int nkeybind;
int nbutton;
int nlayout;

View File

@ -36,7 +36,6 @@
/* Lib headers */
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <stdarg.h>
#include <string.h>
#include <signal.h>
@ -128,7 +127,7 @@ void client_kill(Client *c);
Bool ishide(Client *c);
void client_map(Client *c);
void client_manage(Window w, XWindowAttributes *wa);
void client_moveresize(Client *c, XRectangle geo, bool r);
void client_moveresize(Client *c, XRectangle geo, Bool r);
void client_maximize(Client *c);
void client_size_hints(Client *c);
void client_raise(Client *c);