add a root context that only applies to the root window. it fallsback to the desktop context, so desktop stuff applies to it too.

This commit is contained in:
Dana Jansens 2007-05-19 22:07:15 +00:00
parent 198aab2b71
commit 813d5c2ec9
4 changed files with 9 additions and 1 deletions

View file

@ -462,7 +462,9 @@
<mousebind button="Left" action="Press"> <mousebind button="Left" action="Press">
<action name="Activate"/> <action name="Activate"/>
</mousebind> </mousebind>
</context>
<context name="Root">
<!-- Menus --> <!-- Menus -->
<mousebind button="Middle" action="Press"> <mousebind button="Middle" action="Press">
<action name="ShowMenu"><menu>client-list-combined-menu</menu></action> <action name="ShowMenu"><menu>client-list-combined-menu</menu></action>

View file

@ -861,6 +861,8 @@ ObFrameContext frame_context_from_string(const gchar *name)
{ {
if (!g_ascii_strcasecmp("Desktop", name)) if (!g_ascii_strcasecmp("Desktop", name))
return OB_FRAME_CONTEXT_DESKTOP; return OB_FRAME_CONTEXT_DESKTOP;
else if (!g_ascii_strcasecmp("Root", name))
return OB_FRAME_CONTEXT_ROOT;
else if (!g_ascii_strcasecmp("Client", name)) else if (!g_ascii_strcasecmp("Client", name))
return OB_FRAME_CONTEXT_CLIENT; return OB_FRAME_CONTEXT_CLIENT;
else if (!g_ascii_strcasecmp("Titlebar", name)) else if (!g_ascii_strcasecmp("Titlebar", name))
@ -908,7 +910,7 @@ ObFrameContext frame_context(ObClient *client, Window win, gint x, gint y)
return OB_FRAME_CONTEXT_MOVE_RESIZE; return OB_FRAME_CONTEXT_MOVE_RESIZE;
if (win == RootWindow(ob_display, ob_screen)) if (win == RootWindow(ob_display, ob_screen))
return OB_FRAME_CONTEXT_DESKTOP; return OB_FRAME_CONTEXT_ROOT ;
if (client == NULL) return OB_FRAME_CONTEXT_NONE; if (client == NULL) return OB_FRAME_CONTEXT_NONE;
if (win == client->window) { if (win == client->window) {
/* conceptually, this is the desktop, as far as users are /* conceptually, this is the desktop, as far as users are

View file

@ -32,6 +32,7 @@ typedef void (*ObFrameIconifyAnimateFunc)(gpointer data);
typedef enum { typedef enum {
OB_FRAME_CONTEXT_NONE, OB_FRAME_CONTEXT_NONE,
OB_FRAME_CONTEXT_DESKTOP, OB_FRAME_CONTEXT_DESKTOP,
OB_FRAME_CONTEXT_ROOT,
OB_FRAME_CONTEXT_CLIENT, OB_FRAME_CONTEXT_CLIENT,
OB_FRAME_CONTEXT_TITLEBAR, OB_FRAME_CONTEXT_TITLEBAR,
OB_FRAME_CONTEXT_FRAME, OB_FRAME_CONTEXT_FRAME,

View file

@ -71,6 +71,9 @@ ObFrameContext mouse_button_frame_context(ObFrameContext context,
case OB_FRAME_CONTEXT_LEFT: case OB_FRAME_CONTEXT_LEFT:
case OB_FRAME_CONTEXT_RIGHT: case OB_FRAME_CONTEXT_RIGHT:
break; break;
case OB_FRAME_CONTEXT_ROOT:
x = OB_FRAME_CONTEXT_DESKTOP;
break;
case OB_FRAME_CONTEXT_BOTTOM: case OB_FRAME_CONTEXT_BOTTOM:
case OB_FRAME_CONTEXT_BLCORNER: case OB_FRAME_CONTEXT_BLCORNER:
case OB_FRAME_CONTEXT_BRCORNER: case OB_FRAME_CONTEXT_BRCORNER: