Merge branch 'review' into wip/mikabox
authorMikael Magnusson <mikachu@gmail.com>
Thu, 10 Apr 2014 20:46:28 +0000 (22:46 +0200)
committerMikael Magnusson <mikachu@gmail.com>
Thu, 10 Apr 2014 20:49:52 +0000 (22:49 +0200)
Conflicts:
openbox/actions.c
openbox/actions/growtoedge.c
openbox/actions/if.c
openbox/config.c
openbox/place.c

18 files changed:
1  2 
Makefile.am
obrender/test.c
obrender/theme.c
obt/prop.c
openbox/actions.c
openbox/actions.h
openbox/actions/growtoedge.c
openbox/actions/if.c
openbox/actions/moveresizeto.c
openbox/client.c
openbox/client.h
openbox/config.c
openbox/config.h
openbox/event.c
openbox/frame.c
openbox/menuframe.c
openbox/moveresize.c
openbox/screen.c

diff --cc Makefile.am
Simple merge
diff --cc obrender/test.c
Simple merge
Simple merge
diff --cc obt/prop.c
Simple merge
Simple merge
Simple merge
@@@ -106,23 -184,42 +184,44 @@@ static void free_func(gpointer o
  static gboolean run_func(ObActionsData *data, gpointer options)
  {
      Options *o = options;
-     gint x, y, w, h;
-     ObDirection opp;
-     gint half;
  
-     if (!data->client ||
-         actions_client_locked(data) ||
-         /* don't allow vertical resize if shaded */
-         ((o->dir == OB_DIRECTION_NORTH || o->dir == OB_DIRECTION_SOUTH) &&
-          data->client->shaded))
 -    if (!data->client)
++    if (!data->client || actions_client_locked(data))
 +    {
          return FALSE;
 +    }
  
 -    gboolean doing_verical_resize =
++    gboolean doing_vertical_resize =
+         o->dir == OB_DIRECTION_NORTH ||
+         o->dir == OB_DIRECTION_SOUTH ||
+         o->fill;
 -    if (data->client->shaded && doing_verical_resize)
++    if (data->client->shaded && doing_vertical_resize)
+             return FALSE;
+     if (o->fill) {
+         if (o->shrink) {
+             /* We don't have any implementation of shrinking for the FillToGrow
+                action. */
+             return FALSE;
+         }
+         if (do_grow_all_edges(data, CLIENT_RESIZE_GROW_IF_NOT_ON_EDGE))
+             return FALSE;
+         /* If all the edges are blocked, then allow them to jump past their
+            current block points. */
+         do_grow_all_edges(data, CLIENT_RESIZE_GROW);
+         return FALSE;
+     }
      if (!o->shrink) {
-         /* try grow */
-         client_find_resize_directional(data->client, o->dir, TRUE,
+         gint x, y, w, h;
+         /* Try grow. */
+         client_find_resize_directional(data->client,
+                                        o->dir,
+                                        CLIENT_RESIZE_GROW,
                                         &x, &y, &w, &h);
          if (do_grow(data, x, y, w, h))
              return FALSE;
      }
@@@ -100,12 -95,15 +101,15 @@@ void action_if_startup(void
  {
      actions_register("If", setup_func, free_func, run_func_if);
      actions_register("Stop", NULL, NULL, run_func_stop);
 +    actions_register("Continue", NULL, NULL, run_func_continue);
      actions_register("ForEach", setup_func, free_func, run_func_foreach);
 -
 -    actions_set_can_stop("Stop", TRUE);
 +    //actions_register("GroupMembers", setup_func, free_func, run_func_group);
  }
  
- static inline set_bool(xmlNodePtr node, const char *name, gboolean *on, gboolean *off)
+ static inline void set_bool(xmlNodePtr node,
+                             const char *name,
+                             gboolean *on,
+                             gboolean *off)
  {
      xmlNodePtr n;
  
@@@ -202,13 -198,9 +205,16 @@@ static void setup_query(Options* o, xml
              g_free(s);
          }
      }
 +    if ((n = obt_xml_find_node(node, "screendesktop"))) {
 +        gchar *s;
 +        if ((s = obt_xml_node_string(n))) {
 +          q->screendesktop_number = atoi(s);
 +          g_free(s);
 +        }
 +    }
+     if ((n = obt_xml_find_node(node, "activedesktop"))) {
+         q->screendesktop_number = obt_xml_node_int(n);
+     }
      if ((n = obt_xml_find_node(node, "title"))) {
          setup_typed_match(&q->title, n);
      }
@@@ -459,31 -445,15 +464,39 @@@ static gboolean run_func_foreach(ObActi
      return FALSE;
  }
  
- static gboolean run_func_stop(ObActionsData *data, gpointer options)
- {
-     actions_stop_running();
-     foreach_stop = TRUE;
- }
 +static gboolean run_func_continue(ObActionsData *data, gpointer options)
 +{
 +    actions_stop_running();
 +}
 +
 +/*
 +static gboolean run_func_group(ObActionsData *data, gpointer acts)
 +{
 +    GSList *it, *a = acts;
 +    ObClient *c = data->client;
 +
 +    if (a && c)
 +        for (it = c->group->members; it; it = g_slist_next(it)) {
 +            ObClient *member = it->data;
 +            if (actions_run_acts(a, data->uact, data->state,
 +                                 data->x, data->y, data->button,
 +                                 data->context, member))
 +                return TRUE;
 +        }
 +
 +    return FALSE;
 +}
 +*/
++
+ static gboolean run_func_stop(ObActionsData *data, gpointer options)
+ {
+     Options *o = options;
+     /* This stops the loop above so we don't invoke actions on any more
+        clients */
+     o->stop = TRUE;
+     /* TRUE causes actions_run_acts to not run further actions on the current
+        client */
+     return TRUE;
+ }
Simple merge
Simple merge
Simple merge
@@@ -652,11 -626,13 +648,15 @@@ static void parse_placement(xmlNodePtr 
  
      node = node->children;
  
-     if ((n = obt_xml_find_node(node, "policy")))
+     if ((n = obt_xml_find_node(node, "policy"))) {
          if (obt_xml_node_contains(n, "UnderMouse"))
              config_place_policy = OB_PLACE_POLICY_MOUSE;
 +        if (obt_xml_node_contains(n, "Random"))
 +            config_place_policy = OB_PLACE_POLICY_RANDOM;
+     }
+     if ((n = obt_xml_find_node(node, "center"))) {
+         config_place_center = obt_xml_node_bool(n);
+     }
      if ((n = obt_xml_find_node(node, "monitor"))) {
          if (obt_xml_node_contains(n, "active"))
              config_place_monitor = OB_PLACE_MONITOR_ACTIVE;
Simple merge
diff --cc openbox/event.c
Simple merge
diff --cc openbox/frame.c
Simple merge
Simple merge
Simple merge
  
  static gboolean screen_validate_layout(ObDesktopLayout *l);
  static gboolean replace_wm(void);
 -static void     screen_tell_ksplash(void);
 +//static void     screen_tell_ksplash(void);
  static void     screen_fallback_focus(void);
  
- guint           screen_num_desktops;
- guint           screen_num_monitors;
- guint           screen_desktop;
- guint           screen_last_desktop;
gboolean        screen_showing_desktop;
- ObDesktopLayout screen_desktop_layout;
- gchar         **screen_desktop_names;
- Window          screen_support_win;
- Time            screen_desktop_user_time = CurrentTime;
+ guint                  screen_num_desktops;
+ guint                  screen_num_monitors;
+ guint                  screen_desktop;
+ guint                  screen_last_desktop;
ObScreenShowDestopMode screen_show_desktop_mode;
+ ObDesktopLayout        screen_desktop_layout;
+ gchar                **screen_desktop_names;
+ Window                 screen_support_win;
+ Time                   screen_desktop_user_time = CurrentTime;
  
  static Size     screen_physical_size;
  static guint    screen_old_desktop;
@@@ -448,16 -442,12 +448,16 @@@ void screen_startup(gboolean reconfig
      else
          screen_set_desktop(MIN(config_screen_firstdesk,
                                 screen_num_desktops) - 1, FALSE);
 -    screen_last_desktop = screen_desktop;
 +    OBT_PROP_GET32(obt_root(ob_screen), OB_LAST_DESKTOP, CARDINAL, &screen_last_desktop);
 +    if (screen_last_desktop < 0 || screen_last_desktop >= screen_num_desktops) {
 +        screen_last_desktop = screen_desktop;
 +        OBT_PROP_SET32(obt_root(ob_screen), OB_LAST_DESKTOP, CARDINAL, screen_last_desktop);
 +    }
  
      /* don't start in showing-desktop mode */
-     screen_showing_desktop = FALSE;
+     screen_show_desktop_mode = SCREEN_SHOW_DESKTOP_NO;
      OBT_PROP_SET32(obt_root(ob_screen),
-                    NET_SHOWING_DESKTOP, CARDINAL, screen_showing_desktop);
+                    NET_SHOWING_DESKTOP, CARDINAL, screen_showing_desktop());
  
      if (session_desktop_layout_present &&
          screen_validate_layout(&session_desktop_layout))