Apply Almito's patchs for xcompmgr opacity support (#70), skype focus bug (#66) and fix for #68 & #69
This commit is contained in:
parent
56b6b467ee
commit
993b408262
43
src/client.c
43
src/client.c
@ -370,6 +370,9 @@ client_focus(Client *c)
|
||||
if(sel->flags & AboveFlag)
|
||||
sel->flags &= ~AboveFlag;
|
||||
|
||||
XChangeProperty(dpy,sel->frame,net_atom[net_wm_window_opacity],XA_CARDINAL,
|
||||
32,PropModeReplace,(uchar *)&conf.opacity,1);
|
||||
|
||||
frame_update(sel);
|
||||
|
||||
mouse_grabbuttons(sel, !conf.focus_pclick);
|
||||
@ -390,6 +393,9 @@ client_focus(Client *c)
|
||||
|
||||
if(TBARH - BORDH && c->titlebar->stipple)
|
||||
c->titlebar->stipple_color = conf.titlebar.stipple.colors.focus;
|
||||
|
||||
XDeleteProperty(dpy,c->frame,net_atom[net_wm_window_opacity]);
|
||||
|
||||
frame_update(c);
|
||||
mouse_grabbuttons(c, True);
|
||||
|
||||
@ -407,11 +413,7 @@ client_focus(Client *c)
|
||||
client_above(sel);
|
||||
|
||||
if(c->flags & UrgentFlag)
|
||||
{
|
||||
c->flags &= ~UrgentFlag;
|
||||
tags[c->screen][c->tag].urgent = False;
|
||||
infobar_draw_taglist(c->screen);
|
||||
}
|
||||
client_urgent(c, False);
|
||||
|
||||
XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime);
|
||||
|
||||
@ -428,6 +430,22 @@ client_focus(Client *c)
|
||||
return;
|
||||
}
|
||||
|
||||
/** Set urgency flag of the client
|
||||
* \param c Client pointer
|
||||
* \param u Bool
|
||||
*/
|
||||
void
|
||||
client_urgent(Client *c, Bool u)
|
||||
{
|
||||
if(u)
|
||||
c->flags |= UrgentFlag;
|
||||
else
|
||||
c->flags &= ~UrgentFlag;
|
||||
|
||||
tags[c->screen][c->tag].urgent = u;
|
||||
infobar_draw_taglist(c->screen);
|
||||
}
|
||||
|
||||
/* The following functions have the same point :
|
||||
* find a client member with a Window {{{
|
||||
*/
|
||||
@ -761,7 +779,6 @@ client_manage(Window w, XWindowAttributes *wa, Bool ar)
|
||||
client_update_attributes(c);
|
||||
client_map(c);
|
||||
ewmh_manage_window_type(c);
|
||||
client_focus(c);
|
||||
|
||||
if(ar)
|
||||
arrange(c->screen, True);
|
||||
@ -769,6 +786,11 @@ client_manage(Window w, XWindowAttributes *wa, Bool ar)
|
||||
if(!conf.client.set_new_win_master)
|
||||
layout_set_client_master(c);
|
||||
|
||||
if(c->tag == (uint)seltag[selscreen])
|
||||
{
|
||||
client_focus(c);
|
||||
}
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
@ -1067,10 +1089,11 @@ client_set_rules(Client *c)
|
||||
if(c->tag != (uint)seltag[selscreen])
|
||||
{
|
||||
tags[c->screen][c->tag].request_update = True;
|
||||
client_focus(NULL);
|
||||
}
|
||||
|
||||
tags[c->screen][c->tag].layout.func(c->screen);
|
||||
else
|
||||
{
|
||||
tags[c->screen][c->tag].layout.func(c->screen);
|
||||
}
|
||||
|
||||
/* Deprecated but still in use */
|
||||
applied_tag_rule = True;
|
||||
@ -1246,7 +1269,7 @@ client_unmanage(Client *c)
|
||||
client_focus(NULL);
|
||||
|
||||
if(c->flags & UrgentFlag)
|
||||
tags[c->screen][c->tag].urgent = False;
|
||||
client_urgent(c, False);
|
||||
|
||||
client_detach(c);
|
||||
XUngrabButton(dpy, AnyButton, AnyModifier, c->win);
|
||||
|
||||
@ -148,6 +148,7 @@ static void
|
||||
conf_misc_section(void)
|
||||
{
|
||||
int pad = 12;
|
||||
uint opacity = 255;
|
||||
struct conf_sec *sec;
|
||||
|
||||
sec = fetch_section_first(NULL, "misc");
|
||||
@ -162,6 +163,12 @@ conf_misc_section(void)
|
||||
conf.autostart_path = fetch_opt_first(sec, "", "autostart_path").str;
|
||||
conf.autostart_command = fetch_opt_first(sec, "", "autostart_command").str;
|
||||
pad = fetch_opt_first(sec, "12", "pad").num;
|
||||
opacity = fetch_opt_first(sec, "255", "opacity").num;
|
||||
|
||||
if(opacity > 255)
|
||||
opacity = 255;
|
||||
|
||||
conf.opacity = opacity << 24;
|
||||
|
||||
if(pad > 24 || pad < 1)
|
||||
{
|
||||
|
||||
@ -577,11 +577,7 @@ propertynotify(XPropertyEvent *ev)
|
||||
case XA_WM_HINTS:
|
||||
if((h = XGetWMHints(dpy, c->win)) && (h->flags & XUrgencyHint) && c != sel)
|
||||
{
|
||||
c->flags |= UrgentFlag;
|
||||
|
||||
tags[c->screen][c->tag].urgent = True;
|
||||
infobar_draw_taglist(c->screen);
|
||||
|
||||
client_urgent(c, True);
|
||||
XFree(h);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -69,6 +69,7 @@ ewmh_init_hints(void)
|
||||
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_supporting_wm_check] = ATOM("_NET_SUPPORTING_WM_CHECK");
|
||||
net_atom[net_wm_window_opacity] = ATOM("_NET_WM_WINDOW_OPACITY");
|
||||
net_atom[net_wm_window_type_normal] = ATOM("_NET_WM_WINDOW_TYPE_NORMAL");
|
||||
net_atom[net_wm_window_type_dock] = ATOM("_NET_WM_WINDOW_TYPE_DOCK");
|
||||
net_atom[net_wm_window_type_splash] = ATOM("_NET_WM_WINDOW_TYPE_SPLASH");
|
||||
@ -370,7 +371,7 @@ ewmh_manage_net_wm_state(long data_l[], Client *c)
|
||||
else if(data_l[1] == (long)net_atom[net_wm_state_demands_attention])
|
||||
{
|
||||
if(data_l[0] == _NET_WM_STATE_ADD)
|
||||
client_focus(c);
|
||||
client_urgent(c, True);
|
||||
if(data_l[0] == _NET_WM_STATE_REMOVE)
|
||||
if(c == sel)
|
||||
client_focus(NULL);
|
||||
|
||||
@ -849,7 +849,6 @@ layout_set_client_master(Client *c)
|
||||
|
||||
client_detach(c);
|
||||
client_attach(c);
|
||||
client_focus(c);
|
||||
|
||||
tags[selscreen][seltag[selscreen]].layout.func(selscreen);
|
||||
|
||||
|
||||
@ -115,6 +115,7 @@ enum
|
||||
net_wm_pid,
|
||||
net_showing_desktop,
|
||||
net_supporting_wm_check,
|
||||
net_wm_window_opacity,
|
||||
net_wm_window_type_normal,
|
||||
net_wm_window_type_dock,
|
||||
net_wm_window_type_splash,
|
||||
@ -375,6 +376,7 @@ typedef struct
|
||||
|
||||
/* Misc option */
|
||||
char *font;
|
||||
uint opacity;
|
||||
Bool raisefocus;
|
||||
Bool raiseswitch;
|
||||
Bool focus_fmouse;
|
||||
|
||||
@ -190,6 +190,7 @@ void client_unmanage(Client *c);
|
||||
void client_unmap(Client *c);
|
||||
void client_set_rules(Client *c);
|
||||
void client_update_attributes(Client *c);
|
||||
void client_urgent(Client *c, Bool u);
|
||||
void uicb_client_raise(uicb_t);
|
||||
void uicb_client_next(uicb_t);
|
||||
void uicb_client_prev(uicb_t);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user