]> Dogcows Code - chaz/openbox/commitdiff
Merge branch 'backport'
authorDana Jansens <danakj@orodu.net>
Sun, 20 Jan 2008 04:59:40 +0000 (23:59 -0500)
committerDana Jansens <danakj@orodu.net>
Sun, 20 Jan 2008 04:59:40 +0000 (23:59 -0500)
data/rc.xml
openbox/actions/growtoedge.c
openbox/event.h

index 3cd88ee884682eb4d38edd26f68060c4f568ceef..567ca28bdc9119113832de5215791a86ead481e4 100644 (file)
     </mousebind>
 
     <mousebind button="Up" action="Click">
-      <action name="Shade"/>
-      <action name="FocusToBottom"/>
-      <action name="Unfocus"/>
-      <action name="Lower"/>
+      <action name="if">
+        <shaded>no</shaded>
+        <then>
+          <action name="Shade"/>
+          <action name="FocusToBottom"/>
+          <action name="Unfocus"/>
+          <action name="Lower"/>
+        </then>
+      </action>
     </mousebind>
     <mousebind button="Down" action="Click">
-      <action name="Unshade"/>
-      <action name="Raise"/>
+      <action name="if">
+        <shaded>yes</shaded>
+        <then>
+          <action name="Unshade"/>
+          <action name="Raise"/>
+        </then>
+      </action>
     </mousebind>
 
     <mousebind button="Right" action="Press">
   </context>
 
   <context name="Desktop">
-    <mousebind button="Up" action="Press">
+    <mousebind button="Up" action="Click">
       <action name="GoToDesktop"><to>previous</to></action>
     </mousebind>
-    <mousebind button="Down" action="Press">
+    <mousebind button="Down" action="Click">
       <action name="GoToDesktop"><to>next</to></action>
     </mousebind>
 
-    <mousebind button="A-Up" action="Press">
+    <mousebind button="A-Up" action="Click">
       <action name="GoToDesktop"><to>previous</to></action>
     </mousebind>
-    <mousebind button="A-Down" action="Press">
+    <mousebind button="A-Down" action="Click">
       <action name="GoToDesktop"><to>next</to></action>
     </mousebind>
-    <mousebind button="C-A-Up" action="Press">
+    <mousebind button="C-A-Up" action="Click">
       <action name="GoToDesktop"><to>previous</to></action>
     </mousebind>
-    <mousebind button="C-A-Down" action="Press">
+    <mousebind button="C-A-Down" action="Click">
       <action name="GoToDesktop"><to>next</to></action>
     </mousebind>
 
   </context>
 
   <context name="MoveResize">
-    <mousebind button="Up" action="Press">
+    <mousebind button="Up" action="Click">
       <action name="GoToDesktop"><to>previous</to></action>
     </mousebind>
-    <mousebind button="Down" action="Press">
+    <mousebind button="Down" action="Click">
       <action name="GoToDesktop"><to>next</to></action>
     </mousebind>
-    <mousebind button="A-Up" action="Press">
+    <mousebind button="A-Up" action="Click">
       <action name="GoToDesktop"><to>previous</to></action>
     </mousebind>
-    <mousebind button="A-Down" action="Press">
+    <mousebind button="A-Down" action="Click">
       <action name="GoToDesktop"><to>next</to></action>
     </mousebind>
   </context>
index 69b8ef77b33ce4db0621992c08ceafe9b26e7a15..630ead10c446861a103fbdd7ad9d0c009da43c05 100644 (file)
@@ -7,9 +7,11 @@
 
 typedef struct {
     ObDirection dir;
+    gboolean shrink;
 } Options;
 
 static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node);
+static gpointer setup_shrink_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node);
 static void     free_func(gpointer options);
 static gboolean run_func(ObActionsData *data, gpointer options);
 
@@ -20,6 +22,12 @@ void action_growtoedge_startup(void)
                      free_func,
                      run_func,
                      NULL, NULL);
+
+    actions_register("ShrinkToEdge",
+                     setup_shrink_func,
+                     free_func,
+                     run_func,
+                     NULL, NULL);
 }
 
 static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node)
@@ -29,6 +37,7 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node)
 
     o = g_new0(Options, 1);
     o->dir = OB_DIRECTION_NORTH;
+    o->shrink = FALSE;
 
     if ((n = parse_find_node("direction", node))) {
         gchar *s = parse_string(doc, n);
@@ -50,6 +59,16 @@ static gpointer setup_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node)
     return o;
 }
 
+static gpointer setup_shrink_func(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node)
+{
+    Options *o;
+
+    o = setup_func(i, doc, node);
+    o->shrink = TRUE;
+
+    return o;
+}
+
 static void free_func(gpointer options)
 {
     Options *o = options;
@@ -98,11 +117,13 @@ static gboolean run_func(ObActionsData *data, gpointer options)
         return FALSE;
     }
 
-    /* try grow */
-    client_find_resize_directional(data->client, o->dir, TRUE,
-                                   &x, &y, &w, &h);
-    if (do_grow(data, x, y, w, h))
-        return FALSE;
+    if (!o->shrink) {
+        /* try grow */
+        client_find_resize_directional(data->client, o->dir, TRUE,
+                                       &x, &y, &w, &h);
+        if (do_grow(data, x, y, w, h))
+            return FALSE;
+    }
 
     /* we couldn't grow, so try shrink! */
     opp = (o->dir == OB_DIRECTION_NORTH ? OB_DIRECTION_SOUTH :
index a8d1aeaf9160aad2dc742cf59e3b58ff3c24926f..65ff915bc5f76d4b7c84477ce33746cb9d7f43ec 100644 (file)
@@ -33,11 +33,6 @@ extern Time event_curtime;
 /*! The last user-interaction time, as given by the clients */
 extern Time event_last_user_time;
 
-/*! The value of the mask for the NumLock modifier */
-extern guint NumLockMask;
-/*! The value of the mask for the ScrollLock modifier */
-extern guint ScrollLockMask;
-
 void event_startup(gboolean reconfig);
 void event_shutdown(gboolean reconfig);
 
This page took 0.027573 seconds and 4 git commands to generate.