merge r6955-6963 from trunk
authorDana Jansens <danakj@orodu.net>
Sun, 27 May 2007 23:38:36 +0000 (23:38 +0000)
committerDana Jansens <danakj@orodu.net>
Sun, 27 May 2007 23:38:36 +0000 (23:38 +0000)
data/rc.xml
doc/rc-mouse-focus.xml
openbox/action.c
openbox/client_list_menu.c
openbox/event.c
openbox/focus.c
openbox/focus.h
openbox/frame.c
openbox/menu.c
openbox/screen.c
po/ca.po

index 421de2d..801339e 100644 (file)
 
 <focus>
   <focusNew>yes</focusNew>
+  <!-- always try to focus new windows when they appear. other rules do
+       apply -->
   <focusLast>yes</focusLast>
+  <!-- focus the last used window when changing desktops, instead of the one
+       under the mouse pointer. when followMouse is enabled -->
   <followMouse>no</followMouse>
+  <!-- move focus to a window when you move the mouse into it -->
   <focusDelay>200</focusDelay>
+  <!-- when followMouse is enabled, the mouse must be inside the window for
+       this many milliseconds (1000 = 1 sec) before moving focus to it -->
   <raiseOnFocus>no</raiseOnFocus>
+  <!-- when followMouse is enabled, and a window is given focus by moving the
+       mouse into it, also raise the window -->
 </focus>
 
 <placement>
index af62b26..7f1d6d6 100644 (file)
 
 <focus>
   <focusNew>yes</focusNew>
+  <!-- always try to focus new windows when they appear. other rules do
+       apply -->
   <focusLast>yes</focusLast>
+  <!-- focus the last used window when changing desktops, instead of the one
+       under the mouse pointer. when followMouse is enabled -->
   <followMouse>yes</followMouse>
+  <!-- move focus to a window when you move the mouse into it -->
   <focusDelay>200</focusDelay>
+  <!-- when followMouse is enabled, the mouse must be inside the window for
+       this many milliseconds (1000 = 1 sec) before moving focus to it -->
   <raiseOnFocus>no</raiseOnFocus>
+  <!-- when followMouse is enabled, and a window is given focus by moving the
+       mouse into it, also raise the window -->
 </focus>
 
 <placement>
index 6e4cd18..a01f4d0 100644 (file)
@@ -1311,7 +1311,7 @@ void action_focus(union ActionData *data)
 void action_unfocus (union ActionData *data)
 {
     if (data->client.any.c == focus_client)
-        focus_fallback(FALSE);
+        focus_fallback(FALSE, FALSE);
 }
 
 void action_iconify(union ActionData *data)
index e5ad17a..82716c3 100644 (file)
@@ -135,7 +135,6 @@ static gboolean self_update(ObMenuFrame *frame, gpointer data)
 {
     ObMenu *menu = frame->menu;
     guint i;
-    GSList *it, *next;
 
     menu_clear_entries(menu);
 
index ac5919e..bb24908 100644 (file)
@@ -343,6 +343,9 @@ static gboolean wanted_focusevent(XEvent *e, gboolean in_client_only)
         /* This means focus was taken by a keyboard/mouse grab. */
         if (mode == NotifyGrab)
             return FALSE;
+        /* This means focus was grabbed on a window and it was released. */
+        if (mode == NotifyUngrab)
+            return FALSE;
 
         /* Focus left the root window revertedto state */
         if (win == RootWindow(ob_display, ob_screen))
@@ -516,7 +519,7 @@ static void event_process(const XEvent *ec, gpointer data)
                 */
 
                 if (!focus_left_screen)
-                    focus_fallback(TRUE);
+                    focus_fallback(TRUE, FALSE);
             }
         }
         else if (!client)
@@ -570,7 +573,7 @@ static void event_process(const XEvent *ec, gpointer data)
                 ob_debug_type(OB_DEBUG_FOCUS,
                               "Focus went to an unmanaged window 0x%x !\n",
                               ce.xfocus.window);
