From: Mikael Magnusson Date: Wed, 23 Apr 2008 14:41:35 +0000 (+0200) Subject: Merge branch 'backport' into work X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=6799c67c07e99c440f549802f60d9f16995ab711;p=chaz%2Fopenbox Merge branch 'backport' into work Conflicts: openbox/config.c openbox/keyboard.c openbox/moveresize.c --- 6799c67c07e99c440f549802f60d9f16995ab711 diff --cc openbox/config.c index 6282bf85,d2745178..790b03ba --- a/openbox/config.c +++ b/openbox/config.c @@@ -820,28 -784,29 +820,28 @@@ static void parse_dock(xmlNodePtr node } } -static void parse_menu(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, - gpointer data) +static void parse_menu(xmlNodePtr node, gpointer d) { xmlNodePtr n; - for (node = node->children; node; node = node->next) { - if (!xmlStrcasecmp(node->name, (const xmlChar*) "file")) { - gchar *c; + node = node->children; - c = obt_parse_node_string(node); - if ((n = parse_find_node("hideDelay", node))) - config_menu_hide_delay = parse_int(doc, n); - if ((n = parse_find_node("middle", node))) - config_menu_middle = parse_bool(doc, n); - if ((n = parse_find_node("submenuShowDelay", node))) - config_submenu_show_delay = parse_int(doc, n); - if ((n = parse_find_node("applicationIcons", node))) - config_menu_client_list_icons = parse_bool(doc, n); - if ((n = parse_find_node("manageDesktops", node))) - config_menu_manage_desktops = parse_bool(doc, n); - - while ((node = parse_find_node("file", node))) { - gchar *c = parse_string(doc, node); ++ if ((n = obt_parse_find_node(node, "hideDelay"))) ++ config_menu_hide_delay = obt_parse_node_int(n); ++ if ((n = obt_parse_find_node(node, "middle"))) ++ config_menu_middle = obt_parse_node_bool(n); ++ if ((n = obt_parse_find_node(node, "submenuShowDelay"))) ++ config_submenu_show_delay = obt_parse_node_int(n); ++ if ((n = obt_parse_find_node(node, "applicationIcons"))) ++ config_menu_client_list_icons = obt_parse_node_bool(n); ++ if ((n = obt_parse_find_node(node, "manageDesktops"))) ++ config_menu_manage_desktops = obt_parse_node_bool(n); ++ ++ while ((node = obt_parse_find_node(node, "file"))) { ++ gchar *c = obt_parse_node_string(node); config_menu_files = g_slist_append(config_menu_files, - parse_expand_tilde(c)); + obt_paths_expand_tilde(c)); g_free(c); - } - if ((n = obt_parse_find_node(node, "hideDelay"))) - config_menu_hide_delay = obt_parse_node_int(n); - if ((n = obt_parse_find_node(node, "middle"))) - config_menu_middle = obt_parse_node_bool(n); - if ((n = obt_parse_find_node(node, "submenuShowDelay"))) - config_submenu_show_delay = obt_parse_node_int(n); - if ((n = obt_parse_find_node(node, "applicationIcons"))) - config_menu_client_list_icons = obt_parse_node_bool(n); - if ((n = obt_parse_find_node(node, "manageDesktops"))) - config_menu_manage_desktops = obt_parse_node_bool(n); + node = node->next; } } diff --cc openbox/keyboard.c index a693a71c,8c5b5543..410eb6e0 --- a/openbox/keyboard.c +++ b/openbox/keyboard.c @@@ -50,14 -52,14 +50,14 @@@ static void grab_keys(gboolean grab p = curpos ? curpos->first_child : keyboard_firstnode; while (p) { if (p->key) - grab_key(p->key, p->state, RootWindow(ob_display, ob_screen), + grab_key(p->key, p->state, obt_root(ob_screen), - GrabModeSync); + GrabModeAsync); p = p->next_sibling; } if (curpos) grab_key(config_keyboard_reset_keycode, config_keyboard_reset_state, - obt_root(ob_screen), GrabModeSync); - RootWindow(ob_display, ob_screen), GrabModeAsync); ++ obt_root(ob_screen), GrabModeAsync); } } diff --cc openbox/moveresize.c index f501996b,f324818d..e748cd3d --- a/openbox/moveresize.c +++ b/openbox/moveresize.c @@@ -363,53 -359,52 +363,52 @@@ static void do_resize(void h = cur_h; client_try_configure(moveresize_client, &x, &y, &w, &h, &lw, &lh, TRUE); - if (w == moveresize_client->area.width && - h == moveresize_client->area.height) + if (!(w == moveresize_client->area.width && + h == moveresize_client->area.height)) { - return; - } #ifdef SYNC - if (config_resize_redraw && obt_display_extension_sync && - moveresize_client->sync_request && moveresize_client->sync_counter && - !moveresize_client->not_responding) - { - XEvent ce; - XSyncValue val; - - /* are we already waiting for the sync counter to catch up? */ - if (waiting_for_sync) - return; - - /* increment the value we're waiting for */ - ++moveresize_client->sync_counter_value; - XSyncIntToValue(&val, moveresize_client->sync_counter_value); - - /* tell the client what we're waiting for */ - ce.xclient.type = ClientMessage; - ce.xclient.message_type = OBT_PROP_ATOM(WM_PROTOCOLS); - ce.xclient.display = obt_display; - ce.xclient.window = moveresize_client->window; - ce.xclient.format = 32; - ce.xclient.data.l[0] = OBT_PROP_ATOM(NET_WM_SYNC_REQUEST); - ce.xclient.data.l[1] = event_curtime; - ce.xclient.data.l[2] = XSyncValueLow32(val); - ce.xclient.data.l[3] = XSyncValueHigh32(val); - ce.xclient.data.l[4] = 0l; - XSendEvent(obt_display, moveresize_client->window, FALSE, - NoEventMask, &ce); - - waiting_for_sync = TRUE; - - obt_main_loop_timeout_remove(ob_main_loop, sync_timeout_func); - obt_main_loop_timeout_add(ob_main_loop, G_USEC_PER_SEC * 2, - sync_timeout_func, - NULL, NULL, NULL); - } - if (config_resize_redraw && extensions_sync && - moveresize_client->sync_request && - moveresize_client->sync_counter && ++ if (config_resize_redraw && obt_display_extension_sync && ++ moveresize_client->sync_request && moveresize_client->sync_counter && + !moveresize_client->not_responding) + { + XEvent ce; + XSyncValue val; + + /* are we already waiting for the sync counter to catch up? */ + if (waiting_for_sync) + return; + + /* increment the value we're waiting for */ + ++moveresize_client->sync_counter_value; + XSyncIntToValue(&val, moveresize_client->sync_counter_value); + + /* tell the client what we're waiting for */ + ce.xclient.type = ClientMessage; - ce.xclient.message_type = prop_atoms.wm_protocols; - ce.xclient.display = ob_display; ++ ce.xclient.message_type = OBT_PROP_ATOM(WM_PROTOCOLS); ++ ce.xclient.display = obt_display; + ce.xclient.window = moveresize_client->window; + ce.xclient.format = 32; - ce.xclient.data.l[0] = prop_atoms.net_wm_sync_request; ++ ce.xclient.data.l[0] = OBT_PROP_ATOM(NET_WM_SYNC_REQUEST); + ce.xclient.data.l[1] = event_curtime; + ce.xclient.data.l[2] = XSyncValueLow32(val); + ce.xclient.data.l[3] = XSyncValueHigh32(val); + ce.xclient.data.l[4] = 0l; - XSendEvent(ob_display, moveresize_client->window, FALSE, ++ XSendEvent(obt_display, moveresize_client->window, FALSE, + NoEventMask, &ce); + + waiting_for_sync = TRUE; + - ob_main_loop_timeout_remove(ob_main_loop, sync_timeout_func); - ob_main_loop_timeout_add(ob_main_loop, G_USEC_PER_SEC * 2, - sync_timeout_func, NULL, NULL, NULL); ++ obt_main_loop_timeout_remove(ob_main_loop, sync_timeout_func); ++ obt_main_loop_timeout_add(ob_main_loop, G_USEC_PER_SEC * 2, ++ sync_timeout_func, ++ NULL, NULL, NULL); + } #endif - client_configure(moveresize_client, cur_x, cur_y, cur_w, cur_h, - TRUE, FALSE, FALSE); + client_configure(moveresize_client, cur_x, cur_y, cur_w, cur_h, - TRUE, FALSE, FALSE); ++ TRUE, FALSE, FALSE); + } /* this would be better with a fixed width font ... XXX can do it better if there are 2 text boxes */