summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2008-02-21 13:24:19 -0500
committerDana Jansens <danakj@orodu.net>2008-02-21 13:24:19 -0500
commit198d98986bdf224ed29361541d19841339953088 (patch)
treee0a588f29ce1f1c3102da4daf05316a15e9a6cea /openbox
parent3263845459d15da683b7cab92fb856acbdf2800e (diff)
parentc49c2a8e408f7482f2b977d6cf97517684476ed7 (diff)
Merge branch 'backport' into work
Conflicts: openbox/openbox.c openbox/session.c
Diffstat (limited to 'openbox')
-rw-r--r--openbox/actions.c2
-rw-r--r--openbox/actions/execute.c6
-rw-r--r--openbox/actions/moveresizeto.c4
-rw-r--r--openbox/config.c2
-rw-r--r--openbox/keytree.c12
-rw-r--r--openbox/menu.c10
-rw-r--r--openbox/mouse.c4
-rw-r--r--openbox/openbox.c8
-rw-r--r--openbox/session.c6
-rw-r--r--openbox/translate.c8
10 files changed, 36 insertions, 26 deletions
diff --git a/openbox/actions.c b/openbox/actions.c
index 5bd70139..8f72714e 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 c534ba8b..ff73bf2b 100644
--- a/openbox/actions/execute.c
+++ b/openbox/actions/execute.c
@@ -86,7 +86,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;
}
@@ -95,7 +95,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 {
@@ -114,7 +114,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/actions/moveresizeto.c b/openbox/actions/moveresizeto.c
index d355dafd..357c7315 100644
--- a/openbox/actions/moveresizeto.c
+++ b/openbox/actions/moveresizeto.c
@@ -131,13 +131,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 */
diff --git a/openbox/config.c b/openbox/config.c
index 0696806b..109b2150 100644
--- a/openbox/config.c
+++ b/openbox/config.c
@@ -764,7 +764,7 @@ static void parse_dock(xmlNodePtr node, gpointer d)
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/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)) {
diff --git a/openbox/menu.c b/openbox/menu.c
index 63b74b95..432aa2be 100644
--- a/openbox/menu.c
+++ b/openbox/menu.c
@@ -98,7 +98,7 @@ void menu_startup(gboolean reconfig)
obt_parse_tree_from_root(menu_parse_inst);
obt_parse_close(menu_parse_inst);
} 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) {
@@ -110,7 +110,7 @@ void menu_startup(gboolean reconfig)
obt_parse_tree_from_root(menu_parse_inst);
obt_parse_close(menu_parse_inst);
} 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)
obt_parse_tree_from_root(menu_parse_inst);
obt_parse_close(menu_parse_inst);
} 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 0233ac38..b5d97336 100644
--- a/openbox/mouse.c
+++ b/openbox/mouse.c
@@ -375,13 +375,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 012666dc..291b694b 100644
--- a/openbox/openbox.c
+++ b/openbox/openbox.c
@@ -128,6 +128,10 @@ gint main(gint argc, gchar **argv)
bind_textdomain_codeset(PACKAGE_NAME, "UTF-8");
textdomain(PACKAGE_NAME);
+ if (chdir(g_get_home_dir()) == -1)
+ 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] */
parse_args(&argc, argv);
/* parse the environment variables */
@@ -398,7 +402,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);
}
@@ -613,7 +617,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 3822d414..99d66221 100644
--- a/openbox/session.c
+++ b/openbox/session.c
@@ -104,7 +104,7 @@ void session_startup(gint argc, gchar **argv)
obt_paths_unref(p), p = NULL;
if (!obt_paths_mkdir_path(dir, 0700)) {
- g_message(_("Unable to make directory '%s': %s"),
+ g_message(_("Unable to make directory \"%s\": %s"),
dir, g_strerror(errno));
}
@@ -452,7 +452,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, "<?xml version=\"1.0\"?>\n\n");
@@ -584,7 +584,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 7e89e32c..50d50008 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 = obt_keyboard_modkey_to_modmask(OBT_KEYBOARD_MODKEY_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(obt_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;
}