-                focus_fallback(TRUE);
+                focus_fallback(TRUE, FALSE);
             }
         }
 
index 6713d98..59dd0d0 100644 (file)
@@ -95,13 +95,15 @@ void focus_set_client(ObClient *client)
     }
 }
 
-static ObClient* focus_fallback_target(gboolean allow_refocus, ObClient *old)
+static ObClient* focus_fallback_target(gboolean allow_refocus,
+                                       gboolean allow_pointer,
+                                       ObClient *old)
 {
     GList *it;
     ObClient *c;
 
     ob_debug_type(OB_DEBUG_FOCUS, "trying pointer stuff\n");
-    if (config_focus_follow && !config_focus_last)
+    if (allow_pointer && config_focus_follow)
         if ((c = client_under_pointer()) &&
             (allow_refocus || c != old) &&
             (client_normal(c) &&
@@ -153,7 +155,7 @@ static ObClient* focus_fallback_target(gboolean allow_refocus, ObClient *old)
     return NULL;
 }
 
-ObClient* focus_fallback(gboolean allow_refocus)
+ObClient* focus_fallback(gboolean allow_refocus, gboolean allow_pointer)
 {
     ObClient *new;
     ObClient *old = focus_client;
@@ -163,7 +165,7 @@ ObClient* focus_fallback(gboolean allow_refocus)
        event at all for them. */
     focus_nothing();
 
-    new = focus_fallback_target(allow_refocus, old);
+    new = focus_fallback_target(allow_refocus, allow_pointer, old);
 
     return new;
 }
index 9bd4f20..be7a042 100644 (file)
@@ -44,7 +44,8 @@ void focus_set_client(struct _ObClient *client);
 void focus_nothing();
 
 /*! Call this when you need to focus something! */
-struct _ObClient* focus_fallback(gboolean allow_refocus);
+struct _ObClient* focus_fallback(gboolean allow_refocus,
+                                 gboolean allow_pointer);
 
 /*! Add a new client into the focus order */
 void focus_order_add_new(struct _ObClient *c);
index 92db14a..774247e 100644 (file)
@@ -1014,7 +1014,7 @@ static void layout_title(ObFrame *self)
     /* position of the left most button */
     const gint left = ob_rr_theme->paddingx + 1;
     /* position of the right most button */
-    const gint right = self->width - bwidth;
+    const gint right = self->width;
 
     /* turn them all off */
     self->icon_on = self->desk_on = self->shade_on = self->iconify_on =
@@ -1055,43 +1055,49 @@ static void layout_title(ObFrame *self)
                 if ((self->icon_on = is_button_present(self, lc, i))) {
                     /* icon is bigger than buttons */
                     self->label_width -= bwidth + 2;
-                    self->icon_x = x;
+                    if (i > 0) self->icon_x = x;
                     x += i * (bwidth + 2);
+                    if (i < 0) self->icon_x = x;
                 }
             } else if (*lc == 'D') {
                 if (firstcon) *firstcon = OB_FRAME_CONTEXT_ALLDESKTOPS;
                 if ((self->desk_on = is_button_present(self, lc, i))) {
                     self->label_width -= bwidth;
-                    self->desk_x = x;
+                    if (i > 0) self->desk_x = x;
                     x += i * bwidth;
+                    if (i < 0) self->desk_x = x;
                 }
             } else if (*lc == 'S') {
                 if (firstcon) *firstcon = OB_FRAME_CONTEXT_SHADE;
                 if ((self->shade_on = is_button_present(self, lc, i))) {
                     self->label_width -= bwidth;
-                    self->shade_x = x;
+                    if (i > 0) self->shade_x = x;
                     x += i * bwidth;
+                    if (i < 0) self->shade_x = x;
                 }
             } else if (*lc == 'I') {
                 if (firstcon) *firstcon = OB_FRAME_CONTEXT_ICONIFY;
                 if ((self->iconify_on = is_button_present(self, lc, i))) {
                     self->label_width -= bwidth;
-                    self->iconify_x = x;
+                    if (i > 0) self->iconify_x = x;
                     x += i * bwidth;
+                    if (i < 0) self->iconify_x = x;
                 }
             } else if (*lc == 'M') {
                 if (firstcon) *firstcon = OB_FRAME_CONTEXT_MAXIMIZE;
                 if ((self->max_on = is_button_present(self, lc, i))) {
                     self->label_width -= bwidth;
-                    self->max_x = x;
+                    if (i > 0) self->max_x = x;
                     x += i * bwidth;
+                    if (i < 0) self->max_x = x;
                 }
             } else if (*lc == 'C') {
                 if (firstcon) *firstcon = OB_FRAME_CONTEXT_CLOSE;
                 if ((self->close_on = is_button_present(self, lc, i))) {
                     self->label_width -= bwidth;
-                    self->close_x = x;
+                    if (i > 0) self->close_x = x;
                     x += i * bwidth;
+                    if (i < 0) self->close_x = x;
                 }
             } else
                 continue; /* don't set firstcon */
index fe664d3..71eb059 100644 (file)
@@ -396,8 +396,9 @@ void menu_show(gchar *name, gint x, gint y, gint button, ObClient *client)
     frame = menu_frame_new(self, 0, client);
     if (!menu_frame_show_topmenu(frame, x, y, button))
         menu_frame_free(frame);
-    else {
-        /* select the first entry if it's not a submenu */
+    else if (!button) {
+        /* select the first entry if it's not a submenu and we opened
+         * the menu with the keyboard, and skip all headers */
         GList *it = frame->entries;
         while (it) {
             ObMenuEntryFrame *e = it->data;
index deaf55e..11d527e 100644 (file)
@@ -539,12 +539,14 @@ void screen_set_desktop(guint num, gboolean dofocus)
         dofocus = FALSE;
 
     /* have to try focus here because when you leave an empty desktop
-       there is no focus out to watch for
+       there is no focus out to watch for. also, we have different rules
+       here. we always allow it to look under the mouse pointer if
+       config_focus_last is FALSE
 
        do this before hiding the windows so if helper windows are coming
        with us, they don't get hidden
     */
-    if (dofocus && (c = focus_fallback(TRUE)))
+    if (dofocus && (c = focus_fallback(TRUE, !config_focus_last)))
     {
         /* only do the flicker reducing stuff ahead of time if we are going
            to call xsetinputfocus on the window ourselves. otherwise there is
@@ -1007,7 +1009,7 @@ void screen_show_desktop(gboolean show, ObClient *show_only)
     else if (!show_only) {
         ObClient *c;
 
-        if ((c = focus_fallback(TRUE))) {
+        if ((c = focus_fallback(TRUE, FALSE))) {
             /* only do the flicker reducing stuff ahead of time if we are going
                to call xsetinputfocus on the window ourselves. otherwise there
                is no guarantee the window will actually take focus.. */
index 7e458e3..78cd475 100644 (file)
--- a/po/ca.po
+++ b/po/ca.po
@@ -1,14 +1,14 @@
 # Missatges en català per a openbox.
-# Copyright (C) 2004 Mikael Magnusson
+# Copyright (C) 2007 Mikael Magnusson
 # This file is distributed under the same license as the openbox package.
-# David Majà Martínez <davidmaja@gmail.com>, 2004.
+# David Majà Martínez <davidmaja@gmail.com>, 2007.
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: Openbox 3.3\n"
+"Project-Id-Version: Openbox 3.4\n"
 "Report-Msgid-Bugs-To: http://bugzilla.icculus.org\n"
 "POT-Creation-Date: 2007-05-23 16:20+0200\n"
-"PO-Revision-Date: 2004-01-25 20:41+0100\n"
+"PO-Revision-Date: 2007-05-28 01:32+0200\n"
 "Last-Translator: David Majà Martínez <davidmaja@gmail.com>\n"
 "Language-Team: catalan\n"
 "MIME-Version: 1.0\n"
@@ -18,22 +18,22 @@ msgstr ""
 #: openbox/action.c:954
 #, c-format
 msgid "Invalid action '%s' requested. No such action exists."
-msgstr ""
+msgstr "L''acció sol·licitada '%s' no és vàlida. Aquesta acció no existeix."
 
 #: openbox/action.c:957
 #, c-format
 msgid "Invalid use of action '%s'. Action will be ignored."
-msgstr ""
+msgstr "L''ús de l'acció '%s' no és vàlid. S'ignorarà aquesta acció."
 
 #: openbox/action.c:1226 openbox/action.c:1244 openbox/action.c:1257
 #, c-format
 msgid "Failed to execute '%s': %s"
-msgstr ""
+msgstr "No s'ha pogut executar '%s': %s"
 
 #: openbox/action.c:1265
 #, c-format
 msgid "Failed to convert the path '%s' from utf8"
-msgstr ""
+msgstr "No s'ha pogut convertir el camí '%s' des de utf8"
 
 #: openbox/client_list_combined_menu.c:102 openbox/client_list_menu.c:104
 msgid "Go there..."
@@ -41,7 +41,7 @@ msgstr "Vés aquí..."
 
 #: openbox/client_list_combined_menu.c:148
 msgid "Windows"
-msgstr ""
+msgstr "Finestres"
 
 #: openbox/client_list_menu.c:196
 msgid "Desktops"
@@ -53,7 +53,7 @@ msgstr "Tots els escriptoris"
 
 #: openbox/client_menu.c:351
 msgid "&Layer"
-msgstr ""
+msgstr "&Capa"
 
 #: openbox/client_menu.c:356
 msgid "Always on &top"
@@ -69,7 +69,7 @@ msgstr "Sempre a so&ta"
 
 #: openbox/client_menu.c:361
 msgid "&Send to desktop"
-msgstr ""
+msgstr "A l'&escriptori"
 
 #: openbox/client_menu.c:365
 msgid "Client menu"
@@ -101,154 +101,160 @@ msgstr "En/Desen&rotlla"
 
 #: openbox/client_menu.c:401
 msgid "Un/&Decorate"
-msgstr ""
+msgstr "Sense/Amb &decoració"
 
 #: openbox/client_menu.c:411
 msgid "&Close"
-msgstr ""
+msgstr "&Tanca"
 
 #: openbox/config.c:701
 #, c-format
 msgid "Invalid button '%s' specified in config file"
-msgstr ""
+msgstr "El botó especificat al fitxer de configuració '%s' no és vàlid."
 
 #: openbox/keyboard.c:162
 msgid "Conflict with key binding in config file"
-msgstr ""
+msgstr "Conflicte amb la tecla vinculada en el fitxer de configuració"
 
 #: openbox/menu.c:98 openbox/menu.c:106
 #, c-format
 msgid "Unable to find a valid menu file '%s'"
-msgstr ""
+msgstr "No s'ha pogut trobar un fitxer de menú '%s' vàlid"
 
 #: openbox/menu.c:149
 #, c-format
 msgid "Failed to execute command for pipe-menu '%s': %s"
-msgstr ""
+msgstr "S'ha produït un error en executar l'ordre per al menú de conducte '%s': %s"
 
 #: openbox/menu.c:166
 #, c-format
 msgid "Invalid output from pipe-menu '%s'"
-msgstr ""
+msgstr "La sortida del menú de conducte '%s' no és vàlida"
 
 #: openbox/menu.c:179
 #, c-format
 msgid "Attempted to access menu '%s' but it does not exist"
-msgstr ""
+msgstr "S'ha intentat accedir al menú '%s' ja que no existeix"
 
 #: openbox/menu.c:331 openbox/menu.c:332
 msgid "More..."
-msgstr ""
+msgstr "Més..."
 
 #: openbox/mouse.c:338
 #, c-format
 msgid "Invalid button '%s' in mouse binding"
-msgstr ""
+msgstr "El botó '%s' no és vàlid en la vinculació del ratolí"
 
 #: openbox/mouse.c:344
 #, c-format
 msgid "Invalid context '%s' in mouse binding"
-msgstr ""
+msgstr "El context '%s' no és vàlid en la vinculació del ratolí"
 
 #: openbox/openbox.c:129
 #, c-format
 msgid "Unable to change to home directory '%s': %s"
-msgstr ""
+msgstr "No s'ha pogut canviar al directori de l'usuari '%s': %s"
 
 #: openbox/openbox.c:149
 msgid "Failed to open the display from the DISPLAY environment variable."
-msgstr ""
+msgstr "No s'ha pogut obrir la pantalla des de la variable d'entorn DISPLAY"
 
 #: openbox/openbox.c:180
 msgid "Failed to initialize the obrender library."
-msgstr ""
+msgstr "S'ha produït un error en inicialitza la llibreria obrender."
 
 #: openbox/openbox.c:186
 msgid "X server does not support locale."
-msgstr ""
+msgstr "El servidor X no te suport per a idiomes"
 
 #: openbox/openbox.c:188
 msgid "Cannot set locale modifiers for the X server."
-msgstr ""
+msgstr "No s'ha pogut assignar els modificadors del locale per al servidor X."
 
 #: openbox/openbox.c:249
 msgid "Unable to find a valid config file, using some simple defaults"
-msgstr ""
+msgstr "No s'ha pogut trobat un fitxer de configuració vàlid, s'utilitzaran alguns valors predeterminats"
 
 #: openbox/openbox.c:275
 msgid "Unable to load a theme."
-msgstr ""
+msgstr "No s'ha pogut carregar el tema."
 
 #: openbox/openbox.c:394
 #, c-format
 msgid "Restart failed to execute new executable '%s': %s"
-msgstr ""
+msgstr "S'ha produït un error en tornar a iniciar i executar el nou executable '%s': %s"
 
 #: openbox/openbox.c:464 openbox/openbox.c:466
 msgid "Copyright (c)"
-msgstr ""
+msgstr "Copyright (c)"
 
 #: openbox/openbox.c:475
 msgid "Syntax: openbox [options]\n"
-msgstr ""
+msgstr "Sintaxis: openbox [opcions]\n"
 
 #: openbox/openbox.c:476
 msgid ""
 "\n"
 "Options:\n"
 msgstr ""
+"\n"
+"Opcions:\n"
 
 #: openbox/openbox.c:477
 msgid "  --help              Display this help and exit\n"
-msgstr ""
+msgstr "  --help              Visualitza aquesta ajuda i surt\n"
 
 #: openbox/openbox.c:478
 msgid "  --version           Display the version and exit\n"
-msgstr ""
+msgstr "  --version           Visualitza la versió i surt\n"
 
 #: openbox/openbox.c:479
 msgid "  --replace           Replace the currently running window manager\n"
-msgstr ""
+msgstr "  --replace           Reemplaça el gestor de finestres que s'està executant actualment\n"
 
 #: openbox/openbox.c:480
 msgid "  --sm-disable        Disable connection to the session manager\n"
-msgstr ""
+msgstr "  --sm-disable        Inhabilita la connexió amb gestor de sessió\n"
 
 #: openbox/openbox.c:481
 msgid ""
 "\n"
 "Passing messages to a running Openbox instance:\n"
 msgstr ""
+"\n"
+"S'està transferint missatges a la instància del Openbox que s'està executant:\n"
 
 #: openbox/openbox.c:482
 msgid "  --reconfigure       Reload Openbox's configuration\n"
-msgstr ""
+msgstr "  --reconfigure       Torna a carregar la configuració de Openbox\n"
 
 #: openbox/openbox.c:483
 msgid "  --restart           Restart Openbox\n"
-msgstr ""
+msgstr "  --restart           Torna a iniciar Openbox\n"
 
 #: openbox/openbox.c:484
 msgid ""
 "\n"
 "Debugging options:\n"
 msgstr ""
+"\n"
+"Opcions de depuració:\n"
 
 #: openbox/openbox.c:485
 msgid "  --sync              Run in synchronous mode\n"
-msgstr ""
+msgstr "  --sync              Executa en mode sincronitzat\n"
 
 #: openbox/openbox.c:486
 msgid "  --debug             Display debugging output\n"
-msgstr ""
+msgstr "  --debug             Mostra la sortida de depuració\n"
 
 #: openbox/openbox.c:487
 msgid "  --debug-focus       Display debugging output for focus handling\n"
-msgstr ""
+msgstr "  --debug-focus       Mostra la sortida de depuració per a la gestió del focus\n"
 
 #: openbox/openbox.c:488
 msgid "  --debug-xinerama    Split the display into fake xinerama screens\n"
-msgstr ""
+msgstr "  --debug-xinerama    Divideix la visualització en pantalles xinerama falses\n"
 
 #: openbox/openbox.c:489
 #, c-format
@@ -256,31 +262,33 @@ msgid ""
 "\n"
 "Please report bugs at %s\n"
 msgstr ""
+"\n"
+"Informeu dels errors a %s\n"
 
 #: openbox/openbox.c:586
 #, c-format
 msgid "Invalid command line argument '%s'\n"
-msgstr ""
+msgstr "Opció '%s' no vàlida a la línia d'ordres\n"
 
 #: openbox/screen.c:88 openbox/screen.c:189
 #, c-format
 msgid "A window manager is already running on screen %d"
-msgstr ""
+msgstr "Encara s'està executant un gestor de finestres a la pantalla %d"
 
 #: openbox/screen.c:125
 #, c-format
 msgid "Could not acquire window manager selection on screen %d"
-msgstr ""
+msgstr "No s'ha pogut adquirir la selecció del gestor de finestres en la pantalla %d"
 
 #: openbox/screen.c:146
 #, c-format
 msgid "The WM on screen %d is not exiting"
-msgstr ""
+msgstr "El gestor de finestres de la pantalla %d no està sortint"
 
 #: openbox/screen.c:939
 #, c-format
 msgid "desktop %i"
-msgstr ""
+msgstr "escriptori %i"
 
 #: openbox/session.c:103
 #, c-format
@@ -290,39 +298,39 @@ msgstr "No és pot crear el directori '%s': %s"
 #: openbox/session.c:451
 #, c-format
 msgid "Unable to save the session to '%s': %s"
-msgstr ""
+msgstr "No s'ha pogut desar la sessió a '%s': %s"
 
 #: openbox/session.c:583
 #, c-format
 msgid "Error while saving the session to '%s': %s"
-msgstr ""
+msgstr "S'ha produït un error mentre es desava la sessió a '%s': %s"
 
 #: openbox/startupnotify.c:237
 #, c-format
 msgid "Running %s\n"
-msgstr ""
+msgstr "Executant %s\n"
 
 #: openbox/translate.c:58
 #, c-format
 msgid "Invalid modifier key '%s' in key/mouse binding"
-msgstr ""
+msgstr "La tecla modificadora '%s' no és vàlida en la vinculació de tecles/ratolí"
 
 #: openbox/translate.c:135
 #, c-format
 msgid "Invalid key code '%s' in key binding"
-msgstr ""
+msgstr "El codi de tecla '%s' no és vàlid en la vinculació de tecles"
 
 #: openbox/translate.c:142
 #, c-format
 msgid "Invalid key name '%s' in key binding"
-msgstr ""
+msgstr "El nom de la tecla '%s' no és vàlid en la vinculació de tecles"
 
 #: openbox/translate.c:148
 #, c-format
 msgid "Requested key '%s' does not exist on the display"
-msgstr ""
+msgstr "La tecla seleccionada '%s' no existeix a la pantalla"
 
 #: openbox/xerror.c:39
 #, c-format
 msgid "X Error: %s"
-msgstr ""
+msgstr "Error d''X: %s"