diff options
Diffstat (limited to 'openbox')
| -rw-r--r-- | openbox/actions.c | 8 | ||||
| -rw-r--r-- | openbox/client.c | 6 | ||||
| -rw-r--r-- | openbox/config.c | 33 | ||||
| -rw-r--r-- | openbox/config.h | 2 | ||||
| -rw-r--r-- | openbox/event.c | 2 | ||||
| -rw-r--r-- | openbox/geom.h | 2 | ||||
| -rw-r--r-- | openbox/menuframe.c | 11 | ||||
| -rw-r--r-- | openbox/mouse.c | 2 |
8 files changed, 52 insertions, 14 deletions
diff --git a/openbox/actions.c b/openbox/actions.c index 11581af6..5bd70139 100644 --- a/openbox/actions.c +++ b/openbox/actions.c @@ -345,8 +345,14 @@ void actions_client_move(ObActionsData *data, gboolean start) that moves windows our from under the cursor, the enter event will come as a GrabNotify which is ignored, so this makes a fake enter event + + don't do this if there is a grab on the pointer. enter events + are ignored during a grab, so don't force fake ones when they + should be ignored */ - if ((c = client_under_pointer()) && c != data->client) { + if ((c = client_under_pointer()) && c != data->client && + !grab_on_pointer()) + { ob_debug_type(OB_DEBUG_FOCUS, "Generating fake enter because we did a " "mouse-event action"); diff --git a/openbox/client.c b/openbox/client.c index c7a82d16..946e80d3 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -779,13 +779,15 @@ static ObAppSettings *client_get_settings_state(ObClient *self) !g_pattern_match(app->name, strlen(self->name), self->name, NULL)) match = FALSE; else if (app->class && - !g_pattern_match(app->class, - strlen(self->class), self->class, NULL)) + !g_pattern_match(app->class, + strlen(self->class), self->class, NULL)) match = FALSE; else if (app->role && !g_pattern_match(app->role, strlen(self->role), self->role, NULL)) match = FALSE; + else if ((signed)app->type >= 0 && app->type != self->type) + match = FALSE; if (match) { ob_debug("Window matching: %s", app->name); diff --git a/openbox/config.c b/openbox/config.c index a268eb5b..b5b4ef4e 100644 --- a/openbox/config.c +++ b/openbox/config.c @@ -100,6 +100,7 @@ GSList *config_per_app_settings; ObAppSettings* config_create_app_settings(void) { ObAppSettings *settings = g_new0(ObAppSettings, 1); + settings->type = -1; settings->decor = -1; settings->shade = -1; settings->monitor = -1; @@ -123,6 +124,7 @@ void config_app_settings_copy_non_defaults(const ObAppSettings *src, g_assert(src != NULL); g_assert(dst != NULL); + copy_if(type, -1); copy_if(decor, -1); copy_if(shade, -1); copy_if(focus, -1); @@ -190,15 +192,16 @@ static void config_parse_gravity_coord(xmlNodePtr node, GravityCoord *c) static void parse_per_app_settings(xmlNodePtr node, gpointer d) { xmlNodePtr app = obt_parse_find_node(node->children, "application"); - gchar *name = NULL, *class = NULL, *role = NULL; - gboolean name_set, class_set; + gchar *name = NULL, *class = NULL, *role = NULL, *type = NULL; + gboolean name_set, class_set, type_set; gboolean x_pos_given; while (app) { - name_set = class_set = x_pos_given = FALSE; + name_set = class_set = type_set = x_pos_given = FALSE; class_set = obt_parse_attr_string(app, "class", &class); name_set = obt_parse_attr_string(app, "name", &name); + type_set = obt_parse_attr_string(app, "type", &type); if (class_set || name_set) { xmlNodePtr n, c; ObAppSettings *settings = config_create_app_settings();; @@ -209,6 +212,25 @@ static void parse_per_app_settings(xmlNodePtr node, gpointer d) if (class_set) settings->class = g_pattern_spec_new(class); + if (type_set) { + if (!g_ascii_strcasecmp(type, "normal")) + settings->type = OB_CLIENT_TYPE_NORMAL; + else if (!g_ascii_strcasecmp(type, "dialog")) + settings->type = OB_CLIENT_TYPE_DIALOG; + else if (!g_ascii_strcasecmp(type, "splash")) + settings->type = OB_CLIENT_TYPE_SPLASH; + else if (!g_ascii_strcasecmp(type, "utility")) + settings->type = OB_CLIENT_TYPE_UTILITY; + else if (!g_ascii_strcasecmp(type, "menu")) + settings->type = OB_CLIENT_TYPE_MENU; + else if (!g_ascii_strcasecmp(type, "toolbar")) + settings->type = OB_CLIENT_TYPE_TOOLBAR; + else if (!g_ascii_strcasecmp(type, "dock")) + settings->type = OB_CLIENT_TYPE_DOCK; + else if (!g_ascii_strcasecmp(type, "desktop")) + settings->type = OB_CLIENT_TYPE_DESKTOP; + } + if (obt_parse_attr_string(app, "role", &role)) settings->role = g_pattern_spec_new(role); @@ -662,6 +684,11 @@ static void parse_resize(xmlNodePtr node, gpointer d) if ((n2 = obt_parse_find_node(n->children, "y"))) config_parse_gravity_coord(n2, &config_resize_popup_fixed.y); + + config_resize_popup_fixed.x.pos = + MAX(config_resize_popup_fixed.x.pos, 0); + config_resize_popup_fixed.y.pos = + MAX(config_resize_popup_fixed.y.pos, 0); } } } diff --git a/openbox/config.h b/openbox/config.h index cf9eb43e..1f4ae326 100644 --- a/openbox/config.h +++ b/openbox/config.h @@ -23,6 +23,7 @@ #include "misc.h" #include "stacking.h" #include "place.h" +#include "client.h" #include "geom.h" #include "moveresize.h" #include "render/render.h" @@ -37,6 +38,7 @@ struct _ObAppSettings GPatternSpec *class; GPatternSpec *name; GPatternSpec *role; + ObClientType type; GravityPoint position; gboolean pos_given; diff --git a/openbox/event.c b/openbox/event.c index cedac2e3..9502edf5 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -1369,7 +1369,7 @@ static void event_handle_client(ObClient *client, XEvent *e) ob_debug_type(OB_DEBUG_APP_BUGS, "_NET_ACTIVE_WINDOW message for window %s is " "missing source indication"); - client_activate(client, FALSE, TRUE, TRUE, + client_activate(client, TRUE, TRUE, TRUE, (e->xclient.data.l[0] == 0 || e->xclient.data.l[0] == 2)); } else if (msgtype == OBT_PROP_ATOM(NET_WM_MOVERESIZE)) { diff --git a/openbox/geom.h b/openbox/geom.h index bdcd3c55..7c5ee32e 100644 --- a/openbox/geom.h +++ b/openbox/geom.h @@ -23,7 +23,7 @@ #include <glib.h> typedef struct _GravityCoord { - int pos; + gint pos; gboolean center; gboolean opposite; } GravityCoord; diff --git a/openbox/menuframe.c b/openbox/menuframe.c index c25e485f..730f23f7 100644 --- a/openbox/menuframe.c +++ b/openbox/menuframe.c @@ -254,23 +254,24 @@ static void menu_frame_place_topmenu(ObMenuFrame *self, gint *x, gint *y) static void menu_frame_place_submenu(ObMenuFrame *self, gint *x, gint *y) { - gint overlap; + gint overlapx, overlapy; gint bwidth; - overlap = ob_rr_theme->menu_overlap; + overlapx = ob_rr_theme->menu_overlap_x; + overlapy = ob_rr_theme->menu_overlap_y; bwidth = ob_rr_theme->mbwidth; if (self->direction_right) *x = self->parent->area.x + self->parent->area.width - - overlap - bwidth; + overlapx - bwidth; else - *x = self->parent->area.x - self->area.width + overlap + bwidth; + *x = self->parent->area.x - self->area.width + overlapx + bwidth; *y = self->parent->area.y + self->parent_entry->area.y; if (config_menu_middle) *y -= (self->area.height - (bwidth * 2) - ITEM_HEIGHT) / 2; else - *y += overlap; + *y += overlapy; } void menu_frame_move_on_screen(ObMenuFrame *self, gint x, gint y, diff --git a/openbox/mouse.c b/openbox/mouse.c index 071a23b2..ae9a6fc2 100644 --- a/openbox/mouse.c +++ b/openbox/mouse.c @@ -45,7 +45,7 @@ typedef struct { /* Array of GSList*s of ObMouseBinding*s. */ static GSList *bound_contexts[OB_FRAME_NUM_CONTEXTS]; -/* TRUE when we have a grab on the pointer and need to reply the pointer event +/* TRUE when we have a grab on the pointer and need to replay the pointer event to send it to other applications */ static gboolean replay_pointer_needed; |
