}
else if (ev->message_type == _NET_WM_STATE)
{
- printf(" %ld\n", ev->data.l[0]);
- printf(" %s\n", XGetAtomName(X.disp, ev->data.l[1]));
- EWMH_UpdateWindowStateFlags(
- ev->window, ev->data.l[0], ev->data.l[1]);
+ Client* c = Client_Find(ev->window);
+ if (c)
+ {
+ Client_UpdateWindowState(c, ev->data.l[0], ev->data.l[1]);
+ }
+
+
+// printf(" %ld\n", ev->data.l[0]);
+// printf(" %s\n", XGetAtomName(X.disp, ev->data.l[1]));
+// EWMH_UpdateWindowStateFlags(
+// ev->window, ev->data.l[0], ev->data.l[1]);
}
/*
* handle active window (set urgency)
*/
-
-
}
static void XPropNotify(XEvent* e)
void Client_Close(Client* client);
void Client_UpdateAll(void);
void Client_Place(Client* c);
+void Client_UpdateWindowState(Client* c, int op, Atom prop);
/* mouse.c */
void Mouse_Down(XButtonEvent* ev);
int EWMH_GetWindowStateFlags(Window w);
void EWMH_SetWindowStateFlags(Window w, int flags);
void EWMH_UpdateWindowStateFlags(Window w, int op, Atom prop);
+
+int EWMH_GetFlagId(Atom* atoms, size_t natoms, Atom prop);
+
//void EWMH_GetWindowStrut(Strut* strut);
int EWMH_GetWindowPid(Window w);
void EWMH_SetWindowFrameExtents(Window w, int left, int right, int top, int bottom);
}
}
+void Client_UpdateWindowState(Client* c, int op, Atom prop)
+{
+ (void)c, (void)op;
+ if (prop == _NET_WM_STATE_HIDDEN)
+ {
+// UpdateHiddenState(c, op);
+ }
+ else if (prop == _NET_WM_STATE_FULLSCREEN)
+ {
+// UpdateFullscreenState(c, op);
+ }
+
+
+
+
+// int id = EWMH_GetFlagId(WindowState, nelem(WindowState), prop);
+// if (id >= 0)
+// {
+// int clearing = 0;
+// if (op == 2)
+// {
+// clearing = ((c->wm_state & (1 << id)) != 0);
+// }
+//
+// if (clearing)
+// {
+// c->wm_state &= ~(1 << id);
+// }
+// else
+// {
+// c->wm_state |= (1 << id);
+// }
+// }
+}
+
+
+
+
+
+
+
+
+
+
+
//void client_shade(Client* c)
//{
// client_setshade(c, ((c->flags & F_SHADED) ? 0 : 1));
}
}
-static void UpdateState(Client* c)
-{
- int frame_shown = 1;
- int window_shown = 1;
- int save_size_and_pos = 1;
+//static void UpdateState(Client* c)
+//{
+// (void)c;
+// int frame_shown = 1;
+// int window_shown = 1;
+// int save_size_and_pos = 1;
/*
if (fullscreen)
redraw
*/
-}
+//}
WriteFlagHint(w, _NET_WM_STATE, WindowState, nelem(WindowState), flags);
}
-static int GetFlagId(Atom* atoms, size_t natoms, Atom prop)
+int EWMH_GetFlagId(Atom* atoms, size_t natoms, Atom prop)
{
int id = -1;
for (size_t i = 0; i < natoms; i++)
return id;
}
-void EWMH_UpdateWindowStateFlags(Window w, int op, Atom prop)
-{
- Client* c = Client_Find(w);
- if (c)
- {
- int id = GetFlagId(WindowState, nelem(WindowState), prop);
- if (id >= 0)
- {
- int clearing = 0;
- if (op == 2)
- {
- clearing = ((c->wm_state & (1 << id)) != 0);
- }
-
- if (clearing)
- {
- c->wm_state &= ~(1 << id);
- }
- else
- {
- c->wm_state |= (1 << id);
- }
- }
- }
-}
+//void EWMH_UpdateWindowStateFlags(Window w, int op, Atom prop)
+//{
+// Client* c = Client_Find(w);
+// if (c)
+// {
+// int id = GetFlagId(WindowState, nelem(WindowState), prop);
+// if (id >= 0)
+// {
+// int clearing = 0;
+// if (op == 2)
+// {
+// clearing = ((c->wm_state & (1 << id)) != 0);
+// }
+//
+// if (clearing)
+// {
+// c->wm_state &= ~(1 << id);
+// }
+// else
+// {
+// c->wm_state |= (1 << id);
+// }
+// }
+// }
+//}
//void EWMH_GetWindowStrut(Strut* strut)
//{
// client_shade(client);
}
-static void lower_client(Client* client)
-{
- (void)client;
-// mons_lower(loc->monitor, loc->client);
- Client_Lower(client);
-}
-
-static void raise_client(Client* client)
-{
- Client_Raise(client);
-// mons_raise(loc->monitor, loc->client);
-}
-
//static void stack_clients(Client* client)
//{
// (void)client;
{ MODKEY|ShiftMask, Button2, ButtonPress, toggle_float },
{ MODKEY, Button2, ButtonPress, close_client },
{ 0, Button3, ButtonPress, shade_client },
- { 0, Button4, ButtonPress, lower_client },
- { 0, Button5, ButtonPress, raise_client }
};
//
//MouseAct Stacked[] = {