From c1257fb4f9c5a17ee8140c8a49c78604604bccc0 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Tue, 19 Feb 2008 18:44:49 +0100 Subject: MoveResizeTo was broken for opposite edges. --- openbox/actions/moveresizeto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'openbox') diff --git a/openbox/actions/moveresizeto.c b/openbox/actions/moveresizeto.c index 860bf73a..cdd772ad 100644 --- a/openbox/actions/moveresizeto.c +++ b/openbox/actions/moveresizeto.c @@ -143,13 +143,13 @@ static gboolean run_func(ObActionsData *data, gpointer options) x = o->x; if (o->xcenter) x = (area->width - w) / 2; else if (x == G_MININT) x = c->frame->area.x - carea->x; - else if (o->xopposite) x = area->width - w; + else if (o->xopposite) x = area->width - w - x; x += area->x; y = o->y; if (o->ycenter) y = (area->height - h) / 2; else if (y == G_MININT) y = c->frame->area.y - carea->y; - else if (o->yopposite) y = area->height - h; + else if (o->yopposite) y = area->height - h - y; y += area->y; /* get the client's size back */ -- cgit v1.2.3 From 2cb31da22c0a357a2251aabc660e0cc14b215d97 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Thu, 21 Feb 2008 11:57:06 +0100 Subject: Change all single quotes to double quotes in strings. --- openbox/actions.c | 2 +- openbox/actions/execute.c | 6 +++--- openbox/config.c | 2 +- openbox/menu.c | 10 +++++----- openbox/mouse.c | 4 ++-- openbox/openbox.c | 6 +++--- openbox/session.c | 6 +++--- openbox/translate.c | 8 ++++---- 8 files changed, 22 insertions(+), 22 deletions(-) (limited to 'openbox') diff --git a/openbox/actions.c b/openbox/actions.c index 32b3d274..d43896d7 100644 --- a/openbox/actions.c +++ b/openbox/actions.c @@ -147,7 +147,7 @@ static ObActionsAct* actions_build_act_from_string(const gchar *name) actions_definition_ref(act->def); act->options = NULL; } else - g_message(_("Invalid action '%s' requested. No such action exists."), + g_message(_("Invalid action \"%s\" requested. No such action exists."), name); return act; diff --git a/openbox/actions/execute.c b/openbox/actions/execute.c index a857b1b8..24717b56 100644 --- a/openbox/actions/execute.c +++ b/openbox/actions/execute.c @@ -89,7 +89,7 @@ static gboolean run_func(ObActionsData *data, gpointer options) if (!o->cmd) return FALSE; cmd = g_filename_from_utf8(o->cmd, -1, NULL, NULL, NULL); if (!cmd) { - g_message(_("Failed to convert the path '%s' from utf8"), o->cmd); + g_message(_("Failed to convert the path \"%s\" from utf8"), o->cmd); return FALSE; } @@ -98,7 +98,7 @@ static gboolean run_func(ObActionsData *data, gpointer options) event_cancel_all_key_grabs(); if (!g_shell_parse_argv(cmd, NULL, &argv, &e)) { - g_message(_("Failed to execute '%s': %s"), o->cmd, e->message); + g_message(_("Failed to execute \"%s\": %s"), o->cmd, e->message); g_error_free(e); } else { @@ -117,7 +117,7 @@ static gboolean run_func(ObActionsData *data, gpointer options) G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, NULL, NULL, NULL, &e)) { - g_message(_("Failed to execute '%s': %s"), o->cmd, e->message); + g_message(_("Failed to execute \"%s\": %s"), o->cmd, e->message); g_error_free(e); if (o->sn) diff --git a/openbox/config.c b/openbox/config.c index 83d326b5..00efd5ec 100644 --- a/openbox/config.c +++ b/openbox/config.c @@ -778,7 +778,7 @@ static void parse_dock(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node, config_dock_app_move_button = b; config_dock_app_move_modifiers = s; } else { - g_message(_("Invalid button '%s' specified in config file"), str); + g_message(_("Invalid button \"%s\" specified in config file"), str); } g_free(str); } diff --git a/openbox/menu.c b/openbox/menu.c index f2458fa8..0c10b757 100644 --- a/openbox/menu.c +++ b/openbox/menu.c @@ -100,7 +100,7 @@ void menu_startup(gboolean reconfig) parse_tree(menu_parse_inst, doc, node->children); xmlFreeDoc(doc); } else - g_message(_("Unable to find a valid menu file '%s'"), + g_message(_("Unable to find a valid menu file \"%s\""), (const gchar*)it->data); } if (!loaded) { @@ -108,7 +108,7 @@ void menu_startup(gboolean reconfig) parse_tree(menu_parse_inst, doc, node->children); xmlFreeDoc(doc); } else - g_message(_("Unable to find a valid menu file '%s'"), + g_message(_("Unable to find a valid menu file \"%s\""), "menu.xml"); } @@ -168,7 +168,7 @@ void menu_pipe_execute(ObMenu *self) return; if (!g_spawn_command_line_sync(self->execute, &output, NULL, NULL, &err)) { - g_message(_("Failed to execute command for pipe-menu '%s': %s"), + g_message(_("Failed to execute command for pipe-menu \"%s\": %s"), self->execute, err->message); g_error_free(err); return; @@ -182,7 +182,7 @@ void menu_pipe_execute(ObMenu *self) parse_tree(menu_parse_inst, doc, node->children); xmlFreeDoc(doc); } else { - g_message(_("Invalid output from pipe-menu '%s'"), self->execute); + g_message(_("Invalid output from pipe-menu \"%s\""), self->execute); } g_free(output); @@ -195,7 +195,7 @@ static ObMenu* menu_from_name(gchar *name) g_assert(name != NULL); if (!(self = g_hash_table_lookup(menu_hash, name))) - g_message(_("Attempted to access menu '%s' but it does not exist"), + g_message(_("Attempted to access menu \"%s\" but it does not exist"), name); return self; } diff --git a/openbox/mouse.c b/openbox/mouse.c index f2e13cdf..857f6d09 100644 --- a/openbox/mouse.c +++ b/openbox/mouse.c @@ -376,13 +376,13 @@ gboolean mouse_bind(const gchar *buttonstr, const gchar *contextstr, GSList *it; if (!translate_button(buttonstr, &state, &button)) { - g_message(_("Invalid button '%s' in mouse binding"), buttonstr); + g_message(_("Invalid button \"%s\" in mouse binding"), buttonstr); return FALSE; } context = frame_context_from_string(contextstr); if (!context) { - g_message(_("Invalid context '%s' in mouse binding"), contextstr); + g_message(_("Invalid context \"%s\" in mouse binding"), contextstr); return FALSE; } diff --git a/openbox/openbox.c b/openbox/openbox.c index 46da8fee..6233ec98 100644 --- a/openbox/openbox.c +++ b/openbox/openbox.c @@ -131,7 +131,7 @@ gint main(gint argc, gchar **argv) textdomain(PACKAGE_NAME); if (chdir(g_get_home_dir()) == -1) - g_message(_("Unable to change to home directory '%s': %s"), + g_message(_("Unable to change to home directory \"%s\": %s"), g_get_home_dir(), g_strerror(errno)); /* parse the command line args, which can change the argv[0] */ @@ -425,7 +425,7 @@ gint main(gint argc, gchar **argv) g_strfreev(argvp); } else { g_message( - _("Restart failed to execute new executable '%s': %s"), + _("Restart failed to execute new executable \"%s\": %s"), restart_path, err->message); g_error_free(err); } @@ -634,7 +634,7 @@ static void parse_args(gint *argc, gchar **argv) else { /* this is a memleak.. oh well.. heh */ gchar *err = g_strdup_printf - (_("Invalid command line argument '%s'\n"), argv[i]); + (_("Invalid command line argument \"%s\"\n"), argv[i]); ob_exit_with_error(err); } } diff --git a/openbox/session.c b/openbox/session.c index 96d7563f..0f74ec28 100644 --- a/openbox/session.c +++ b/openbox/session.c @@ -100,7 +100,7 @@ void session_startup(gint argc, gchar **argv) dir = g_build_filename(parse_xdg_data_home_path(), "openbox", "sessions", NULL); if (!parse_mkdir_path(dir, 0700)) { - g_message(_("Unable to make directory '%s': %s"), + g_message(_("Unable to make directory \"%s\": %s"), dir, g_strerror(errno)); } @@ -448,7 +448,7 @@ static gboolean session_save_to_file(const ObSMSaveData *savedata) f = fopen(ob_sm_save_file, "w"); if (!f) { success = FALSE; - g_message(_("Unable to save the session to '%s': %s"), + g_message(_("Unable to save the session to \"%s\": %s"), ob_sm_save_file, g_strerror(errno)); } else { fprintf(f, "\n\n"); @@ -580,7 +580,7 @@ static gboolean session_save_to_file(const ObSMSaveData *savedata) if (fflush(f)) { success = FALSE; - g_message(_("Error while saving the session to '%s': %s"), + g_message(_("Error while saving the session to \"%s\": %s"), ob_sm_save_file, g_strerror(errno)); } fclose(f); diff --git a/openbox/translate.c b/openbox/translate.c index c697679d..bd8b88f6 100644 --- a/openbox/translate.c +++ b/openbox/translate.c @@ -56,7 +56,7 @@ static guint translate_modifier(gchar *str) !g_ascii_strcasecmp("H", str)) mask = modkeys_key_to_mask(OB_MODKEY_KEY_HYPER); else - g_message(_("Invalid modifier key '%s' in key/mouse binding"), str); + g_message(_("Invalid modifier key \"%s\" in key/mouse binding"), str); return mask; } @@ -135,20 +135,20 @@ gboolean translate_key(const gchar *str, guint *state, guint *keycode) /* take it directly */ *keycode = strtol(l, &end, 16); if (*l == '\0' || *end != '\0') { - g_message(_("Invalid key code '%s' in key binding"), l); + g_message(_("Invalid key code \"%s\" in key binding"), l); goto translation_fail; } } else { /* figure out the keycode */ sym = XStringToKeysym(l); if (sym == NoSymbol) { - g_message(_("Invalid key name '%s' in key binding"), l); + g_message(_("Invalid key name \"%s\" in key binding"), l); goto translation_fail; } *keycode = XKeysymToKeycode(ob_display, sym); } if (!*keycode) { - g_message(_("Requested key '%s' does not exist on the display"), l); + g_message(_("Requested key \"%s\" does not exist on the display"), l); goto translation_fail; } -- cgit v1.2.3 From c49c2a8e408f7482f2b977d6cf97517684476ed7 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 21 Feb 2008 13:00:11 -0500 Subject: If multiple key bindings at the same level are not able to be translated, then don't have them conflict and end up removing untranslated bindings from the key tree. This way they can be re-translated later. This fixes keybindings getting lost when VMWare grabs the keyboard/pointer --- openbox/keytree.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'openbox') diff --git a/openbox/keytree.c b/openbox/keytree.c index 56cc96d4..ca64385a 100644 --- a/openbox/keytree.c +++ b/openbox/keytree.c @@ -81,7 +81,8 @@ void tree_assimilate(KeyBindingTree *node) b = node; while (a) { last = a; - if (!(a->state == b->state && a->key == b->key)) { + /* check b->key != 0 for key bindings that didn't get translated */ + if (!(a->state == b->state && a->key == b->key && b->key != 0)) { a = a->next_sibling; } else { tmp = b; @@ -90,7 +91,9 @@ void tree_assimilate(KeyBindingTree *node) a = a->first_child; } } - if (!(last->state == b->state && last->key == b->key)) { + /* check b->key != 0, and save key bindings that didn't get translated + as siblings here */ + if (!(last->state == b->state && last->key == b->key && b->key != 0)) { last->next_sibling = b; b->parent = last->parent; } else { @@ -110,7 +113,10 @@ KeyBindingTree *tree_find(KeyBindingTree *search, gboolean *conflict) a = keyboard_firstnode; b = search; while (a && b) { - if (!(a->state == b->state && a->key == b->key)) { + /* check b->key != 0 for key bindings that didn't get translated, and + don't make them conflict with anything else so that they can all + live together in peace and harmony */ + if (!(a->state == b->state && a->key == b->key && b->key != 0)) { a = a->next_sibling; } else { if ((a->first_child == NULL) == (b->first_child == NULL)) { -- cgit v1.2.3