From: Mikael Magnusson Date: Thu, 14 Feb 2008 09:51:35 +0000 (+0100) Subject: Merge branch 'backport' into work X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fopenbox;a=commitdiff_plain;h=1124d1036984f920dcd5b2caec9ff8fe2d788b8a Merge branch 'backport' into work Diffing against the old work branch where most of the changes in backport were cherry-picked from indicates this should be alright. (0de9097017d4d1991388a35e380a57dc1135b431) --- 1124d1036984f920dcd5b2caec9ff8fe2d788b8a diff --cc openbox/client.c index c7a82d16,371eb087..946e80d3 --- a/openbox/client.c +++ b/openbox/client.c @@@ -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 */ diff --cc openbox/config.c index a268eb5b,c82e3b3a..b5b4ef4e --- a/openbox/config.c +++ b/openbox/config.c @@@ -187,18 -191,20 +189,19 @@@ static void config_parse_gravity_coord( the monitor, so center2 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();; @@@ -209,21 -215,41 +212,40 @@@ if (class_set) settings->class = g_pattern_spec_new(class); + 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 (parse_attr_string("role", app, &role)) + 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); } } } diff --cc openbox/event.c index cedac2e3,1b3c1c23..9502edf5 --- a/openbox/event.c +++ b/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]);