From: Dana Jansens Date: Sat, 26 May 2007 16:25:41 +0000 (+0000) Subject: merge r6881-6890 from trunk X-Git-Tag: openbox-3_3_995-RELEASE~73 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=7981acb1d18682cd41e3eb67c4395d2e8cdd39f4;p=dana%2Fopenbox.git merge r6881-6890 from trunk --- diff --git a/doc/rc-mouse-focus.xml b/doc/rc-mouse-focus.xml index 3ad00fed..e5f327e1 100644 --- a/doc/rc-mouse-focus.xml +++ b/doc/rc-mouse-focus.xml @@ -238,7 +238,7 @@ - + @@ -249,6 +249,12 @@ + + + + + + @@ -273,6 +279,8 @@ + + @@ -338,6 +346,8 @@ + + @@ -398,15 +408,12 @@ - - - @@ -492,6 +499,12 @@ + + + + + + diff --git a/openbox/client.c b/openbox/client.c index 9c8b2ee1..573c271c 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -348,7 +348,7 @@ void client_manage(Window window) !self->iconic && /* this means focus=true for window is same as config_focus_new=true */ ((config_focus_new || (settings && settings->focus == 1)) || - client_search_focus_parent(self)) && + client_search_focus_tree_full(self)) && /* this checks for focus=false for the window */ (!settings || settings->focus != 0) && /* note the check against Type_Normal/Dialog, not client_normal(self), @@ -377,7 +377,17 @@ void client_manage(Window window) (!self->positioned ? "no" : (self->positioned == PPosition ? "program specified" : (self->positioned == USPosition ? "user specified" : - "BADNESS !?"))), self->area.x, self->area.y); + (self->positioned == PPosition | USPosition ? + "program + user specified" : + "BADNESS !?")))), self->area.x, self->area.y); + + ob_debug("Sized: %s @ %d %d\n", + (!self->sized ? "no" : + (self->sized == PSize ? "program specified" : + (self->sized == USSize ? "user specified" : + (self->sized == PSize | USSize ? + "program + user specified" : + "BADNESS !?")))), self->area.width, self->area.height); transient = place_client(self, &placex, &placey, settings); @@ -385,7 +395,7 @@ void client_manage(Window window) the visible screen area on its monitor. the monitor is chosen by place_client! */ - if (!(self->positioned & USPosition)) { + if (!(self->sized & USSize)) { /* make a copy to modify */ Rect a = *screen_area_monitor(self->desktop, client_monitor(self)); @@ -474,8 +484,8 @@ void client_manage(Window window) "Not focusing the window because its on another " "desktop\n"); } - /* If something is focused, and it's not our parent... */ - else if (focus_client && client_search_focus_parent(self) == NULL) + /* If something is focused, and it's not our relative... */ + else if (focus_client && client_search_focus_tree_full(self) == NULL) { /* If time stamp is old, don't steal focus */ if (self->user_time && last_time && @@ -509,6 +519,14 @@ void client_manage(Window window) "Not focusing the window because a globally " "active client has focus\n"); } + /* Don't move focus if it's not going to go to this window + anyway */ + else if (client_focus_target(self) != self) { + activate = FALSE; + ob_debug_type(OB_DEBUG_FOCUS, + "Not focusing the window because another window " + "would get the focus anyway\n"); + } } if (!activate) { @@ -589,6 +607,10 @@ ObClient *client_fake_manage(Window window) self->frame = frame_new(self); frame_adjust_area(self->frame, FALSE, TRUE, TRUE); + ob_debug("gave extents left %d right %d top %d bottom %d\n", + self->frame->size.left, self->frame->size.right, + self->frame->size.top, self->frame->size.bottom); + /* free the ObAppSettings shallow copy */ g_free(settings); @@ -853,6 +875,7 @@ static void client_restore_session_state(ObClient *self) RECT_SET_POINT(self->area, self->session->x, self->session->y); self->positioned = USPosition; + self->sized = USSize; if (self->session->w > 0) self->area.width = self->session->w; if (self->session->h > 0) @@ -1603,6 +1626,7 @@ void client_update_normal_hints(ObClient *self) if (!client_normal(self)) */ self->positioned = (size.flags & (PPosition|USPosition)); + self->sized = (size.flags & (PSize|USSize)); if (size.flags & PWinGravity) self->gravity = size.win_gravity; diff --git a/openbox/client.h b/openbox/client.h index 82a565f3..e4831b95 100644 --- a/openbox/client.h +++ b/openbox/client.h @@ -216,6 +216,10 @@ struct _ObClient we only force it if it tries to go completely offscreen, if neither, we should place the window ourselves when it first appears */ guint positioned; + + /*! Was the window's size requested by the application or the user? + If by the application we don't let it go outside the available area */ + guint sized; /*! Can the window receive input focus? */ gboolean can_focus; diff --git a/openbox/frame.c b/openbox/frame.c index 574d1816..a03a876a 100644 --- a/openbox/frame.c +++ b/openbox/frame.c @@ -356,7 +356,7 @@ void frame_adjust_area(ObFrame *self, gboolean moved, /* some elements are sized based of the width, so don't let them have negative values */ self->width = MAX(self->width, - (ob_rr_theme->grip_width + self->bwidth) * 2) + 1; + (ob_rr_theme->grip_width + self->bwidth) * 2 + 1); STRUT_SET(self->size, self->cbwidth_x + (!self->max_horz ? self->bwidth : 0), @@ -376,6 +376,13 @@ void frame_adjust_area(ObFrame *self, gboolean moved, if (!fake) { if (self->bwidth) { + gint titlesides; + + /* height of titleleft and titleright */ + titlesides = (!self->max_horz ? + ob_rr_theme->grip_width : + self->size.top - self->bwidth); + XMoveResizeWindow(ob_display, self->titletop, ob_rr_theme->grip_width + self->bwidth, 0, /* width + bwidth*2 - bwidth*2 - grips*2 */ @@ -393,27 +400,29 @@ void frame_adjust_area(ObFrame *self, gboolean moved, ob_rr_theme->grip_width + self->bwidth, self->bwidth); - XMoveResizeWindow(ob_display, self->titleleft, - 0, self->bwidth, - self->bwidth, - (!self->max_horz ? - ob_rr_theme->grip_width : - self->size.top - self->bwidth)); - XMoveResizeWindow(ob_display, self->titleright, - self->client->area.width + - self->size.left + self->size.right - - self->bwidth, - self->bwidth, - self->bwidth, - (!self->max_horz ? - ob_rr_theme->grip_width : - self->size.top - self->bwidth)); + if (titlesides > 0) { + XMoveResizeWindow(ob_display, self->titleleft, + 0, self->bwidth, + self->bwidth, + titlesides); + XMoveResizeWindow(ob_display, self->titleright, + self->client->area.width + + self->size.left + self->size.right - + self->bwidth, + self->bwidth, + self->bwidth, + titlesides); + + XMapWindow(ob_display, self->titleleft); + XMapWindow(ob_display, self->titleright); + } else { + XUnmapWindow(ob_display, self->titleleft); + XUnmapWindow(ob_display, self->titleright); + } XMapWindow(ob_display, self->titletop); XMapWindow(ob_display, self->titletopleft); XMapWindow(ob_display, self->titletopright); - XMapWindow(ob_display, self->titleleft); - XMapWindow(ob_display, self->titleright); if (self->decorations & OB_FRAME_DECOR_TITLEBAR && self->rbwidth) diff --git a/openbox/stacking.c b/openbox/stacking.c index 0fb19521..ce3befca 100644 --- a/openbox/stacking.c +++ b/openbox/stacking.c @@ -567,7 +567,7 @@ void stacking_restack_request(ObClient *client, ObClient *sibling, case Above: ob_debug("Restack request Above for client %s sibling %s\n", client->title, sibling ? sibling->title : "(all)"); - if (activate && !client->iconic) + if (activate && !client->iconic && client_normal(client)) /* use user=TRUE because it is impossible to get a timestamp for this */ client_activate(client, FALSE, TRUE); @@ -578,7 +578,7 @@ void stacking_restack_request(ObClient *client, ObClient *sibling, ob_debug("Restack request TopIf for client %s sibling %s\n", client->title, sibling ? sibling->title : "(all)"); if (stacking_occluded(client, sibling)) { - if (activate && !client->iconic) + if (activate && !client->iconic && client_normal(client)) /* use user=TRUE because it is impossible to get a timestamp for this */ client_activate(client, FALSE, TRUE); @@ -591,7 +591,7 @@ void stacking_restack_request(ObClient *client, ObClient *sibling, "%s\n", client->title, sibling ? sibling->title : "(all)"); if (stacking_occluded(client, sibling)) { - if (activate && !client->iconic) + if (activate && !client->iconic && client_normal(client)) /* use user=TRUE because it is impossible to get a timestamp for this */ client_activate(client, FALSE, TRUE); diff --git a/po/pt.po b/po/pt.po index da252c82..cd148420 100644 --- a/po/pt.po +++ b/po/pt.po @@ -293,7 +293,7 @@ msgstr "O gestor de janelas no ecr #: openbox/screen.c:946 #, c-format msgid "desktop %i" -msgstr "trabalho %i" +msgstr "área de trabalho %i" #: openbox/session.c:103 #, c-format diff --git a/po/pt_BR.po b/po/pt_BR.po index aa1a83a4..9bb9249c 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -298,7 +298,7 @@ msgstr "O gerenciador de janelas na tela %d não está saindo" #: openbox/screen.c:946 #, c-format msgid "desktop %i" -msgstr "trabalho %i" +msgstr "área de trabalho %i" #: openbox/session.c:103 #, c-format