forked from e16/e16
1
0
Fork 0

Add autoshade window option (suggested by Don Harrop).

SVN revision: 38883
This commit is contained in:
Kim Woelders 2009-02-01 10:15:13 +00:00
parent fc487b0dac
commit 9fc923f6ab
9 changed files with 43 additions and 8 deletions

View File

@ -167,6 +167,7 @@ _("Toggle Never Focus"),
_("Toggle Click to Focus"),
_("Toggle Never Use Area"),
_("Toggle Button Grabs"),
_("Toggle Autoshade"),
/* winops_opacity.menu */
_("Opacity"),
_("Default"),

View File

@ -6,3 +6,4 @@
"Toggle Click to Focus" NULL "wop * focusclick"
"Toggle Never Use Area" NULL "wop * never_use_area"
"Toggle Button Grabs" NULL "wop * no_button_grabs"
"Toggle Autoshade" NULL "wop * autoshade"

View File

@ -943,11 +943,27 @@ static void
BorderFrameHandleEvents(Win win __UNUSED__, XEvent * ev, void *prm)
{
EWin *ewin = (EWin *) prm;
int x, y;
switch (ev->type)
{
case EnterNotify:
if (ewin->props.autoshade && ewin->state.shaded)
{
EwinUnShade(ewin);
}
if (ewin->border->aclass)
ActionclassEvent(ewin->border->aclass, ev, ewin);
break;
case LeaveNotify:
if (ewin->props.autoshade && !ewin->state.shaded)
{
EQueryPointer(EoGetWin(ewin), &x, &y, NULL, NULL);
if (x >= 4 && x < EoGetW(ewin) - 4 &&
y >= 4 && y < EoGetH(ewin) - 4)
break;
EwinShade(ewin);
}
if (ewin->border->aclass)
ActionclassEvent(ewin->border->aclass, ev, ewin);
break;

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
* Copyright (C) 2004-2008 Kim Woelders
* Copyright (C) 2004-2009 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@ -81,6 +81,7 @@ static const WinOp winops[] = {
{"never_use_area", 0, 1, 1, EWIN_OP_NEVER_USE_AREA},
{"no_button_grabs", 0, 1, 1, EWIN_OP_NO_BUTTON_GRABS},
{"skiplists", 4, 1, 1, EWIN_OP_SKIP_LISTS},
{"autoshade", 0, 1, 1, EWIN_OP_AUTOSHADE},
{"no_app_focus", 0, 1, 1, EWIN_OP_INH_APP_FOCUS},
{"no_app_move", 0, 1, 1, EWIN_OP_INH_APP_MOVE},

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2008 Kim Woelders
* Copyright (C) 2005-2009 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@ -63,6 +63,7 @@ typedef enum {
EWIN_OP_NEVER_USE_AREA,
EWIN_OP_NO_BUTTON_GRABS,
EWIN_OP_SKIP_LISTS,
EWIN_OP_AUTOSHADE,
EWIN_OP_INH_APP_FOCUS,
EWIN_OP_INH_APP_MOVE,

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
* Copyright (C) 2004-2008 Kim Woelders
* Copyright (C) 2004-2009 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@ -1832,8 +1832,10 @@ typedef union {
unsigned nua:1;
unsigned ctf:1;
unsigned nbg:1;
unsigned: 5;
unsigned: 16;
unsigned autoshade:1;
unsigned: 4;
unsigned: 8;
unsigned: 8;
unsigned no_fade:1;
unsigned no_shadow:1;
unsigned: 6;
@ -1855,6 +1857,7 @@ EwinFlagsEncode(const EWin * ewin, unsigned int *flags)
fm2.f.nua = ewin->props.never_use_area;
fm2.f.ctf = ewin->props.focusclick;
fm2.f.nbg = ewin->props.no_button_grabs;
fm2.f.autoshade = ewin->props.autoshade;
#if USE_COMPOSITE
fm2.f.no_fade = !EoGetFade(ewin);
fm2.f.no_shadow = !EoGetShadow(ewin);
@ -1879,6 +1882,7 @@ EwinFlagsDecode(EWin * ewin, const unsigned int *flags)
ewin->props.never_use_area = fm2.f.nua;
ewin->props.focusclick = fm2.f.ctf;
ewin->props.no_button_grabs = fm2.f.nbg;
ewin->props.autoshade = fm2.f.autoshade;
#if USE_COMPOSITE
EoSetFade(ewin, !fm2.f.no_fade);
EoSetShadow(ewin, !fm2.f.no_shadow);

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
* Copyright (C) 2004-2008 Kim Woelders
* Copyright (C) 2004-2009 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@ -136,6 +136,7 @@ struct _ewin {
unsigned skip_winlist:1;
unsigned focusclick:1; /* Click to focus */
unsigned no_button_grabs:1;
unsigned autoshade:1; /* Autoshade on mouse in/out */
unsigned no_argb:1; /* Do not use ARGB frame */
/* Derived from other properties */

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
* Copyright (C) 2004-2008 Kim Woelders
* Copyright (C) 2004-2009 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@ -739,6 +739,12 @@ IpcWinop(const WinOp * wop, EWin * ewin, const char *prm)
ewin->props.focusclick = on;
goto ewin_update_snap_flags;
case EWIN_OP_AUTOSHADE:
on = ewin->props.autoshade;
SetEwinBoolean(wop->name, &on, param1, 1);
ewin->props.autoshade = on;
goto ewin_update_snap_flags;
case EWIN_OP_NO_BUTTON_GRABS:
on = ewin->props.no_button_grabs;
if (SetEwinBoolean(wop->name, &on, param1, 1))

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
* Copyright (C) 2005-2008 Kim Woelders
* Copyright (C) 2005-2009 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@ -739,6 +739,10 @@ WindowMatchEwinOpsAction(EWin * ewin, int op, const char *args)
WINOP_SET_BOOL(ewin->props.no_button_grabs, args);
break;
case EWIN_OP_AUTOSHADE:
WINOP_SET_BOOL(ewin->props.autoshade, args);
break;
case EWIN_OP_INH_APP_FOCUS:
WINOP_SET_BOOL(EwinInhGetApp(ewin, focus), args);
break;