Here are my patches to add edge + button functionality.
I still feel that there is a problem with gconf, but I have just made it
so that the edge button functionality works.
I have included a patch for gconf to display AnyButton if it is set
to 0. There is also a patch to make the edge size configurable
because 1 pixel was too small and the mouse keeps slipping off
when using it for the switcher.
Hopefully these are acceptable, please let me know if they aren't.
diff --git a/include/compiz.h b/include/compiz.h
index 6161f99..8e32f2d 100644
--- a/include/compiz.h
+++ b/include/compiz.h
@@ -343,7 +343,8 @@ struct _CompAction {
Bool bell;
-unsigned int edgeMask;
+unsigned int edgeMask;
+int edgeButton;
};
typedef struct {
@@ -751,6 +752,8 @@ struct _CompDisplay {
HandleEventProc handleEvent;
+unsigned int mouseOnEdge;
+
CompPrivate *privates;
};
@@ -1125,7 +1128,8 @@ #define COMP_SCREEN_OPTION_OPACITY_STEP
#define COMP_SCREEN_OPTION_UNREDIRECT_FS 6
#define COMP_SCREEN_OPTION_DEFAULT_ICON7
#define COMP_SCREEN_OPTION_SYNC_TO_VBLANK 8
-#define COMP_SCREEN_OPTION_NUM9
+#define COMP_SCREEN_OPTION_EDGE_SIZE 9
+#define COMP_SCREEN_OPTION_NUM10
#ifndef GLX_EXT_texture_from_pixmap
#define GLX_BIND_TO_TEXTURE_RGB_EXT0x20D0
diff --git a/src/event.c b/src/event.c
index 5c4610d..b36468b 100644
--- a/src/event.c
+++ b/src/event.c
@@ -260,6 +260,7 @@ triggerButtonPressBindings (CompDisplay
unsigned intmodMask = REAL_MOD_MASK ~d-ignoredModMask;
unsigned intbindMods;
+
while (nOption--)
{
if (isInitiateBinding (option, CompBindingTypeButton, state, action))
@@ -272,6 +273,15 @@ triggerButtonPressBindings (CompDisplay
if ((*action-initiate) (d, action, state,
argument, nArgument))
return TRUE;
+
+ }
+ else if (option-value.action.edgeMask
+(option-value.action.edgeMask d-mouseOnEdge)
+(event-xbutton.button == option-value.action.edgeButton))
+ {
+ if ((*action-initiate) (d, action, state,
+argument, nArgument))
+ return TRUE;
}
}
@@ -553,6 +563,10 @@ isEdgeEnterAction (CompOption *opti
if (!isEdgeAction (option, state, edge))
return FALSE;
+/* block this edge action because there is an edgeButton */
+if (option-value.action.edgeButton = 0)
+ return FALSE;
+
if (!option-value.action.initiate)
return FALSE;
@@ -802,6 +816,8 @@ handleActionEvent (CompDisplay *d,
}
}
+d-mouseOnEdge = 0;
+
edgeWindow = None;
o[0].value.i = event-xcrossing.window;
@@ -844,6 +860,8 @@ handleActionEvent (CompDisplay *d,
if (edge)
{
+d-mouseOnEdge = edge;
+
state = CompActionStateInitEdge;
edgeWindow = event-xcrossing.window;
diff --git a/plugins/gconf.c b/plugins/gconf.c
index ea68ce3..175a4ac 100644
--- a/plugins/gconf.c
+++ b/plugins/gconf.c
@@ -209,7 +209,7 @@ gconfSetOption (CompDisplay *d,
gconf_value_free (gvalue);
break;
case CompOptionTypeAction: {
- gchar *key1, *key2, *key3, *key4;
+ gchar *key1, *key2, *key3, *key4, *key5;
GSList *node, *list = NULL;
GConfValue *gv;
inti;
@@ -218,6 +218,7 @@ gconfSetOption (CompDisplay *d,
key2 = g_strdup_printf (%s_%s, key, button);
key3 = g_strdup_printf (%s_%s, key, bell);
key4 = g_strdup_printf (%s_%s, key, edge);
+ key5 = g_strdup_printf (%s_%s, key, edge_button);
gvalue = gconf_value_new (GCONF_VALUE_STRING);
@@ -243,6 +244,8 @@ gconfSetOption (CompDisplay *d,
gconf_value_free (gvalue);
+
+
gvalue = gconf_value_new (GCONF_VALUE_BOOL);
gconf_value_set_bool (gvalue, o-value.action.bell);
existingValue = gconf_client_get (gd-client, key3, NULL);
@@ -279,10 +282,21 @@ gconfSetOption (CompDisplay *d,
g_slist_free (list);
gconf_value_free (gvalue);
+
+ existingValue = gconf_client_get (gd-client, key5, NULL);
+ o-value.action.edgeButton = gconf_value_get_int(existingValue);
+ gvalue = gconf_value_new (GCONF_VALUE_INT);
+ gconf_value_set_int (gvalue, o-value.action.edgeButton);
+ if (!existingValue || gconf_value_compare (existingValue, gvalue))
+ gconf_client_set (gd-client, key5, gvalue, NULL);
+
+ gconf_value_free (gvalue);
+
g_free (key1);
g_free (key2);
g_free (key3);
g_free (key4);
+ g_free (key5);
} break;
case CompOptionTypeList: {
GConfValueType type;
@@