From d63d03a84e6d0d916c76fc78ea1b7f1e8608ffc4 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 2 Feb 2008 14:29:08 -0500 Subject: erroneous comment --- openbox/openbox.c | 1 - 1 file changed, 1 deletion(-) (limited to 'openbox') diff --git a/openbox/openbox.c b/openbox/openbox.c index 7d7e0d0d..12106f6b 100644 --- a/openbox/openbox.c +++ b/openbox/openbox.c @@ -579,7 +579,6 @@ static void parse_args(gint *argc, gchar **argv) } else if (!strcmp(argv[i], "--config-file")) { if (i == *argc - 1) /* no args left */ - /* not translated cuz it's sekret */ g_printerr(_("--config-file requires an argument\n")); else { /* this will be in the current locale encoding, which is -- cgit v1.2.3 From 58b3ec41b9a34a81e44855bd7e061a72d8d81a97 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 2 Feb 2008 22:07:21 -0500 Subject: improve comment --- openbox/client.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'openbox') diff --git a/openbox/client.h b/openbox/client.h index 84da49a3..83fdc9af 100644 --- a/openbox/client.h +++ b/openbox/client.h @@ -691,7 +691,9 @@ ObClient *client_direct_parent(ObClient *self); */ ObClient *client_search_top_direct_parent(ObClient *self); -/*! Is one client a direct child of another (i.e. not through the group.) */ +/*! Is one client a direct child of another (i.e. not through the group.) + This checks more than one level, so there may be another direct child in + between */ gboolean client_is_direct_child(ObClient *parent, ObClient *child); /*! Search for a parent of a client. This only searches up *ONE LEVEL*, and -- cgit v1.2.3 From 751f85003f080d79baa2d4b3b989b12a0ee9d469 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 2 Feb 2008 22:09:52 -0500 Subject: unused variable --- openbox/keyboard.c | 1 - 1 file changed, 1 deletion(-) (limited to 'openbox') diff --git a/openbox/keyboard.c b/openbox/keyboard.c index 82d6dfdc..c23d83e6 100644 --- a/openbox/keyboard.c +++ b/openbox/keyboard.c @@ -279,7 +279,6 @@ static void node_rebind(KeyBindingTree *node) } else { /* for leaf nodes, rebind each action assigned to it */ - GSList *it; while (node->actions) { /* add each action, and remove them from the original tree so they don't get free'd on us */ -- cgit v1.2.3 From a19f2f8bc9964b89a500a2c5aac0b8d3a3dc2ff4 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 2 Feb 2008 22:17:32 -0500 Subject: when focusing or raising a window which is modal child for a direct parent, raise its parent and move it to the top of the stacking order too, ie. treat them like one window (this is already done elsewhere, like when moving between desktops for example) --- openbox/focus.c | 8 ++++++++ openbox/stacking.c | 9 +++++++++ 2 files changed, 17 insertions(+) (limited to 'openbox') diff --git a/openbox/focus.c b/openbox/focus.c index a4eb2cfa..c2d7e11e 100644 --- a/openbox/focus.c +++ b/openbox/focus.c @@ -57,6 +57,14 @@ void focus_shutdown(gboolean reconfig) static void push_to_top(ObClient *client) { + ObClient *p; + + /* if it is modal for a single window, then put that window at the top + of the focus order first, so it will be right after ours. the same is + done with stacking */ + if (client->modal && (p = client_direct_parent(client))) + push_to_top(p); + focus_order = g_list_remove(focus_order, client); focus_order = g_list_prepend(focus_order, client); } diff --git a/openbox/stacking.c b/openbox/stacking.c index 92a5285d..4c24e3e8 100644 --- a/openbox/stacking.c +++ b/openbox/stacking.c @@ -221,6 +221,15 @@ static void restack_windows(ObClient *selected, gboolean raise) GList *modals = NULL; GList *trans = NULL; + if (raise) { + ObClient *p; + + /* if a window is modal for another single window, then raise it to the + top too, the same is done with the focus order */ + while (selected->modal && (p = client_direct_parent(selected))) + selected = p; + } + /* remove first so we can't run into ourself */ it = g_list_find(stacking_list, selected); g_assert(it); -- cgit v1.2.3 From deb0aa720a4feda3b52c17e16ed7324c61dc331a Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 2 Feb 2008 16:50:55 -0500 Subject: allow you to force the position of windows with rc.xml's per-app settings with the force="yes" attribute --- openbox/config.c | 3 +++ openbox/config.h | 1 + openbox/place.c | 5 +++-- 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'openbox') diff --git a/openbox/config.c b/openbox/config.c index 69904d85..99aa57f4 100644 --- a/openbox/config.c +++ b/openbox/config.c @@ -137,6 +137,7 @@ void config_app_settings_copy_non_defaults(const ObAppSettings *src, if (src->pos_given) { dst->pos_given = TRUE; + dst->pos_force = src->pos_force; dst->position = src->position; dst->monitor = src->monitor; } @@ -246,6 +247,8 @@ static void parse_per_app_settings(ObParseInst *inst, xmlDocPtr doc, settings->monitor = parse_int(doc, c) + 1; g_free(s); } + + parse_attr_bool("force", n, &settings->pos_force); } if ((n = parse_find_node("focus", app->children))) diff --git a/openbox/config.h b/openbox/config.h index 75275a8b..23011a15 100644 --- a/openbox/config.h +++ b/openbox/config.h @@ -41,6 +41,7 @@ struct _ObAppSettings GravityPoint position; gboolean pos_given; + gboolean pos_force; guint desktop; gint shade; diff --git a/openbox/place.c b/openbox/place.c index 81fb9752..45d7f07f 100644 --- a/openbox/place.c +++ b/openbox/place.c @@ -489,8 +489,9 @@ gboolean place_client(ObClient *client, gint *x, gint *y, gboolean userplaced = FALSE; /* per-app settings override program specified position - * but not user specified */ - if ((client->positioned & USPosition) || + * but not user specified, unless pos_force is enabled */ + if (((client->positioned & USPosition) && + !(settings && settings->pos_given && settings->pos_force)) || ((client->positioned & PPosition) && !(settings && settings->pos_given))) return FALSE; -- cgit v1.2.3 From 4d5dd00229c3cfcacfc98b4194702d513283edf1 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 3 Feb 2008 09:29:05 -0500 Subject: ignore fake generated enters if they are in the serial-ignore-range too --- openbox/event.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'openbox') diff --git a/openbox/event.c b/openbox/event.c index caf6f5af..7e2766f0 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -92,7 +92,7 @@ static void event_handle_dock(ObDock *s, XEvent *e); static void event_handle_dockapp(ObDockApp *app, XEvent *e); static void event_handle_client(ObClient *c, XEvent *e); static void event_handle_user_input(ObClient *client, XEvent *e); -static gboolean is_enter_focus_event_ignored(XEvent *e); +static gboolean is_enter_focus_event_ignored(gulong serial); static void event_ignore_enter_range(gulong start, gulong end); static void focus_delay_dest(gpointer data); @@ -795,6 +795,12 @@ void event_enter_client(ObClient *client) { g_assert(config_focus_follow); + if (is_enter_focus_event_ignored(event_curserial)) { + ob_debug_type(OB_DEBUG_FOCUS, "Ignoring enter event with serial %lu\n" + "on client 0x%x", event_curserial, client->window); + return; + } + if (client_enter_focusable(client) && client_can_focus(client)) { if (config_focus_delay) { ObFocusDelayData *data; @@ -1039,8 +1045,7 @@ static void event_handle_client(ObClient *client, XEvent *e) if (e->xcrossing.mode == NotifyGrab || e->xcrossing.mode == NotifyUngrab || /*ignore enters when we're already in the window */ - e->xcrossing.detail == NotifyInferior || - is_enter_focus_event_ignored(e)) + e->xcrossing.detail == NotifyInferior) { ob_debug_type(OB_DEBUG_FOCUS, "%sNotify mode %d detail %d serial %lu on %lx " @@ -1959,26 +1964,21 @@ void event_end_ignore_all_enters(gulong start) event_ignore_enter_range(start, NextRequest(ob_display)-1); } -static gboolean is_enter_focus_event_ignored(XEvent *e) +static gboolean is_enter_focus_event_ignored(gulong serial) { GSList *it, *next; - g_assert(e->type == EnterNotify && - !(e->xcrossing.mode == NotifyGrab || - e->xcrossing.mode == NotifyUngrab || - e->xcrossing.detail == NotifyInferior)); - for (it = ignore_serials; it; it = next) { ObSerialRange *r = it->data; next = g_slist_next(it); - if ((glong)(e->xany.serial - r->end) > 0) { + if ((glong)(serial - r->end) > 0) { /* past the end */ ignore_serials = g_slist_delete_link(ignore_serials, it); g_free(r); } - else if ((glong)(e->xany.serial - r->start) >= 0) + else if ((glong)(serial - r->start) >= 0) return TRUE; } return FALSE; -- cgit v1.2.3 From 6b04ac47e2306b7b37a2f52753a94a7b87515f7a Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 3 Feb 2008 18:45:40 -0500 Subject: make the menu headers show their correct text --- openbox/menuframe.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'openbox') diff --git a/openbox/menuframe.c b/openbox/menuframe.c index 5ffaaf2f..fb9b6c5b 100644 --- a/openbox/menuframe.c +++ b/openbox/menuframe.c @@ -381,8 +381,11 @@ static void menu_entry_frame_render(ObMenuEntryFrame *self) text_a->texture[0].data.text.shortcut = FALSE; break; case OB_MENU_ENTRY_TYPE_SEPARATOR: - if (self->entry->data.separator.label != NULL) + if (self->entry->data.separator.label != NULL) { text_a = ob_rr_theme->a_menu_text_title; + text_a->texture[0].data.text.string = + self->entry->data.separator.label; + } else text_a = ob_rr_theme->a_menu_text_normal; break; -- cgit v1.2.3 From 12ca673de556b341588a7f67fb2b9417c1e91d6b Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sun, 3 Feb 2008 16:53:33 +0100 Subject: Add the manageDesktops option. --- openbox/client_list_combined_menu.c | 10 ++++++---- openbox/client_list_menu.c | 10 ++++++---- openbox/config.c | 4 ++++ openbox/config.h | 4 +++- 4 files changed, 19 insertions(+), 9 deletions(-) (limited to 'openbox') diff --git a/openbox/client_list_combined_menu.c b/openbox/client_list_combined_menu.c index c1572eaf..76a819fc 100644 --- a/openbox/client_list_combined_menu.c +++ b/openbox/client_list_combined_menu.c @@ -94,10 +94,12 @@ static gboolean self_update(ObMenuFrame *frame, gpointer data) } } - menu_add_separator(menu, SEPARATOR, _("Manage desktops")); - menu_add_normal(menu, ADD_DESKTOP, _("_Add new desktop"), NULL, TRUE); - menu_add_normal(menu, REMOVE_DESKTOP, _("_Remove last desktop"), - NULL, TRUE); + if (config_menu_manage_desktops) { + menu_add_separator(menu, SEPARATOR, _("Manage desktops")); + menu_add_normal(menu, ADD_DESKTOP, _("_Add new desktop"), NULL, TRUE); + menu_add_normal(menu, REMOVE_DESKTOP, _("_Remove last desktop"), + NULL, TRUE); + } return TRUE; /* always show the menu */ } diff --git a/openbox/client_list_menu.c b/openbox/client_list_menu.c index 0febe2e6..e6521a0a 100644 --- a/openbox/client_list_menu.c +++ b/openbox/client_list_menu.c @@ -153,10 +153,12 @@ static gboolean self_update(ObMenuFrame *frame, gpointer data) desktop_menus = g_slist_append(desktop_menus, submenu); } - menu_add_separator(menu, SEPARATOR, NULL); - menu_add_normal(menu, ADD_DESKTOP, _("_Add new desktop"), NULL, TRUE); - menu_add_normal(menu, REMOVE_DESKTOP, _("_Remove last desktop"), - NULL, TRUE); + if (config_menu_manage_desktops) { + menu_add_separator(menu, SEPARATOR, NULL); + menu_add_normal(menu, ADD_DESKTOP, _("_Add new desktop"), NULL, TRUE); + menu_add_normal(menu, REMOVE_DESKTOP, _("_Remove last desktop"), + NULL, TRUE); + } return TRUE; /* always show */ } diff --git a/openbox/config.c b/openbox/config.c index 99aa57f4..673af4bd 100644 --- a/openbox/config.c +++ b/openbox/config.c @@ -89,6 +89,7 @@ guint config_menu_hide_delay; gboolean config_menu_middle; guint config_submenu_show_delay; gboolean config_menu_client_list_icons; +gboolean config_menu_manage_desktops; GSList *config_menu_files; @@ -777,6 +778,8 @@ static void parse_menu(ObParseInst *i, xmlDocPtr doc, xmlNodePtr 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); } } @@ -968,6 +971,7 @@ void config_startup(ObParseInst *i) config_menu_middle = FALSE; config_submenu_show_delay = 0; config_menu_client_list_icons = TRUE; + config_menu_manage_desktops = TRUE; config_menu_files = NULL; parse_register(i, "menu", parse_menu, NULL); diff --git a/openbox/config.h b/openbox/config.h index 23011a15..3fd1b879 100644 --- a/openbox/config.h +++ b/openbox/config.h @@ -177,8 +177,10 @@ extern guint config_menu_hide_delay; extern gboolean config_menu_middle; /*! Delay before opening a submenu in milliseconds */ extern guint config_submenu_show_delay; -/*! show icons in client_list_menu */ +/*! Show icons in client_list_menu */ extern gboolean config_menu_client_list_icons; +/*! Show manage desktops in client_list_menu */ +extern gboolean config_menu_manage_desktops; /*! User-specified menu files */ extern GSList *config_menu_files; /*! Per app settings */ -- cgit v1.2.3 From 265bdd46605367e1cb35dcd9d8ff2c98fae70166 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Fri, 1 Feb 2008 01:56:37 -0500 Subject: don't crash when using and alt-tab and there are no windows to cycle between --- openbox/actions/cyclewindows.c | 2 +- openbox/actions/directionalwindows.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'openbox') diff --git a/openbox/actions/cyclewindows.c b/openbox/actions/cyclewindows.c index 059db93f..cb341af7 100644 --- a/openbox/actions/cyclewindows.c +++ b/openbox/actions/cyclewindows.c @@ -134,7 +134,7 @@ static gboolean run_func(ObActionsData *data, gpointer options) cycling = TRUE; stacking_restore(); - if (o->raise) stacking_temp_raise(CLIENT_AS_WINDOW(ft)); + if (o->raise && ft) stacking_temp_raise(CLIENT_AS_WINDOW(ft)); return TRUE; } diff --git a/openbox/actions/directionalwindows.c b/openbox/actions/directionalwindows.c index c575d84e..55c9e606 100644 --- a/openbox/actions/directionalwindows.c +++ b/openbox/actions/directionalwindows.c @@ -156,7 +156,7 @@ static gboolean run_func(ObActionsData *data, gpointer options) cycling = TRUE; stacking_restore(); - if (o->raise) stacking_temp_raise(CLIENT_AS_WINDOW(ft)); + if (o->raise && ft) stacking_temp_raise(CLIENT_AS_WINDOW(ft)); } return o->interactive; -- cgit v1.2.3