Merge branch 'backport' into work
authorMikael Magnusson <mikachu@comhem.se>
Thu, 14 Feb 2008 09:51:35 +0000 (10:51 +0100)
committerMikael Magnusson <mikachu@comhem.se>
Thu, 14 Feb 2008 18:43:02 +0000 (19:43 +0100)
Diffing against the old work branch where most of the changes
in backport were cherry-picked from indicates this should be
alright. (0de9097017d4d1991388a35e380a57dc1135b431)

12 files changed:
1  2 
data/rc.xml
m4/openbox.m4
openbox/actions.c
openbox/client.c
openbox/config.c
openbox/config.h
openbox/event.c
openbox/menuframe.c
openbox/mouse.c
render/font.c
render/theme.c
render/theme.h

diff --cc data/rc.xml
Simple merge
diff --cc m4/openbox.m4
Simple merge
Simple merge
@@@ -786,9 -851,11 +786,11 @@@ static ObAppSettings *client_get_settin
                   !g_pattern_match(app->role,
                                    strlen(self->role), self->role, NULL))
              match = FALSE;
+         else if ((signed)app->type >= 0 && app->type != self->type)
+             match = FALSE;
  
          if (match) {
 -            ob_debug("Window matching: %s\n", app->name);
 +            ob_debug("Window matching: %s", app->name);
  
              /* copy the settings to our struct, overriding the existing
                 settings if they are not defaults */
@@@ -187,18 -191,20 +189,19 @@@ static void config_parse_gravity_coord(
     the monitor, so <position><x>center</x></position><monitor>2</monitor>
     will center the window on the second monitor.
  */
 -static void parse_per_app_settings(ObParseInst *inst, xmlDocPtr doc,
 -                                   xmlNodePtr node, gpointer data)
 +static void parse_per_app_settings(xmlNodePtr node, gpointer d)
  {
 -    xmlNodePtr app = parse_find_node("application", node->children);
 +    xmlNodePtr app = obt_parse_find_node(node->children, "application");
-     gchar *name = NULL, *class = NULL, *role = NULL;
-     gboolean name_set, class_set;
+     gchar *name = NULL, *class = NULL, *role = NULL, *type = NULL;
+     gboolean name_set, class_set, type_set;
      gboolean x_pos_given;
  
      while (app) {
-         name_set = class_set = x_pos_given = FALSE;
+         name_set = class_set = type_set = x_pos_given = FALSE;
  
 -        class_set = parse_attr_string("class", app, &class);
 -        name_set = parse_attr_string("name", app, &name);
 -        type_set = parse_attr_string("type", app, &type);
 +        class_set = obt_parse_attr_string(app, "class", &class);
 +        name_set = obt_parse_attr_string(app, "name", &name);
++        type_set = obt_parse_attr_string(app, "type", &type);
          if (class_set || name_set) {
              xmlNodePtr n, c;
              ObAppSettings *settings = config_create_app_settings();;
              if (class_set)
                  settings->class = g_pattern_spec_new(class);
  
 -            if (parse_attr_string("role", app, &role))
+             if (type_set) {
+                 if (!g_ascii_strcasecmp(type, "normal"))
+                     settings->type = OB_CLIENT_TYPE_NORMAL;
+                 else if (!g_ascii_strcasecmp(type, "dialog"))
+                     settings->type = OB_CLIENT_TYPE_DIALOG;
+                 else if (!g_ascii_strcasecmp(type, "splash"))
+                     settings->type = OB_CLIENT_TYPE_SPLASH;
+                 else if (!g_ascii_strcasecmp(type, "utility"))
+                     settings->type = OB_CLIENT_TYPE_UTILITY;
+                 else if (!g_ascii_strcasecmp(type, "menu"))
+                     settings->type = OB_CLIENT_TYPE_MENU;
+                 else if (!g_ascii_strcasecmp(type, "toolbar"))
+                     settings->type = OB_CLIENT_TYPE_TOOLBAR;
+                 else if (!g_ascii_strcasecmp(type, "dock"))
+                     settings->type = OB_CLIENT_TYPE_DOCK;
+                 else if (!g_ascii_strcasecmp(type, "desktop"))
+                     settings->type = OB_CLIENT_TYPE_DESKTOP;
+             }
 +            if (obt_parse_attr_string(app, "role", &role))
                  settings->role = g_pattern_spec_new(role);
  
 -            if ((n = parse_find_node("decor", app->children)))
 -                if (!parse_contains("default", doc, n))
 -                    settings->decor = parse_bool(doc, n);
 +            if ((n = obt_parse_find_node(app->children, "decor")))
 +                if (!obt_parse_node_contains(n, "default"))
 +                    settings->decor = obt_parse_node_bool(n);
  
 -            if ((n = parse_find_node("shade", app->children)))
 -                if (!parse_contains("default", doc, n))
 -                    settings->shade = parse_bool(doc, n);
 +            if ((n = obt_parse_find_node(app->children, "shade")))
 +                if (!obt_parse_node_contains(n, "default"))
 +                    settings->shade = obt_parse_node_bool(n);
  
 -            if ((n = parse_find_node("position", app->children))) {
 -                if ((c = parse_find_node("x", n->children)))
 -                    if (!parse_contains("default", doc, c)) {
 -                        config_parse_gravity_coord(doc, c,
 -                                                   &settings->position.x);
 +            if ((n = obt_parse_find_node(app->children, "position"))) {
 +                if ((c = obt_parse_find_node(n->children, "x")))
 +                    if (!obt_parse_node_contains(c, "default")) {
 +                        config_parse_gravity_coord(c, &settings->position.x);
                          x_pos_given = TRUE;
                      }
  
@@@ -634,34 -669,39 +656,39 @@@ static void parse_resize(xmlNodePtr nod
  
      node = node->children;
  
 -    if ((n = parse_find_node("drawContents", node)))
 -        config_resize_redraw = parse_bool(doc, n);
 -    if ((n = parse_find_node("popupShow", node))) {
 -        config_resize_popup_show = parse_int(doc, n);
 -        if (parse_contains("Always", doc, n))
 +    if ((n = obt_parse_find_node(node, "drawContents")))
 +        config_resize_redraw = obt_parse_node_bool(n);
 +    if ((n = obt_parse_find_node(node, "popupShow"))) {
 +        config_resize_popup_show = obt_parse_node_int(n);
 +        if (obt_parse_node_contains(n, "Always"))
              config_resize_popup_show = 2;
 -        else if (parse_contains("Never", doc, n))
 +        else if (obt_parse_node_contains(n, "Never"))
              config_resize_popup_show = 0;
 -        else if (parse_contains("Nonpixel", doc, n))
 +        else if (obt_parse_node_contains(n, "Nonpixel"))
              config_resize_popup_show = 1;
      }
 -    if ((n = parse_find_node("popupPosition", node))) {
 -        if (parse_contains("Top", doc, n))
 +    if ((n = obt_parse_find_node(node, "popupPosition"))) {
 +        if (obt_parse_node_contains(n, "Top"))
              config_resize_popup_pos = OB_RESIZE_POS_TOP;
 -        else if (parse_contains("Center", doc, n))
 +        else if (obt_parse_node_contains(n, "Center"))
              config_resize_popup_pos = OB_RESIZE_POS_CENTER;
 -        else if (parse_contains("Fixed", doc, n)) {
 +        else if (obt_parse_node_contains(n, "Fixed")) {
              config_resize_popup_pos = OB_RESIZE_POS_FIXED;
  
 -            if ((n = parse_find_node("popupFixedPosition", node))) {
 +            if ((n = obt_parse_find_node(node, "popupFixedPosition"))) {
                  xmlNodePtr n2;
  
 -                if ((n2 = parse_find_node("x", n->children)))
 -                    config_parse_gravity_coord(doc, n2,
 +                if ((n2 = obt_parse_find_node(n->children, "x")))
 +                    config_parse_gravity_coord(n2,
                                                 &config_resize_popup_fixed.x);
 -                if ((n2 = parse_find_node("y", n->children)))
 -                    config_parse_gravity_coord(doc, n2,
 +                if ((n2 = obt_parse_find_node(n->children, "y")))
 +                    config_parse_gravity_coord(n2,
                                                 &config_resize_popup_fixed.y);
+                 config_resize_popup_fixed.x.pos =
+                     MAX(config_resize_popup_fixed.x.pos, 0);
+                 config_resize_popup_fixed.y.pos =
+                     MAX(config_resize_popup_fixed.y.pos, 0);
              }
          }
      }
Simple merge
diff --cc openbox/event.c
@@@ -1368,38 -1354,38 +1368,38 @@@ static void event_handle_client(ObClien
              } else
                  ob_debug_type(OB_DEBUG_APP_BUGS,
                                "_NET_ACTIVE_WINDOW message for window %s is "
 -                              "missing source indication\n");
 +                              "missing source indication");
-             client_activate(client, FALSE, TRUE, TRUE,
+             client_activate(client, TRUE, TRUE, TRUE,
                              (e->xclient.data.l[0] == 0 ||
                               e->xclient.data.l[0] == 2));
 -        } else if (msgtype == prop_atoms.net_wm_moveresize) {
 -            ob_debug("net_wm_moveresize for 0x%lx direction %d\n",
 +        } else if (msgtype == OBT_PROP_ATOM(NET_WM_MOVERESIZE)) {
 +            ob_debug("net_wm_moveresize for 0x%lx direction %d",
                       client->window, e->xclient.data.l[2]);
              if ((Atom)e->xclient.data.l[2] ==
 -                prop_atoms.net_wm_moveresize_size_topleft ||
 +                OBT_PROP_ATOM(NET_WM_MOVERESIZE_SIZE_TOPLEFT) ||
                  (Atom)e->xclient.data.l[2] ==
 -                prop_atoms.net_wm_moveresize_size_top ||
 +                OBT_PROP_ATOM(NET_WM_MOVERESIZE_SIZE_TOP) ||
                  (Atom)e->xclient.data.l[2] ==
 -                prop_atoms.net_wm_moveresize_size_topright ||
 +                OBT_PROP_ATOM(NET_WM_MOVERESIZE_SIZE_TOPRIGHT) ||
                  (Atom)e->xclient.data.l[2] ==
 -                prop_atoms.net_wm_moveresize_size_right ||
 +                OBT_PROP_ATOM(NET_WM_MOVERESIZE_SIZE_RIGHT) ||
                  (Atom)e->xclient.data.l[2] ==
 -                prop_atoms.net_wm_moveresize_size_right ||
 +                OBT_PROP_ATOM(NET_WM_MOVERESIZE_SIZE_RIGHT) ||
                  (Atom)e->xclient.data.l[2] ==
 -                prop_atoms.net_wm_moveresize_size_bottomright ||
 +                OBT_PROP_ATOM(NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT) ||
                  (Atom)e->xclient.data.l[2] ==
 -                prop_atoms.net_wm_moveresize_size_bottom ||
 +                OBT_PROP_ATOM(NET_WM_MOVERESIZE_SIZE_BOTTOM) ||
                  (Atom)e->xclient.data.l[2] ==
 -                prop_atoms.net_wm_moveresize_size_bottomleft ||
 +                OBT_PROP_ATOM(NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT) ||
                  (Atom)e->xclient.data.l[2] ==
 -                prop_atoms.net_wm_moveresize_size_left ||
 +                OBT_PROP_ATOM(NET_WM_MOVERESIZE_SIZE_LEFT) ||
                  (Atom)e->xclient.data.l[2] ==
 -                prop_atoms.net_wm_moveresize_move ||
 +                OBT_PROP_ATOM(NET_WM_MOVERESIZE_MOVE) ||
                  (Atom)e->xclient.data.l[2] ==
 -                prop_atoms.net_wm_moveresize_size_keyboard ||
 +                OBT_PROP_ATOM(NET_WM_MOVERESIZE_SIZE_KEYBOARD) ||
                  (Atom)e->xclient.data.l[2] ==
 -                prop_atoms.net_wm_moveresize_move_keyboard) {
 -
 +                OBT_PROP_ATOM(NET_WM_MOVERESIZE_MOVE_KEYBOARD))
 +            {
                  moveresize_start(client, e->xclient.data.l[0],
                                   e->xclient.data.l[1], e->xclient.data.l[3],
                                   e->xclient.data.l[2]);
Simple merge
diff --cc openbox/mouse.c
Simple merge
diff --cc render/font.c
Simple merge
diff --cc render/theme.c
Simple merge
diff --cc render/theme.h
Simple merge