client: split minimized out of hidden
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
7a80fc8fee
commit
e0d3da455b
19
client.c
19
client.c
|
@ -251,6 +251,7 @@ client_focus(client_t *c)
|
||||||
|
|
||||||
/* stop hiding c */
|
/* stop hiding c */
|
||||||
c->ishidden = false;
|
c->ishidden = false;
|
||||||
|
c->isminimized = false;
|
||||||
|
|
||||||
/* unban the client before focusing or it will fail */
|
/* unban the client before focusing or it will fail */
|
||||||
client_unban(c);
|
client_unban(c);
|
||||||
|
@ -1302,6 +1303,15 @@ luaA_client_newindex(lua_State *L)
|
||||||
client_need_arrange(*c);
|
client_need_arrange(*c);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case A_TK_MINIMIZE:
|
||||||
|
b = luaA_checkboolean(L, 3);
|
||||||
|
if(b != (*c)->isminimized)
|
||||||
|
{
|
||||||
|
client_need_arrange(*c);
|
||||||
|
(*c)->isminimized = b;
|
||||||
|
client_need_arrange(*c);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case A_TK_FULLSCREEN:
|
case A_TK_FULLSCREEN:
|
||||||
client_setfullscreen(*c, luaA_checkboolean(L, 3));
|
client_setfullscreen(*c, luaA_checkboolean(L, 3));
|
||||||
break;
|
break;
|
||||||
|
@ -1393,7 +1403,11 @@ luaA_client_newindex(lua_State *L)
|
||||||
* \lfield machine The machine client is running on.
|
* \lfield machine The machine client is running on.
|
||||||
* \lfield icon_name The client name when iconified.
|
* \lfield icon_name The client name when iconified.
|
||||||
* \lfield screen Client screen number.
|
* \lfield screen Client screen number.
|
||||||
* \lfield hide Define if the client must be hidden, i.e. never mapped.
|
* \lfield hide Define if the client must be hidden, i.e. never mapped, not
|
||||||
|
* visible in taskbar.
|
||||||
|
* invisible in taskbar.
|
||||||
|
* \lfield minimize Define it the client must be iconify, i.e. only visible in
|
||||||
|
* taskbar.
|
||||||
* \lfield icon_path Path to the icon used to identify.
|
* \lfield icon_path Path to the icon used to identify.
|
||||||
* \lfield floating True always floating.
|
* \lfield floating True always floating.
|
||||||
* \lfield honorsizehints Honor size hints, i.e. respect size ratio.
|
* \lfield honorsizehints Honor size hints, i.e. respect size ratio.
|
||||||
|
@ -1508,6 +1522,9 @@ luaA_client_index(lua_State *L)
|
||||||
case A_TK_HIDE:
|
case A_TK_HIDE:
|
||||||
lua_pushboolean(L, (*c)->ishidden);
|
lua_pushboolean(L, (*c)->ishidden);
|
||||||
break;
|
break;
|
||||||
|
case A_TK_MINIMIZE:
|
||||||
|
lua_pushboolean(L, (*c)->isminimized);
|
||||||
|
break;
|
||||||
case A_TK_FULLSCREEN:
|
case A_TK_FULLSCREEN:
|
||||||
lua_pushboolean(L, (*c)->isfullscreen);
|
lua_pushboolean(L, (*c)->isfullscreen);
|
||||||
break;
|
break;
|
||||||
|
|
2
client.h
2
client.h
|
@ -108,7 +108,7 @@ client_isfloating(client_t *c)
|
||||||
static inline bool
|
static inline bool
|
||||||
client_isvisible(client_t *c, int screen)
|
client_isvisible(client_t *c, int screen)
|
||||||
{
|
{
|
||||||
return (!c->ishidden && client_maybevisible(c, screen));
|
return (!c->ishidden && !c->isminimized && client_maybevisible(c, screen));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if a client has strut information.
|
/** Check if a client has strut information.
|
||||||
|
|
|
@ -34,6 +34,7 @@ layout
|
||||||
left
|
left
|
||||||
line
|
line
|
||||||
machine
|
machine
|
||||||
|
minimize
|
||||||
mouse_enter
|
mouse_enter
|
||||||
mouse_leave
|
mouse_leave
|
||||||
mwfact
|
mwfact
|
||||||
|
|
7
event.c
7
event.c
|
@ -579,9 +579,10 @@ event_handle_maprequest(void *data __attribute__ ((unused)),
|
||||||
}
|
}
|
||||||
else if((c = client_getbywin(ev->window)))
|
else if((c = client_getbywin(ev->window)))
|
||||||
{
|
{
|
||||||
if(client_maybevisible(c, c->screen))
|
/* Check that it may be visible, but not asked to be hidden */
|
||||||
|
if(client_maybevisible(c, c->screen) && !c->ishidden)
|
||||||
{
|
{
|
||||||
c->ishidden = false;
|
c->isminimized = false;
|
||||||
globalconf.screens[c->screen].need_arrange = true;
|
globalconf.screens[c->screen].need_arrange = true;
|
||||||
xcb_map_window(globalconf.connection, ev->window);
|
xcb_map_window(globalconf.connection, ev->window);
|
||||||
/* it will be raised, so just update ourself */
|
/* it will be raised, so just update ourself */
|
||||||
|
@ -760,7 +761,7 @@ event_handle_clientmessage(void *data __attribute__ ((unused)),
|
||||||
&& ev->data.data32[0] == XCB_WM_STATE_ICONIC)
|
&& ev->data.data32[0] == XCB_WM_STATE_ICONIC)
|
||||||
{
|
{
|
||||||
client_need_arrange(c);
|
client_need_arrange(c);
|
||||||
c->ishidden = true;
|
c->isminimized = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(ev->type == _XEMBED)
|
else if(ev->type == _XEMBED)
|
||||||
|
|
6
ewmh.c
6
ewmh.c
|
@ -296,12 +296,14 @@ ewmh_process_state_atom(client_t *c, xcb_atom_t state, int set)
|
||||||
if(set == _NET_WM_STATE_REMOVE)
|
if(set == _NET_WM_STATE_REMOVE)
|
||||||
{
|
{
|
||||||
client_need_arrange(c);
|
client_need_arrange(c);
|
||||||
c->ishidden = false;
|
c->isminimized = false;
|
||||||
|
client_need_arrange(c);
|
||||||
}
|
}
|
||||||
else if(set == _NET_WM_STATE_ADD)
|
else if(set == _NET_WM_STATE_ADD)
|
||||||
{
|
{
|
||||||
client_need_arrange(c);
|
client_need_arrange(c);
|
||||||
c->ishidden = true;
|
c->isminimized = true;
|
||||||
|
client_need_arrange(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(state == _NET_WM_STATE_DEMANDS_ATTENTION)
|
else if(state == _NET_WM_STATE_DEMANDS_ATTENTION)
|
||||||
|
|
|
@ -306,6 +306,8 @@ struct client_t
|
||||||
bool ismoving;
|
bool ismoving;
|
||||||
/** True if the client is hidden */
|
/** True if the client is hidden */
|
||||||
bool ishidden;
|
bool ishidden;
|
||||||
|
/** True if the client is minimized */
|
||||||
|
bool isminimized;
|
||||||
/** True if the client is fullscreen */
|
/** True if the client is fullscreen */
|
||||||
bool isfullscreen;
|
bool isfullscreen;
|
||||||
/** True if the client is above others */
|
/** True if the client is above others */
|
||||||
|
|
|
@ -216,6 +216,7 @@ tasklist_draw(draw_context_t *ctx, int screen,
|
||||||
|
|
||||||
for(c = globalconf.clients; c; c = c->next)
|
for(c = globalconf.clients; c; c = c->next)
|
||||||
if(!c->skiptb
|
if(!c->skiptb
|
||||||
|
&& !c->ishidden
|
||||||
&& c->type != WINDOW_TYPE_SPLASH
|
&& c->type != WINDOW_TYPE_SPLASH
|
||||||
&& c->type != WINDOW_TYPE_DOCK
|
&& c->type != WINDOW_TYPE_DOCK
|
||||||
&& c->type != WINDOW_TYPE_DESKTOP)
|
&& c->type != WINDOW_TYPE_DESKTOP)
|
||||||
|
|
Loading…
Reference in New Issue