diff --git a/proto.h b/proto.h index af1d797..22a6efa 100644 --- a/proto.h +++ b/proto.h @@ -13,7 +13,6 @@ client* window_client(Window win); int client_state(client *c, Atom state); int client_add_state(client *c, Atom state); int client_drop_state(client *c, Atom state); -void client_toggle_state(client *c, Atom state); void windows_visible(stack *s); int window_message(Window target, Window subject, Atom atom, unsigned long protocol, unsigned long mask); void client_free(client *c); diff --git a/xoat.c b/xoat.c index cc1080e..bc0abb3 100644 --- a/xoat.c +++ b/xoat.c @@ -249,14 +249,6 @@ int client_drop_state(client *c, Atom state) return rc; } -void client_toggle_state(client *c, Atom state) -{ - if (client_state(c, state)) - client_drop_state(c, state); - else - client_add_state(c, state); -} - // build a list of visible windows void windows_visible(stack *s) { @@ -744,6 +736,7 @@ void key_press(XKeyEvent *e) short act = ACTION_NONE; void *data = NULL; KeySym key = XkbKeycodeToKeysym(display, e->keycode, 0, 0); unsigned int state = e->state & ~(LockMask|NumlockMask); + unsigned long spot; for (i = 0; i < sizeof(keys)/sizeof(binding); i++) { @@ -794,7 +787,18 @@ void key_press(XKeyEvent *e) } break; case ACTION_FULLSCREEN_TOGGLE: - client_toggle_state(c, atoms[_NET_WM_STATE_FULLSCREEN]); + spot = c->spot; + if (client_state(c, atoms[_NET_WM_STATE_FULLSCREEN])) + { + client_drop_state(c, atoms[_NET_WM_STATE_FULLSCREEN]); + if (window_get_cardinal_prop(c->window, atoms[XOAT_SPOT], &spot, 1)) + c->spot = spot; + } + else + { + client_add_state(c, atoms[_NET_WM_STATE_FULLSCREEN]); + window_set_cardinal_prop(c->window, atoms[XOAT_SPOT], &spot, 1); + } client_review(c); client_spot(c, c->spot, 1); break; diff --git a/xoat.h b/xoat.h index d677207..9ce9787 100644 --- a/xoat.h +++ b/xoat.h @@ -97,6 +97,7 @@ int struts[4] = { 0, 0, 0, 0 }; #define ATOM_CHAR(x) #x #define GENERAL_ATOMS(X) \ + X(XOAT_SPOT),\ X(_MOTIF_WM_HINTS),\ X(WM_DELETE_WINDOW),\ X(WM_TAKE_FOCUS),\