add support for _NET_WM_STATE_SKIP_TASKBAR
This commit is contained in:
parent
67127f00f7
commit
11da7412b3
2
config.h
2
config.h
|
@ -164,6 +164,8 @@ struct Client
|
|||
Bool ismax;
|
||||
/** True if the client must be skipped from client list */
|
||||
Bool skip;
|
||||
/** True if the client must be skipped from task bar client list */
|
||||
Bool skiptb;
|
||||
/** Next client */
|
||||
Client *next;
|
||||
/** Previous client */
|
||||
|
|
10
ewmh.c
10
ewmh.c
|
@ -49,6 +49,7 @@ static Atom net_wm_window_type_splash;
|
|||
static Atom net_wm_icon;
|
||||
static Atom net_wm_state;
|
||||
static Atom net_wm_state_sticky;
|
||||
static Atom net_wm_state_skip_taskbar;
|
||||
static Atom net_wm_state_fullscreen;
|
||||
|
||||
static Atom utf8_string;
|
||||
|
@ -79,6 +80,7 @@ static AtomItem AtomNames[] =
|
|||
{ "_NET_WM_ICON", &net_wm_icon },
|
||||
{ "_NET_WM_STATE", &net_wm_state },
|
||||
{ "_NET_WM_STATE_STICKY", &net_wm_state_sticky },
|
||||
{ "_NET_WM_STATE_SKIP_TASKBAR", &net_wm_state_skip_taskbar },
|
||||
{ "_NET_WM_STATE_FULLSCREEN", &net_wm_state_fullscreen },
|
||||
|
||||
{ "UTF8_STRING", &utf8_string },
|
||||
|
@ -128,6 +130,7 @@ ewmh_set_supported_hints(int phys_screen)
|
|||
atom[i++] = net_wm_icon;
|
||||
atom[i++] = net_wm_state;
|
||||
atom[i++] = net_wm_state_sticky;
|
||||
atom[i++] = net_wm_state_skip_taskbar;
|
||||
atom[i++] = net_wm_state_fullscreen;
|
||||
|
||||
XChangeProperty(globalconf.display, RootWindow(globalconf.display, phys_screen),
|
||||
|
@ -229,6 +232,13 @@ ewmh_process_state_atom(Client *c, Atom state, int set)
|
|||
for(tag = globalconf.screens[c->screen].tags; tag; tag = tag->next)
|
||||
tag_client(c, tag);
|
||||
}
|
||||
else if(state == net_wm_state_skip_taskbar)
|
||||
{
|
||||
if(set == _NET_WM_STATE_REMOVE)
|
||||
c->skiptb = False;
|
||||
else if(set == _NET_WM_STATE_ADD)
|
||||
c->skiptb = True;
|
||||
}
|
||||
else if(state == net_wm_state_fullscreen)
|
||||
{
|
||||
Area area = get_screen_area(c->screen, NULL, NULL);
|
||||
|
|
|
@ -30,6 +30,9 @@
|
|||
#include "screen.h"
|
||||
#include "event.h"
|
||||
|
||||
|
||||
#define ISVISIBLE_ON_TB(c, screen) (client_isvisible(c, screen) && !c->skiptb)
|
||||
|
||||
extern AwesomeConf globalconf;
|
||||
|
||||
typedef struct
|
||||
|
@ -50,7 +53,7 @@ tasklist_draw(Widget *widget, DrawCtx *ctx, int offset, int used)
|
|||
int n = 0, i = 0, box_width = 0;
|
||||
|
||||
for(c = globalconf.clients; c; c = c->next)
|
||||
if(client_isvisible(c, widget->statusbar->screen))
|
||||
if(ISVISIBLE_ON_TB(c, widget->statusbar->screen))
|
||||
n++;
|
||||
|
||||
if(!n)
|
||||
|
@ -67,7 +70,7 @@ tasklist_draw(Widget *widget, DrawCtx *ctx, int offset, int used)
|
|||
widget->alignment);
|
||||
|
||||
for(c = globalconf.clients; c; c = c->next)
|
||||
if(client_isvisible(c, widget->statusbar->screen))
|
||||
if(ISVISIBLE_ON_TB(c, widget->statusbar->screen))
|
||||
{
|
||||
if(sel == c)
|
||||
{
|
||||
|
@ -106,7 +109,7 @@ tasklist_button_press(Widget *widget, XButtonPressedEvent *ev)
|
|||
if(ev->button == Button1 && CLEANMASK(ev->state) == NoSymbol)
|
||||
{
|
||||
for(c = globalconf.clients; c; c = c->next)
|
||||
if(client_isvisible(c, widget->statusbar->screen))
|
||||
if(ISVISIBLE_ON_TB(c, widget->statusbar->screen))
|
||||
n++;
|
||||
|
||||
if(!n)
|
||||
|
@ -122,11 +125,11 @@ tasklist_button_press(Widget *widget, XButtonPressedEvent *ev)
|
|||
|
||||
/* found first visible client */
|
||||
for(c = globalconf.clients;
|
||||
c && !client_isvisible(c, widget->statusbar->screen);
|
||||
c && !ISVISIBLE_ON_TB(c, widget->statusbar->screen);
|
||||
c = c->next);
|
||||
/* found ci-th visible client */
|
||||
for(; c && i < ci; c = c->next)
|
||||
if(client_isvisible(c, widget->statusbar->screen))
|
||||
if(ISVISIBLE_ON_TB(c, widget->statusbar->screen))
|
||||
i++;
|
||||
|
||||
focus(c, True, widget->statusbar->screen);
|
||||
|
|
Loading…
Reference in New Issue