merge r6881-6890 from trunk
authorDana Jansens <danakj@orodu.net>
Sat, 26 May 2007 16:25:41 +0000 (16:25 +0000)
committerDana Jansens <danakj@orodu.net>
Sat, 26 May 2007 16:25:41 +0000 (16:25 +0000)
doc/rc-mouse-focus.xml
openbox/client.c
openbox/client.h
openbox/frame.c
openbox/stacking.c
po/pt.po
po/pt_BR.po

index 3ad00fed4ccd580dd73baf0b9f47e32c1e9821e0..e5f327e131682ff54f3d7dfc311c28e979d5ab6f 100644 (file)
       <action name="Resize"/>
     </mousebind> 
 
-    <mousebind button="A-Middle" action="Press">
+    <mousebind button="A-Middle" action="Click">
       <action name="Focus"/>
       <action name="Lower"/>
     </mousebind>
     <mousebind button="A-Down" action="Click">
       <action name="DesktopNext"/>
     </mousebind>
+    <mousebind button="C-A-Up" action="Click">
+      <action name="DesktopPrevious"/>
+    </mousebind>
+    <mousebind button="C-A-Down" action="Click">
+      <action name="DesktopNext"/>
+    </mousebind>
     <mousebind button="A-S-Up" action="Click">
       <action name="SendToDesktopPrevious"/>
     </mousebind>
 
     <mousebind button="Middle" action="Press">
       <action name="Focus"/>
+    </mousebind>
+    <mousebind button="Middle" action="Click">
       <action name="Lower"/>
     </mousebind>
 
 
     <mousebind button="Middle" action="Press">
       <action name="Focus"/>
+    </mousebind>
+    <mousebind button="Middle" action="Click">
       <action name="Lower"/>
     </mousebind>
 
   <context name="Client">
     <mousebind button="Left" action="Press">
       <action name="Focus"/>
-      <action name="Raise"/>
     </mousebind>
     <mousebind button="Middle" action="Press">
       <action name="Focus"/>
-      <action name="Raise"/>
     </mousebind>
     <mousebind button="Right" action="Press">
       <action name="Focus"/>
-      <action name="Raise"/>
     </mousebind>
   </context>
 
     <mousebind button="A-Down" action="Press">
       <action name="DesktopNext"/>
     </mousebind>
+    <mousebind button="C-A-Up" action="Press">
+      <action name="DesktopPrevious"/>
+    </mousebind>
+    <mousebind button="C-A-Down" action="Press">
+      <action name="DesktopNext"/>
+    </mousebind>
 
     <mousebind button="Left" action="Press">
       <action name="Focus"/>
index 9c8b2ee172cd3fd183ed85d433c676e75ed85091..573c271c8cb8eb2049bc14e5818cb35704056bfd 100644 (file)
@@ -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;
index 82a565f3fd692f7e64200f8789a5be66081b2ff6..e4831b95341af4c09de21b49688681b4dec6826e 100644 (file)
@@ -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;
index 574d1816fcd4cb463924bdd5fa77bd5ad6156063..a03a876afbf6b56439859f739b2510a41a78bba5 100644 (file)
@@ -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)
index 0fb19521607f240b63f6d8394d60fd339d02b7b1..ce3befcaf6b04db25aa47a0eee1dd39f5cc8b72c 100644 (file)
@@ -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);
index da252c820b0e7e2186e4166eb87bb3ed069eff88..cd1484207ba07dea953d1a3ffb1ed57c51f77c13 100644 (file)
--- 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
index aa1a83a40e2320f80187676ef9f877b11305992a..9bb9249c1d90e9ee4b2d21f1f32eb8ab0fbf4c2d 100644 (file)
@@ -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