]>
Dogcows Code - chaz/openbox/blob - openbox/actions/maximize.c
ebfb1e5c309c586ad3f54a690720f6ec26425efb
1 #include "openbox/actions.h"
2 #include "openbox/client.h"
9 static gpointer
setup_func(ObParseInst
*i
, xmlDocPtr doc
, xmlNodePtr node
);
10 static void free_func(gpointer options
);
11 static gboolean
run_func(ObActionsData
*data
, gpointer options
);
13 void action_maximize_startup()
15 actions_register("Maximize",
22 static gpointer
setup_func(ObParseInst
*i
, xmlDocPtr doc
, xmlNodePtr node
)
27 o
= g_new0(Options
, 1);
31 if ((n
= parse_find_node("vertical", node
)))
32 o
->vertical
= parse_bool(doc
, n
);
33 if ((n
= parse_find_node("horizontal", node
)))
34 o
->horizontal
= parse_bool(doc
, n
);
38 static void free_func(gpointer options
)
45 /* Always return FALSE because its not interactive */
46 static gboolean
run_func(ObActionsData
*data
, gpointer options
)
51 actions_client_move(data
, TRUE
);
53 if (o
->horizontal
&& !o
->vertical
)
54 client_maximize(data
->client
, !data
->client
->max_horz
, 1);
55 else if (!o
->horizontal
&& o
->vertical
)
56 client_maximize(data
->client
, !data
->client
->max_vert
, 2);
57 else if (o
->horizontal
&& o
->vertical
)
58 client_maximize(data
->client
,
59 !data
->client
->max_horz
|| !data
->client
->max_vert
,
62 actions_client_move(data
, FALSE
);
This page took 0.036044 seconds and 4 git commands to generate.