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