summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2008-02-07 02:06:42 -0500
committerDana Jansens <danakj@orodu.net>2008-02-07 02:06:42 -0500
commit5f04ca85ef6a2ebc2d66842e261a676691e9b4de (patch)
tree5d28851a47a36a7130426644573f0fe1b1a6b5e8 /openbox
parent4435c3a438f092252f563d5fd97dffd440a164db (diff)
parent307befd333dd89a990e541c37c8c3717e125dcdf (diff)
Merge branch 'backport' into work
Conflicts: openbox/config.c
Diffstat (limited to 'openbox')
-rw-r--r--openbox/client.h4
-rw-r--r--openbox/client_list_combined_menu.c10
-rw-r--r--openbox/client_list_menu.c10
-rw-r--r--openbox/config.c7
-rw-r--r--openbox/config.h5
-rw-r--r--openbox/event.c22
-rw-r--r--openbox/focus.c8
-rw-r--r--openbox/menuframe.c5
-rw-r--r--openbox/openbox.c1
-rw-r--r--openbox/place.c5
-rw-r--r--openbox/stacking.c9
11 files changed, 61 insertions, 25 deletions
diff --git a/openbox/client.h b/openbox/client.h
index a27d37c6..3f92a4e7 100644
--- a/openbox/client.h
+++ b/openbox/client.h
@@ -688,7 +688,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
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 eaaab536..a268eb5b 100644
--- a/openbox/config.c
+++ b/openbox/config.c
@@ -88,6 +88,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;
@@ -136,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;
}
@@ -241,6 +243,8 @@ static void parse_per_app_settings(xmlNodePtr node, gpointer d)
settings->monitor = obt_parse_node_int(c) + 1;
g_free(s);
}
+
+ obt_parse_attr_bool(n, "force", &settings->pos_force);
}
if ((n = obt_parse_find_node(app->children, "focus")))
@@ -759,6 +763,8 @@ static void parse_menu(xmlNodePtr node, gpointer d)
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);
}
}
@@ -949,6 +955,7 @@ void config_startup(ObtParseInst *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;
obt_parse_register(i, "menu", parse_menu, NULL);
diff --git a/openbox/config.h b/openbox/config.h
index 1a60ee0f..cf9eb43e 100644
--- a/openbox/config.h
+++ b/openbox/config.h
@@ -40,6 +40,7 @@ struct _ObAppSettings
GravityPoint position;
gboolean pos_given;
+ gboolean pos_force;
guint desktop;
gint shade;
@@ -175,8 +176,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 */
diff --git a/openbox/event.c b/openbox/event.c
index bce1de12..73797496 100644
--- a/openbox/event.c
+++ b/openbox/event.c
@@ -89,7 +89,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);
@@ -800,6 +800,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;
@@ -1044,8 +1050,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 "
@@ -1967,26 +1972,21 @@ void event_end_ignore_all_enters(gulong start)
event_ignore_enter_range(start, NextRequest(obt_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;
diff --git a/openbox/focus.c b/openbox/focus.c
index 68b0b7f9..cff81bfb 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/menuframe.c b/openbox/menuframe.c
index b48b9280..598bc005 100644
--- a/openbox/menuframe.c
+++ b/openbox/menuframe.c
@@ -386,8 +386,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;
diff --git a/openbox/openbox.c b/openbox/openbox.c
index 80f81594..014199dc 100644
--- a/openbox/openbox.c
+++ b/openbox/openbox.c
@@ -558,7 +558,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
diff --git a/openbox/place.c b/openbox/place.c
index 9e38bdef..aac40e8a 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;
diff --git a/openbox/stacking.c b/openbox/stacking.c
index 03a62dd4..3c05df49 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);