all: Fix tag bug, add wmfs hint (_WMFS_TAG_NAMES, _WMFS_CURRENT_LAYOUT...)
This commit is contained in:
parent
4904011168
commit
aba1d341f8
@ -420,7 +420,7 @@ client_manage(Window w, XWindowAttributes *wa)
|
|||||||
setwinstate(c->win, NormalState);
|
setwinstate(c->win, NormalState);
|
||||||
ewmh_get_client_list();
|
ewmh_get_client_list();
|
||||||
ewmh_manage_window_type(c);
|
ewmh_manage_window_type(c);
|
||||||
arrange();
|
arrange(c->screen);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -670,7 +670,7 @@ client_unmanage(Client *c)
|
|||||||
XSync(dpy, False);
|
XSync(dpy, False);
|
||||||
XUngrabServer(dpy);
|
XUngrabServer(dpy);
|
||||||
ewmh_get_client_list();
|
ewmh_get_client_list();
|
||||||
arrange();
|
arrange(c->screen);
|
||||||
XFree(c->title);
|
XFree(c->title);
|
||||||
free(c);
|
free(c);
|
||||||
|
|
||||||
|
|||||||
@ -120,7 +120,6 @@ clientmessageevent(XClientMessageEvent *ev)
|
|||||||
else if(mess_t == net_active_window)
|
else if(mess_t == net_active_window)
|
||||||
if((c = client_gb_win((Window)ev->data.l[0])))
|
if((c = client_gb_win((Window)ev->data.l[0])))
|
||||||
client_focus(c);
|
client_focus(c);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Manage _NET_WM_STATE */
|
/* Manage _NET_WM_STATE */
|
||||||
@ -131,6 +130,11 @@ clientmessageevent(XClientMessageEvent *ev)
|
|||||||
if(mess_t == net_close_window)
|
if(mess_t == net_close_window)
|
||||||
if((c = client_gb_win(ev->window)))
|
if((c = client_gb_win(ev->window)))
|
||||||
client_kill(c);
|
client_kill(c);
|
||||||
|
/* Manage _NET_WM_DESKTOP */
|
||||||
|
if(mess_t == net_wm_desktop)
|
||||||
|
if((c = client_gb_win(ev->window)))
|
||||||
|
tag_transfert(c, ev->data.l[0]);
|
||||||
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -360,7 +364,7 @@ propertynotify(XPropertyEvent *ev)
|
|||||||
case XA_WM_TRANSIENT_FOR:
|
case XA_WM_TRANSIENT_FOR:
|
||||||
XGetTransientForHint(dpy, c->win, &trans);
|
XGetTransientForHint(dpy, c->win, &trans);
|
||||||
if((c->tile || c->max) && (c->hint = (client_gb_win(trans) != NULL)))
|
if((c->tile || c->max) && (c->hint = (client_gb_win(trans) != NULL)))
|
||||||
arrange();
|
arrange(c->screen);
|
||||||
break;
|
break;
|
||||||
case XA_WM_NORMAL_HINTS:
|
case XA_WM_NORMAL_HINTS:
|
||||||
client_size_hints(c);
|
client_size_hints(c);
|
||||||
|
|||||||
22
src/ewmh.c
22
src/ewmh.c
@ -42,17 +42,18 @@
|
|||||||
void
|
void
|
||||||
ewmh_init_hints(void)
|
ewmh_init_hints(void)
|
||||||
{
|
{
|
||||||
|
/* EWMH hints */
|
||||||
net_atom[net_supported] = ATOM("_NET_SUPPORTED");
|
net_atom[net_supported] = ATOM("_NET_SUPPORTED");
|
||||||
net_atom[net_client_list] = ATOM("_NET_CLIENT_LIST");
|
net_atom[net_client_list] = ATOM("_NET_CLIENT_LIST");
|
||||||
net_atom[net_number_of_desktops] = ATOM("_NET_NUMBER_OF_DESKTOPS");
|
net_atom[net_number_of_desktops] = ATOM("_NET_NUMBER_OF_DESKTOPS");
|
||||||
net_atom[net_current_desktop] = ATOM("_NET_CURRENT_DESKTOP");
|
net_atom[net_current_desktop] = ATOM("_NET_CURRENT_DESKTOP");
|
||||||
net_atom[net_desktop_names] = ATOM("_NET_DESKTOP_NAMES");
|
net_atom[net_desktop_names] = ATOM("_NET_DESKTOP_NAMES");
|
||||||
net_atom[net_desktop_names_string] = ATOM("_NET_DESKTOP_NAMES_STRING");
|
|
||||||
net_atom[net_desktop_geometry] = ATOM("_NET_DESKTOP_GEOMETRY");
|
net_atom[net_desktop_geometry] = ATOM("_NET_DESKTOP_GEOMETRY");
|
||||||
net_atom[net_workarea] = ATOM("_NET_WORKAREA");
|
net_atom[net_workarea] = ATOM("_NET_WORKAREA");
|
||||||
net_atom[net_active_window] = ATOM("_NET_ACTIVE_WINDOW");
|
net_atom[net_active_window] = ATOM("_NET_ACTIVE_WINDOW");
|
||||||
net_atom[net_close_window] = ATOM("_NET_CLOSE_WINDOW");
|
net_atom[net_close_window] = ATOM("_NET_CLOSE_WINDOW");
|
||||||
net_atom[net_wm_name] = ATOM("_NET_WM_NAME");
|
net_atom[net_wm_name] = ATOM("_NET_WM_NAME");
|
||||||
|
net_atom[net_wm_desktop] = ATOM("_NET_WM_DESKTOP");
|
||||||
net_atom[net_wm_icon_name] = ATOM("_NET_WM_ICON_NAME");
|
net_atom[net_wm_icon_name] = ATOM("_NET_WM_ICON_NAME");
|
||||||
net_atom[net_wm_window_type] = ATOM("_NET_WM_WINDOW_TYPE");
|
net_atom[net_wm_window_type] = ATOM("_NET_WM_WINDOW_TYPE");
|
||||||
net_atom[net_wm_window_type_normal] = ATOM("_NET_WM_WINDOW_TYPE_NORMAL");
|
net_atom[net_wm_window_type_normal] = ATOM("_NET_WM_WINDOW_TYPE_NORMAL");
|
||||||
@ -66,6 +67,9 @@ ewmh_init_hints(void)
|
|||||||
net_atom[net_wm_state_fullscreen] = ATOM("_NET_WM_STATE_FULLSCREEN");
|
net_atom[net_wm_state_fullscreen] = ATOM("_NET_WM_STATE_FULLSCREEN");
|
||||||
net_atom[net_wm_state_demands_attention] = ATOM("_NET_WM_STATE_DEMANDS_ATTENTION");
|
net_atom[net_wm_state_demands_attention] = ATOM("_NET_WM_STATE_DEMANDS_ATTENTION");
|
||||||
net_atom[utf8_string] = ATOM("UTF8_STRING");
|
net_atom[utf8_string] = ATOM("UTF8_STRING");
|
||||||
|
/* WMFS hints */
|
||||||
|
net_atom[wmfs_tag_names] = ATOM("_WMFS_TAG_NAMES");
|
||||||
|
net_atom[wmfs_current_layout] = ATOM("_WMFS_CURRENT_LAYOUT");
|
||||||
|
|
||||||
XChangeProperty(dpy, ROOT, net_atom[net_supported], XA_ATOM, 32,
|
XChangeProperty(dpy, ROOT, net_atom[net_supported], XA_ATOM, 32,
|
||||||
PropModeReplace, (uchar*)net_atom, net_last);
|
PropModeReplace, (uchar*)net_atom, net_last);
|
||||||
@ -106,6 +110,19 @@ ewmh_get_current_desktop(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Manage _WMFS_CURRENT_LAYOUT
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
ewmh_get_current_layout(void)
|
||||||
|
{
|
||||||
|
XChangeProperty(dpy, ROOT, net_atom[wmfs_current_layout], XA_STRING, 8,
|
||||||
|
PropModeReplace, (uchar*)tags[selscreen][seltag[selscreen]].layout.symbol,
|
||||||
|
strlen(tags[selscreen][seltag[selscreen]].layout.symbol));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Get _NET_CLIENT_LIST
|
/** Get _NET_CLIENT_LIST
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
@ -154,7 +171,8 @@ ewmh_get_desktop_names(void)
|
|||||||
XChangeProperty(dpy, ROOT, net_atom[net_desktop_names], net_atom[utf8_string], 8,
|
XChangeProperty(dpy, ROOT, net_atom[net_desktop_names], net_atom[utf8_string], 8,
|
||||||
PropModeReplace, (uchar*)str, pos);
|
PropModeReplace, (uchar*)str, pos);
|
||||||
|
|
||||||
XChangeProperty(dpy, ROOT, net_atom[net_desktop_names_string], XA_STRING, 8,
|
/* _WMFS_TAG_NAMES */
|
||||||
|
XChangeProperty(dpy, ROOT, net_atom[wmfs_tag_names], XA_STRING, 8,
|
||||||
PropModeReplace, (uchar*)str, pos);
|
PropModeReplace, (uchar*)str, pos);
|
||||||
|
|
||||||
free(str);
|
free(str);
|
||||||
|
|||||||
@ -206,7 +206,7 @@ uicb_infobar_togglepos(uicb_t cmd)
|
|||||||
infobar_draw(selscreen);
|
infobar_draw(selscreen);
|
||||||
ewmh_set_workarea();
|
ewmh_set_workarea();
|
||||||
|
|
||||||
arrange();
|
arrange(selscreen);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
12
src/layout.c
12
src/layout.c
@ -35,14 +35,12 @@
|
|||||||
/** Arrange All
|
/** Arrange All
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
arrange(void)
|
arrange(int screen)
|
||||||
{
|
{
|
||||||
Client *c;
|
Client *c;
|
||||||
|
|
||||||
screen_get_sel();
|
|
||||||
|
|
||||||
for(c = clients; c; c = c->next)
|
for(c = clients; c; c = c->next)
|
||||||
if(c->screen == selscreen)
|
if(c->screen == screen)
|
||||||
{
|
{
|
||||||
if(!ishide(c))
|
if(!ishide(c))
|
||||||
client_unhide(c);
|
client_unhide(c);
|
||||||
@ -50,8 +48,9 @@ arrange(void)
|
|||||||
client_hide(c);
|
client_hide(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
tags[selscreen][seltag[selscreen]].layout.func();
|
tags[screen][seltag[screen]].layout.func();
|
||||||
infobar_draw(selscreen);
|
infobar_draw(screen);
|
||||||
|
ewmh_get_current_layout();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -100,6 +99,7 @@ layoutswitch(Bool b)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ewmh_get_current_layout();
|
||||||
tags[selscreen][seltag[selscreen]].layout.func();
|
tags[selscreen][seltag[selscreen]].layout.func();
|
||||||
infobar_draw(selscreen);
|
infobar_draw(selscreen);
|
||||||
|
|
||||||
|
|||||||
@ -57,7 +57,6 @@ enum
|
|||||||
net_number_of_desktops,
|
net_number_of_desktops,
|
||||||
net_current_desktop,
|
net_current_desktop,
|
||||||
net_desktop_names,
|
net_desktop_names,
|
||||||
net_desktop_names_string,
|
|
||||||
net_desktop_geometry,
|
net_desktop_geometry,
|
||||||
net_workarea,
|
net_workarea,
|
||||||
net_active_window,
|
net_active_window,
|
||||||
@ -68,6 +67,7 @@ enum
|
|||||||
net_wm_window_type_dock,
|
net_wm_window_type_dock,
|
||||||
net_wm_window_type_splash,
|
net_wm_window_type_splash,
|
||||||
net_wm_window_type_dialog,
|
net_wm_window_type_dialog,
|
||||||
|
net_wm_desktop,
|
||||||
net_wm_icon,
|
net_wm_icon,
|
||||||
net_wm_state,
|
net_wm_state,
|
||||||
net_wm_state_sticky,
|
net_wm_state_sticky,
|
||||||
@ -75,6 +75,9 @@ enum
|
|||||||
net_wm_state_fullscreen,
|
net_wm_state_fullscreen,
|
||||||
net_wm_state_demands_attention,
|
net_wm_state_demands_attention,
|
||||||
utf8_string,
|
utf8_string,
|
||||||
|
/* WMFS HINTS */
|
||||||
|
wmfs_tag_names,
|
||||||
|
wmfs_current_layout,
|
||||||
net_last
|
net_last
|
||||||
};
|
};
|
||||||
typedef enum { Top, Bottom, Right, Left, Center, PositionLast } Position;
|
typedef enum { Top, Bottom, Right, Left, Center, PositionLast } Position;
|
||||||
|
|||||||
@ -61,7 +61,7 @@ tag_set(int tag)
|
|||||||
seltag[selscreen] = tag;
|
seltag[selscreen] = tag;
|
||||||
}
|
}
|
||||||
ewmh_get_current_desktop();
|
ewmh_get_current_desktop();
|
||||||
arrange();
|
arrange(selscreen);
|
||||||
client_focus(NULL);
|
client_focus(NULL);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -84,7 +84,7 @@ tag_transfert(Client *c, int tag)
|
|||||||
|
|
||||||
c->tag = tag;
|
c->tag = tag;
|
||||||
|
|
||||||
arrange();
|
arrange(c->screen);
|
||||||
|
|
||||||
if(c == sel)
|
if(c == sel)
|
||||||
client_focus(NULL);
|
client_focus(NULL);
|
||||||
@ -114,6 +114,8 @@ uicb_tag(uicb_t cmd)
|
|||||||
void
|
void
|
||||||
uicb_tag_next(uicb_t cmd)
|
uicb_tag_next(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
screen_get_sel();
|
||||||
|
|
||||||
tag_set(seltag[selscreen] + 1);
|
tag_set(seltag[selscreen] + 1);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -125,6 +127,8 @@ uicb_tag_next(uicb_t cmd)
|
|||||||
void
|
void
|
||||||
uicb_tag_prev(uicb_t cmd)
|
uicb_tag_prev(uicb_t cmd)
|
||||||
{
|
{
|
||||||
|
screen_get_sel();
|
||||||
|
|
||||||
tag_set(seltag[selscreen] - 1);
|
tag_set(seltag[selscreen] - 1);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -206,7 +206,7 @@ scan(void)
|
|||||||
&& wa.map_state == IsViewable)
|
&& wa.map_state == IsViewable)
|
||||||
client_manage(w[i], &wa);
|
client_manage(w[i], &wa);
|
||||||
XFree(w);
|
XFree(w);
|
||||||
arrange();
|
arrange(screen_get_sel());
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -144,6 +144,7 @@ void uicb_client_kill(uicb_t);
|
|||||||
void ewmh_init_hints(void);
|
void ewmh_init_hints(void);
|
||||||
void ewmh_get_number_of_desktop(void);
|
void ewmh_get_number_of_desktop(void);
|
||||||
void ewmh_get_current_desktop(void);
|
void ewmh_get_current_desktop(void);
|
||||||
|
void ewmh_get_current_layout(void);
|
||||||
void ewmh_get_client_list(void);
|
void ewmh_get_client_list(void);
|
||||||
void ewmh_get_desktop_names(void);
|
void ewmh_get_desktop_names(void);
|
||||||
void ewmh_set_desktop_geometry(void);
|
void ewmh_set_desktop_geometry(void);
|
||||||
@ -224,7 +225,7 @@ void uicb_screen_next(uicb_t cmd);
|
|||||||
void uicb_screen_prev(uicb_t cmd);
|
void uicb_screen_prev(uicb_t cmd);
|
||||||
|
|
||||||
/* layout.c */
|
/* layout.c */
|
||||||
void arrange(void);
|
void arrange(int screen);
|
||||||
void freelayout(void);
|
void freelayout(void);
|
||||||
void layoutswitch(Bool b);
|
void layoutswitch(Bool b);
|
||||||
void maxlayout(void);
|
void maxlayout(void);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user