From 70c074afe84ddbe4058f67a1fce062a769b449fc Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Fri, 8 Jan 2010 09:00:00 -0500 Subject: [PATCH 01/16] Use submenuShowDelay when navigating menus with the keyboard --- openbox/event.c | 6 +++++- openbox/menuframe.c | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/openbox/event.c b/openbox/event.c index ad9dade6..58e947fa 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -1712,7 +1712,11 @@ static gboolean event_handle_menu_keyboard(XEvent *ev) else if (ob_keycode_match(keycode, OB_KEY_RIGHT)) { /* Right goes to the selected submenu */ - if (frame->child) menu_frame_select_next(frame->child); + if (frame->selected->entry->type == OB_MENU_ENTRY_TYPE_SUBMENU) { + /* make sure it is visible */ + menu_frame_select(frame, frame->selected, TRUE); + menu_frame_select_next(frame->child); + } ret = TRUE; } diff --git a/openbox/menuframe.c b/openbox/menuframe.c index 076fe6ef..3d2b4302 100644 --- a/openbox/menuframe.c +++ b/openbox/menuframe.c @@ -1289,7 +1289,7 @@ void menu_frame_select_previous(ObMenuFrame *self) } } } - menu_frame_select(self, it ? it->data : NULL, TRUE); + menu_frame_select(self, it ? it->data : NULL, FALSE); } void menu_frame_select_next(ObMenuFrame *self) @@ -1314,5 +1314,5 @@ void menu_frame_select_next(ObMenuFrame *self) } } } - menu_frame_select(self, it ? it->data : NULL, TRUE); + menu_frame_select(self, it ? it->data : NULL, FALSE); } From bafd9e9edcff0e18a03ef6f4e73d673e12a7c7ed Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Fri, 8 Jan 2010 09:04:25 -0500 Subject: [PATCH 02/16] make Home and End keys navigate to top/bottom of the active menu --- openbox/event.c | 10 ++++++++++ openbox/menuframe.c | 32 ++++++++++++++++++++++++++++++++ openbox/menuframe.h | 2 ++ openbox/misc.h | 2 ++ openbox/openbox.c | 4 ++++ 5 files changed, 50 insertions(+) diff --git a/openbox/event.c b/openbox/event.c index 58e947fa..2ebea6ba 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -1729,6 +1729,16 @@ static gboolean event_handle_menu_keyboard(XEvent *ev) menu_frame_select_next(frame); ret = TRUE; } + + else if (ob_keycode_match(keycode, OB_KEY_HOME)) { + menu_frame_select_first(frame); + ret = TRUE; + } + + else if (ob_keycode_match(keycode, OB_KEY_END)) { + menu_frame_select_last(frame); + ret = TRUE; + } } /* Use KeyRelease events for running things so that the key release doesn't diff --git a/openbox/menuframe.c b/openbox/menuframe.c index 3d2b4302..f013bdec 100644 --- a/openbox/menuframe.c +++ b/openbox/menuframe.c @@ -1316,3 +1316,35 @@ void menu_frame_select_next(ObMenuFrame *self) } menu_frame_select(self, it ? it->data : NULL, FALSE); } + +void menu_frame_select_first(ObMenuFrame *self) +{ + GList *it = NULL; + + if (self->entries) { + for (it = self->entries; it; it = g_list_next(it)) { + ObMenuEntryFrame *e = it->data; + if (e->entry->type == OB_MENU_ENTRY_TYPE_SUBMENU) + break; + if (e->entry->type == OB_MENU_ENTRY_TYPE_NORMAL) + break; + } + } + menu_frame_select(self, it ? it->data : NULL, FALSE); +} + +void menu_frame_select_last(ObMenuFrame *self) +{ + GList *it = NULL; + + if (self->entries) { + for (it = g_list_last(self->entries); it; it = g_list_previous(it)) { + ObMenuEntryFrame *e = it->data; + if (e->entry->type == OB_MENU_ENTRY_TYPE_SUBMENU) + break; + if (e->entry->type == OB_MENU_ENTRY_TYPE_NORMAL) + break; + } + } + menu_frame_select(self, it ? it->data : NULL, FALSE); +} diff --git a/openbox/menuframe.h b/openbox/menuframe.h index 926b844e..da796d5b 100644 --- a/openbox/menuframe.h +++ b/openbox/menuframe.h @@ -127,6 +127,8 @@ void menu_frame_select(ObMenuFrame *self, ObMenuEntryFrame *entry, gboolean immediate); void menu_frame_select_previous(ObMenuFrame *self); void menu_frame_select_next(ObMenuFrame *self); +void menu_frame_select_first(ObMenuFrame *self); +void menu_frame_select_last(ObMenuFrame *self); ObMenuFrame* menu_frame_under(gint x, gint y); ObMenuEntryFrame* menu_entry_frame_under(gint x, gint y); diff --git a/openbox/misc.h b/openbox/misc.h index c1ec4075..68403f49 100644 --- a/openbox/misc.h +++ b/openbox/misc.h @@ -53,6 +53,8 @@ typedef enum OB_KEY_DOWN, OB_KEY_TAB, OB_KEY_SPACE, + OB_KEY_HOME, + OB_KEY_END, OB_NUM_KEYS } ObKey; diff --git a/openbox/openbox.c b/openbox/openbox.c index 0e339782..415c1604 100644 --- a/openbox/openbox.c +++ b/openbox/openbox.c @@ -239,6 +239,8 @@ gint main(gint argc, gchar **argv) keys[OB_KEY_DOWN] = modkeys_sym_to_code(XK_Down); keys[OB_KEY_TAB] = modkeys_sym_to_code(XK_Tab); keys[OB_KEY_SPACE] = modkeys_sym_to_code(XK_space); + keys[OB_KEY_HOME] = modkeys_sym_to_code(XK_Home); + keys[OB_KEY_END] = modkeys_sym_to_code(XK_End); { ObParseInst *i; @@ -427,6 +429,8 @@ gint main(gint argc, gchar **argv) g_free(keys[OB_KEY_DOWN]); g_free(keys[OB_KEY_TAB]); g_free(keys[OB_KEY_SPACE]); + g_free(keys[OB_KEY_HOME]); + g_free(keys[OB_KEY_END]); modkeys_shutdown(reconfigure); } while (reconfigure); From ab061f54687c27d5fc835578374705951ee056e0 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Thu, 17 Dec 2009 17:24:50 +0100 Subject: [PATCH 03/16] Change Usage translation in japanese, this is what gtk uses --- po/ja.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/ja.po b/po/ja.po index 4af2e9b5..31a070f7 100644 --- a/po/ja.po +++ b/po/ja.po @@ -296,7 +296,7 @@ msgstr "著作権 (c)" #: openbox/openbox.c:529 msgid "Syntax: openbox [options]\n" -msgstr "使い方: openbox [オプション]\n" +msgstr "用法: openbox [オプション]\n" #: openbox/openbox.c:530 msgid "" From 2b0dfb81cfe60d40827f0231aac9a95adca33137 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Fri, 8 Jan 2010 21:07:04 +0100 Subject: [PATCH 04/16] Fix the ~ expansion regex The look-around things are fixed-width but the [stuff] is 1 char, and the $ is 0 so it didn't work. I already used that trick for the ^, maybe it used to work due to a bug or smth. --- parser/parse.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/parser/parse.c b/parser/parse.c index ed66f088..897d738f 100644 --- a/parser/parse.c +++ b/parser/parse.c @@ -462,7 +462,8 @@ gchar *parse_expand_tilde(const gchar *f) if (!f) return NULL; - regex = g_regex_new("(?:^|(?<=[ \\t]))~(?=[/ \\t$])", G_REGEX_MULTILINE | G_REGEX_RAW, 0, NULL); + regex = g_regex_new("(?:^|(?<=[ \\t]))~(?:(?=[/ \\t])|$)", + G_REGEX_MULTILINE | G_REGEX_RAW, 0, NULL); ret = g_regex_replace_literal(regex, f, -1, 0, g_get_home_dir(), 0, NULL); g_regex_unref(regex); From 54c841f7b57ad0decedeed15aadcc1f116994bba Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Fri, 8 Jan 2010 21:51:04 +0100 Subject: [PATCH 05/16] obxprop: Add ability to limit listing to given properties --- tools/obxprop/obxprop.c | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/tools/obxprop/obxprop.c b/tools/obxprop/obxprop.c index 6ea8a4d3..b28b77a7 100644 --- a/tools/obxprop/obxprop.c +++ b/tools/obxprop/obxprop.c @@ -12,7 +12,7 @@ gint fail(const gchar *s) { else fprintf (stderr, - "Usage: obxprop [OPTIONS]\n\n" + "Usage: obxprop [OPTIONS] [--] [PROPERTIES ...]\n\n" "Options:\n" " --help Display this help and exit\n" " --display DISPLAY Connect to this X display\n" @@ -227,7 +227,7 @@ gboolean read_prop(Display *d, Window w, Atom prop, const gchar **type, gchar ** return FALSE; } -void show_properties(Display *d, Window w) +void show_properties(Display *d, Window w, int argc, char **argv) { Atom* props; int i, n; @@ -241,7 +241,19 @@ void show_properties(Display *d, Window w) name = XGetAtomName(d, props[i]); if (read_prop(d, w, props[i], &type, &val)) { - g_print("%s(%s) = %s\n", name, type, val); + int found = 1; + if (argc) { + int i; + + found = 0; + for (i = 0; i < argc; i++) + if (!strcmp(name, argv[i])) { + found = 1; + break; + } + } + if (found) + g_print("%s(%s) = %s\n", name, type, val); g_free(val); } @@ -283,6 +295,14 @@ int main(int argc, char **argv) return fail(0); dname = argv[i]; } + else if (*argv[i] != '-') + break; + else if (!strcmp(argv[i], "--")) { + i++; + break; + } + else + return fail(NULL); } d = XOpenDisplay(dname); @@ -295,12 +315,13 @@ int main(int argc, char **argv) userid = RootWindow(d, DefaultScreen(d)); if (userid == None) { - i = XGrabPointer(d, RootWindow(d, DefaultScreen(d)), + int j; + j = XGrabPointer(d, RootWindow(d, DefaultScreen(d)), False, ButtonPressMask, GrabModeAsync, GrabModeAsync, None, XCreateFontCursor(d, XC_crosshair), CurrentTime); - if (i != GrabSuccess) + if (j != GrabSuccess) return fail("Unable to grab the pointer device"); while (1) { XEvent ev; @@ -319,7 +340,7 @@ int main(int argc, char **argv) if (id == None) return fail("Unable to find window with the requested ID"); - show_properties(d, id); + show_properties(d, id, argc - i, &argv[i]); XCloseDisplay(d); From 4c544102c32a3b23bee23205fa0d4365ed02db09 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Fri, 8 Jan 2010 21:51:35 +0100 Subject: [PATCH 06/16] Pass NULL, not 0, handle invalid --id better. --- tools/obxprop/obxprop.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/obxprop/obxprop.c b/tools/obxprop/obxprop.c index b28b77a7..2e6b2a03 100644 --- a/tools/obxprop/obxprop.c +++ b/tools/obxprop/obxprop.c @@ -273,13 +273,13 @@ int main(int argc, char **argv) for (i = 1; i < argc; ++i) { if (!strcmp(argv[i], "--help")) { - return fail(0); + return fail(NULL); } else if (!strcmp(argv[i], "--root")) root = TRUE; else if (!strcmp(argv[i], "--id")) { if (++i == argc) - return fail(0); + return fail(NULL); if (argv[i][0] == '0' && argv[i][1] == 'x') { /* hex */ userid = parse_hex(argv[i]+2); @@ -288,11 +288,12 @@ int main(int argc, char **argv) /* decimal */ userid = atoi(argv[i]); } - break; + if (!userid) + return fail("Unable to parse argument to --id."); } else if (!strcmp(argv[i], "--display")) { if (++i == argc) - return fail(0); + return fail(NULL); dname = argv[i]; } else if (*argv[i] != '-') From d25398c4c853d8c9b4c92513106c8681f9a4453e Mon Sep 17 00:00:00 2001 From: Laszlo Dvornik Date: Fri, 8 Jan 2010 22:40:40 +0100 Subject: [PATCH 07/16] Update hungarian translation. --- po/hu.po | 272 +++++++++++++++++++++++++++---------------------------- 1 file changed, 132 insertions(+), 140 deletions(-) diff --git a/po/hu.po b/po/hu.po index ffa5201c..d970bf3e 100644 --- a/po/hu.po +++ b/po/hu.po @@ -1,15 +1,16 @@ -# Hungarian messages for openbox. -# Copyright (C) 2007 Mikael Magnusson +# Hungarian translation of openbox. +# Copyright (C) 2007 Dana Jansens # This file is distributed under the same license as the openbox package. # Robert Kuszinger , 2007. +# Laszlo Dvornik , 2010. # msgid "" msgstr "" -"Project-Id-Version: Openbox 3.4.7\n" +"Project-Id-Version: openbox 3.4.10\n" "Report-Msgid-Bugs-To: http://bugzilla.icculus.org\n" -"POT-Creation-Date: 2008-11-15 22:28+0100\n" -"PO-Revision-Date: 2008-03-17 19:25+0100\n" -"Last-Translator: Robert Kuszinger \n" +"POT-Creation-Date: 2010-01-08 22:39+0100\n" +"PO-Revision-Date: 2010-01-08 22:23+0100\n" +"Last-Translator: Laszlo Dvornik \n" "Language-Team: Hungarian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -19,7 +20,7 @@ msgstr "" #: openbox/actions.c:149 #, c-format msgid "Invalid action \"%s\" requested. No such action exists." -msgstr "Érvénytelen művelet \"%s\". Nem létezik ilyen." +msgstr "Érvénytelen művelet \"%s\". Nem létezik ilyen művelet." #: openbox/actions/execute.c:128 msgid "No" @@ -38,54 +39,43 @@ msgstr "Végrehajtás" msgid "Failed to convert the path \"%s\" from utf8" msgstr "Az útvonalat nem sikerült átalakítani utf8-ból: \"%s\"" -#: openbox/actions/exit.c:52 openbox/actions/session.c:64 -#: openbox/client.c:3465 +#: openbox/actions/exit.c:62 openbox/client.c:3474 msgid "Cancel" msgstr "Mégsem" -#: openbox/actions/exit.c:53 +#: openbox/actions/exit.c:63 msgid "Exit" msgstr "Kilépés" -#: openbox/actions/exit.c:56 -msgid "Are you sure you want to exit Openbox?" -msgstr "Biztos, hogy ki akarsz lépni az Openboxból?" - -#: openbox/actions/exit.c:57 -msgid "Exit Openbox" -msgstr "Kilépés az Openboxból" - -#. TRANSLATORS: Don't translate the word "SessionLogout" as it's the -#. name of the action you write in rc.xml -#: openbox/actions/session.c:43 -msgid "" -"The SessionLogout action is not available since Openbox was built without " -"session management support" -msgstr "" -"A SessionLogout művelet nem elérhető mivel az Openbox szekciókezelés " -"támogatása nélkül lett lefordítva" - -#: openbox/actions/session.c:65 openbox/actions/session.c:70 -msgid "Log Out" -msgstr "Kijelentkezés" - -#: openbox/actions/session.c:69 +#: openbox/actions/exit.c:67 msgid "Are you sure you want to log out?" msgstr "Biztos, hogy ki akarsz jelentkezni?" -#: openbox/client.c:2012 -msgid "Unnamed Window" -msgstr "Névtelen Ablak" +#: openbox/actions/exit.c:68 +msgid "Log Out" +msgstr "Kijelentkezés" -#: openbox/client.c:2026 openbox/client.c:2058 +#: openbox/actions/exit.c:71 +msgid "Are you sure you want to exit Openbox?" +msgstr "Biztos ki akar lépni az Openboxból?" + +#: openbox/actions/exit.c:72 +msgid "Exit Openbox" +msgstr "Kilépés az Openboxból" + +#: openbox/client.c:2016 +msgid "Unnamed Window" +msgstr "Névtelen ablak" + +#: openbox/client.c:2030 openbox/client.c:2062 msgid "Killing..." msgstr "Kilövés..." -#: openbox/client.c:2028 openbox/client.c:2060 +#: openbox/client.c:2032 openbox/client.c:2064 msgid "Not Responding" -msgstr "Nem Válaszol" +msgstr "Nem válaszol" -#: openbox/client.c:3454 +#: openbox/client.c:3463 #, c-format msgid "" "The window \"%s\" does not seem to be responding. Do you want to force it " @@ -93,24 +83,24 @@ msgid "" msgstr "" "A(z) \"%s\" ablak nem válaszol. Erőltessük a kilépést a %s jelzés küldésével?" -#: openbox/client.c:3456 +#: openbox/client.c:3465 msgid "End Process" -msgstr "Folyamat Vége" +msgstr "Folyamat vége" -#: openbox/client.c:3460 +#: openbox/client.c:3469 #, c-format msgid "" "The window \"%s\" does not seem to be responding. Do you want to disconnect " "it from the X server?" -msgstr "A(z) \"%s\" ablak nem válaszol. Lekapcsoljuk az X szerverről?" +msgstr "A(z) \"%s\" ablak nem válaszol. Lekapcsoljuk az X kiszolgálóról?" -#: openbox/client.c:3462 +#: openbox/client.c:3471 msgid "Disconnect" -msgstr "Szétkapcsolódás" +msgstr "Lekapcsolódás" #: openbox/client_list_combined_menu.c:87 openbox/client_list_menu.c:91 msgid "Go there..." -msgstr "Menjünk oda..." +msgstr "Ugrás..." #: openbox/client_list_combined_menu.c:94 msgid "Manage desktops" @@ -118,7 +108,7 @@ msgstr "Munkaasztal-kezelés" #: openbox/client_list_combined_menu.c:95 openbox/client_list_menu.c:155 msgid "_Add new desktop" -msgstr "Új _munkaasztal" +msgstr "Új munk_aasztal" #: openbox/client_list_combined_menu.c:96 openbox/client_list_menu.c:156 msgid "_Remove last desktop" @@ -154,7 +144,7 @@ msgstr "Mindig _alul" #: openbox/client_menu.c:379 msgid "_Send to desktop" -msgstr "Munkaasztalra _küldeni" +msgstr "Munkaasztalra _küldés" #: openbox/client_menu.c:383 msgid "Client menu" @@ -166,15 +156,15 @@ msgstr "_Visszaállítás" #: openbox/client_menu.c:397 msgid "_Move" -msgstr "_Mozgatás" +msgstr "Á_thelyezés" #: openbox/client_menu.c:399 msgid "Resi_ze" -msgstr "_Átméretezés" +msgstr "Átmérete_zés" #: openbox/client_menu.c:401 msgid "Ico_nify" -msgstr "Iko_nná alakítás" +msgstr "Iko_nizálás" #: openbox/client_menu.c:405 msgid "Ma_ximize" @@ -186,117 +176,121 @@ msgstr "_Görgetés fel/le" #: openbox/client_menu.c:411 msgid "Un/_Decorate" -msgstr "_Dekoráció eltávilítása" +msgstr "_Dekoráció eltávolítása" #: openbox/client_menu.c:415 msgid "_Close" msgstr "_Bezárás" -#: openbox/config.c:781 +#: openbox/config.c:798 #, c-format msgid "Invalid button \"%s\" specified in config file" msgstr "Érvénytelen gomb a konfigurációs fájlban \"%s\"" #: openbox/keyboard.c:157 msgid "Conflict with key binding in config file" -msgstr "Ütköző billentyű-műveletek a konfigurációs fájlban" +msgstr "Ütköző billentyű hozzárendelések a konfigurációs fájlban" #: openbox/menu.c:102 openbox/menu.c:110 #, c-format msgid "Unable to find a valid menu file \"%s\"" -msgstr "Nem található ilyen érvényes menü fájl: \"%s\"" +msgstr "Nem található ilyen érvényes menüfájl: \"%s\"" #: openbox/menu.c:170 #, c-format msgid "Failed to execute command for pipe-menu \"%s\": %s" -msgstr "Sikertelen parancsfuttatás a csővezeték-menüben \"%s\": %s" +msgstr "Nem sikerült végrehajtani a parancsot a csővezeték-menüben \"%s\": %s" #: openbox/menu.c:184 #, c-format msgid "Invalid output from pipe-menu \"%s\"" -msgstr "Érvnytelen válasz a csővezeték menüből \"%s\"" +msgstr "Érvnytelen kimenet a csővezeték-menüből \"%s\"" #: openbox/menu.c:197 #, c-format msgid "Attempted to access menu \"%s\" but it does not exist" msgstr "\"%s\" menü elérésére történt kísérlet, de az nem létezik" -#: openbox/menu.c:367 openbox/menu.c:368 +#: openbox/menu.c:370 openbox/menu.c:371 msgid "More..." msgstr "Tovább..." #: openbox/mouse.c:373 #, c-format msgid "Invalid button \"%s\" in mouse binding" -msgstr "Érvénytelen gomb \"%s\" az egér parancsoknál" +msgstr "Érvénytelen gomb \"%s\" az egér hozzárendeléseknél" #: openbox/mouse.c:379 #, c-format msgid "Invalid context \"%s\" in mouse binding" -msgstr "Érvénytelen környezet az egér parancsoknál: \"%s\"" +msgstr "Érvénytelen környezet az egér hozzárendeléseknél: \"%s\"" #: openbox/openbox.c:133 #, c-format msgid "Unable to change to home directory \"%s\": %s" -msgstr "Nem lehet a saját mappába váltani \"%s\": %s" +msgstr "Nem lehet a saját könyvtárba váltani \"%s\": %s" #: openbox/openbox.c:152 msgid "Failed to open the display from the DISPLAY environment variable." -msgstr "Nem nyitható meg a DISPLAY változóban beállított képernyő" +msgstr "" +"Nem sikerült megnyitni a DISPLAY környezeti változóban beállított képernyőt." #: openbox/openbox.c:183 msgid "Failed to initialize the obrender library." -msgstr "Nem sikerült használatba venni az obernder függvénykönyvtárat" +msgstr "Nem sikerült előkészíteni az obrender programkönyvtárat." #: openbox/openbox.c:194 msgid "X server does not support locale." -msgstr "Az X kiszolgáló nem támogatja ezt a nemzetközi beállítást." +msgstr "Az X-kiszolgáló nem támogatja ezt a nemzetközi beállítást." #: openbox/openbox.c:196 msgid "Cannot set locale modifiers for the X server." -msgstr "A nemzetközi beálljtás módosítók nem állíthatók be az X szerveren." +msgstr "" +"Nem lehet beállítani a nemzetközi beállítás-módosítókat az X-kiszolgálón." -#: openbox/openbox.c:263 +#: openbox/openbox.c:265 msgid "Unable to find a valid config file, using some simple defaults" -msgstr "Nincs konfigurációs fájl, ezért egyszerű alapértelmezéseket használunk" +msgstr "" +"Nem található érvényes konfigurációs fájl, ezért egyszerű alapértelmezés " +"lesznek használva" -#: openbox/openbox.c:297 +#: openbox/openbox.c:299 msgid "Unable to load a theme." -msgstr "Nem tölthető be a téma." +msgstr "Nem lehet betölteni témát." -#: openbox/openbox.c:377 +#: openbox/openbox.c:379 #, c-format msgid "" "One or more XML syntax errors were found while parsing the Openbox " "configuration files. See stdout for more information. The last error seen " "was in file \"%s\" line %d, with message: %s" msgstr "" -"Egy vagy több XML szintaktikai hibát találtam az Openbox konfigurációs fájl " -"olvasásakor. Nézd meg a standard kimenetet a részletekért. Az utolsó hiba " -"ebben a fájlban volt: \"%s\" a %d sorban. A hibaüzenet: %s" +"Egy vagy több XML szintaktikai hiba található az Openbox konfigurációs fájl " +"feldolgozásakor. További információkért tekintse meg a szabványos kimenetet. " +"Az utolsó hiba ebben a fájlban volt: \"%s\" (%d sor). A hibaüzenet: %s" -#: openbox/openbox.c:379 +#: openbox/openbox.c:381 msgid "Openbox Syntax Error" -msgstr "Openbox Szintaxis Hiba" +msgstr "Openbox szintaktikai hiba" -#: openbox/openbox.c:379 +#: openbox/openbox.c:381 msgid "Close" msgstr "Bezárás" -#: openbox/openbox.c:448 +#: openbox/openbox.c:463 #, c-format msgid "Restart failed to execute new executable \"%s\": %s" msgstr "Az újraindítás során ez az új program nem volt indítható \"%s\": %s" -#: openbox/openbox.c:518 openbox/openbox.c:520 +#: openbox/openbox.c:533 openbox/openbox.c:535 msgid "Copyright (c)" -msgstr "Szerzői jogok (c)" +msgstr "Copyright (c)" -#: openbox/openbox.c:529 +#: openbox/openbox.c:544 msgid "Syntax: openbox [options]\n" -msgstr "Használat: openbox [options]\n" +msgstr "Használat: openbox [opciók]\n" -#: openbox/openbox.c:530 +#: openbox/openbox.c:545 msgid "" "\n" "Options:\n" @@ -304,115 +298,115 @@ msgstr "" "\n" "Opciók:\n" -#: openbox/openbox.c:531 +#: openbox/openbox.c:546 msgid " --help Display this help and exit\n" msgstr " --help Súgó megjelenítése és kilépés\n" -#: openbox/openbox.c:532 +#: openbox/openbox.c:547 msgid " --version Display the version and exit\n" -msgstr " --version Verzió kiírása majd kilépés\n" +msgstr " --version Verzió kiírása és kilépés\n" -#: openbox/openbox.c:533 +#: openbox/openbox.c:548 msgid " --replace Replace the currently running window manager\n" -msgstr " --replace Futó ablakkezelő cseréje\n" +msgstr " --replace Jelenleg futó ablakkezelő cseréje\n" #. TRANSLATORS: if you translate "FILE" here, make sure to keep the "Specify..." #. aligned still, if you have to, make a new line with \n and 22 spaces. It's #. fine to leave it as FILE though. -#: openbox/openbox.c:537 +#: openbox/openbox.c:552 msgid " --config-file FILE Specify the path to the config file to use\n" msgstr "" -" --config-file FILE Megadhatod az útvonalat a konfigurációs file-hoz\n" +" --config-file FÁJL A használandó konfigurációs fájl útvonalának megadása\n" -#: openbox/openbox.c:538 +#: openbox/openbox.c:553 msgid " --sm-disable Disable connection to the session manager\n" -msgstr " --sm-disable Ne csatlakozzon a szekció-kezelőhöz\n" +msgstr " --sm-disable Ne csatlakozzon a munkamenet-kezelőhöz\n" -#: openbox/openbox.c:539 +#: openbox/openbox.c:554 msgid "" "\n" "Passing messages to a running Openbox instance:\n" msgstr "" "\n" -"Üzenet küldése a futó Openbox példánynak\n" +"Üzenet küldése a futó Openbox példánynak:\n" -#: openbox/openbox.c:540 +#: openbox/openbox.c:555 msgid " --reconfigure Reload Openbox's configuration\n" -msgstr " --reconfigure Konfiguráció úrjatöltése\n" +msgstr " --reconfigure Openbox beállításának újratöltése\n" -#: openbox/openbox.c:541 +#: openbox/openbox.c:556 msgid " --restart Restart Openbox\n" msgstr " --restart Openbox újraindítása\n" -#: openbox/openbox.c:542 +#: openbox/openbox.c:557 msgid " --exit Exit Openbox\n" msgstr " --exit Kilépés az Openboxból\n" -#: openbox/openbox.c:543 +#: openbox/openbox.c:558 msgid "" "\n" "Debugging options:\n" msgstr "" "\n" -"Debug (hibakereső) lehetőségek:\n" +"Hibakeresési opciók:\n" -#: openbox/openbox.c:544 +#: openbox/openbox.c:559 msgid " --sync Run in synchronous mode\n" msgstr " --sync Futtatás szinkron módban\n" -#: openbox/openbox.c:545 +#: openbox/openbox.c:560 msgid " --debug Display debugging output\n" -msgstr " --debug Hibakeresési információk megjelenítése\n" +msgstr " --debug Hibakeresési kimenet megjelenítése\n" -#: openbox/openbox.c:546 +#: openbox/openbox.c:561 msgid " --debug-focus Display debugging output for focus handling\n" msgstr "" -" --debug-focus Fókuszkezelésre vonatkozó hibakeresési információk " -"kiírása\n" +" --debug-focus Fókuszkezelésre vonatkozó hibakeresési kimenetek " +"megjelenítése\n" -#: openbox/openbox.c:547 +#: openbox/openbox.c:562 msgid " --debug-xinerama Split the display into fake xinerama screens\n" msgstr " --debug-xinerama Képernyő felosztása két ál-xinerama képernyőre\n" -#: openbox/openbox.c:548 +#: openbox/openbox.c:563 #, c-format msgid "" "\n" "Please report bugs at %s\n" msgstr "" "\n" -"Légyszi jelentsd a hibát itt: %s\n" +"Kérjük a hibákat itt jelentse: %s\n" -#: openbox/openbox.c:617 +#: openbox/openbox.c:645 msgid "--config-file requires an argument\n" -msgstr "--config-file használatakor paraméter megadása kötelező!\n" +msgstr "--config-file használatakor paraméter megadása kötelező\n" -#: openbox/openbox.c:660 +#: openbox/openbox.c:688 #, c-format msgid "Invalid command line argument \"%s\"\n" msgstr "Érvénytelen parancssori opció: \"%s\"\n" -#: openbox/screen.c:102 openbox/screen.c:190 +#: openbox/screen.c:103 openbox/screen.c:191 #, c-format msgid "A window manager is already running on screen %d" -msgstr "Már fut egy ablakkezelő ezen a képernyőn %d" +msgstr "Már fut egy ablakkezelő ezen a képernyőn: %d" -#: openbox/screen.c:124 +#: openbox/screen.c:125 #, c-format msgid "Could not acquire window manager selection on screen %d" -msgstr "Nem tudok ablakkezelőt váltani ezen a képernyőn %d" +msgstr "Nem lehet ablakkezelőt váltani ezen a képernyőn: %d" -#: openbox/screen.c:145 +#: openbox/screen.c:146 #, c-format msgid "The WM on screen %d is not exiting" -msgstr "Ezen a képernyőn: %d az ablakkezelő nem lép ki" +msgstr "Nem lép ki az ablakkezelő ezen a képernyőn: %d" #. TRANSLATORS: If you need to specify a different order of the #. arguments, you can use %1$d for the first one and %2$d for the #. second one. For example, #. "The current session has %2$d desktops, but Openbox is configured for %1$d ..." -#: openbox/screen.c:412 -#, fuzzy, c-format +#: openbox/screen.c:416 +#, c-format msgid "" "Openbox is configured for %d desktop, but the current session has %d. " "Overriding the Openbox configuration." @@ -421,68 +415,66 @@ msgid_plural "" "Overriding the Openbox configuration." msgstr[0] "" "Az Openbox %d munkaasztal használatára lett beállítva, de a jelenlegi " -"munkamenetnek %d van. Felülbíráljuk az Openbox beállítását." +"munkamenetnek %d van. Felülbíráljuk az Openbox beállítását." msgstr[1] "" "Az Openbox %d munkaasztal használatára lett beállítva, de a jelenlegi " -"munkamenetnek %d van. Felülbíráljuk az Openbox beállítását." +"munkamenetnek %d van. Felülbíráljuk az Openbox beállítását." -#: openbox/screen.c:1180 +#: openbox/screen.c:1199 #, c-format msgid "desktop %i" msgstr "%i. munkaasztal" -#: openbox/session.c:104 +#: openbox/session.c:105 #, c-format msgid "Unable to make directory \"%s\": %s" -msgstr "Nem hozható létre a könyvtár \"%s\": %s" +msgstr "Nem lehet létrehozni a könyvtárat \"%s\": %s" -#: openbox/session.c:466 +#: openbox/session.c:472 #, c-format msgid "Unable to save the session to \"%s\": %s" -msgstr "Nem tudom elmenti ide a futó környezetet \"%s\": %s" +msgstr "Nem lehet menteni ide a futó munkamenetet \"%s\": %s" -#: openbox/session.c:605 +#: openbox/session.c:611 #, c-format msgid "Error while saving the session to \"%s\": %s" -msgstr "Hiba a futási környezet mentése közben \"%s\": %s" +msgstr "Hiba a munkamenet mentése közben \"%s\": %s" -#: openbox/session.c:842 +#: openbox/session.c:848 msgid "Not connected to a session manager" -msgstr "Nem kapcsolódunk a szekciókezelőhöz" +msgstr "Nincs kapcsolódva a munkamenet-kezelőhöz" #: openbox/startupnotify.c:243 #, c-format msgid "Running %s" -msgstr "Futtatás %s" +msgstr "%s futtatása" #: openbox/translate.c:59 #, c-format msgid "Invalid modifier key \"%s\" in key/mouse binding" -msgstr "Érvénytelen módosító gomb \"%s\" egér vagy billentyűparancsnál" +msgstr "" +"Érvénytelen módosító billentyű \"%s\" billentyű vagy egér hozzárendelésnél" #: openbox/translate.c:138 #, c-format msgid "Invalid key code \"%s\" in key binding" -msgstr "Érvénytelen billentyűkód \"%s\" billentyűparancsnál" +msgstr "Érvénytelen billentyűkód \"%s\" billentyű hozzárendelésnél" #: openbox/translate.c:145 #, c-format msgid "Invalid key name \"%s\" in key binding" -msgstr "Érvénytelen billentyűnév \"%s\" billentyűparancsnál" +msgstr "Érvénytelen billentyűnév \"%s\" billentyű hozzárendelésnél" #: openbox/translate.c:151 #, c-format msgid "Requested key \"%s\" does not exist on the display" -msgstr "A kért gomb \"%s\" nem létezik a képernyőn" +msgstr "A kért billentyű \"%s\" nem létezik a képernyőn" #: openbox/xerror.c:40 #, c-format msgid "X Error: %s" -msgstr "X rendszer hiba: %s" +msgstr "X-hiba: %s" #: openbox/prompt.c:200 msgid "OK" msgstr "OK" - -#~ msgid "Failed to execute \"%s\": %s" -#~ msgstr "Nem sikerült futtatni ezt a programot \"%s\": %s" From 9cf5903e16c68ce1877d8d04ca6ee1c28e04a5ce Mon Sep 17 00:00:00 2001 From: Einars Sprugis Date: Sun, 10 Jan 2010 22:23:20 +0100 Subject: [PATCH 08/16] Update latvian translation. --- po/lv.po | 181 +++++++++++++++++++++++++++---------------------------- 1 file changed, 90 insertions(+), 91 deletions(-) diff --git a/po/lv.po b/po/lv.po index f1a3ae1b..1642afe7 100644 --- a/po/lv.po +++ b/po/lv.po @@ -1,26 +1,27 @@ # Latvian translations for openbox. -# Copyright (C) 2009 Dana Jansens +# Copyright (C) 2010 Dana Jansens # This file is distributed under the same license as the openbox package. -# Einars Sprugis , 2009. # +# Einars Sprugis , 2010. msgid "" msgstr "" -"Project-Id-Version: Openbox 3.4.7\n" +"Project-Id-Version: 3.4.10\n" "Report-Msgid-Bugs-To: http://bugzilla.icculus.org\n" -"POT-Creation-Date: 2009-03-31 19:16+0200\n" -"PO-Revision-Date: 2009-03-30 19:14+0300\n" +"POT-Creation-Date: 2010-01-10 22:21+0100\n" +"PO-Revision-Date: 2010-01-08 21:11+0200\n" "Last-Translator: Einars Sprugis \n" -"Language-Team: Latvian \n" +"Language-Team: Latvian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : " "2);\n" +"X-Generator: Lokalize 1.0\n" #: openbox/actions.c:149 #, c-format msgid "Invalid action \"%s\" requested. No such action exists." -msgstr "Neatļauta darbība \"%s\". Šāda darbība neeksistē." +msgstr "Prasīta neatļauta darbība \"%s\". Šāda darbība neeksistē." #: openbox/actions/execute.c:128 msgid "No" @@ -39,72 +40,63 @@ msgstr "Izpildīt" msgid "Failed to convert the path \"%s\" from utf8" msgstr "Neizdevās pārveidot ceļu \"%s\" no utf8" -#: openbox/actions/exit.c:52 openbox/actions/session.c:64 -#: openbox/client.c:3465 +#: openbox/actions/exit.c:62 openbox/client.c:3474 msgid "Cancel" msgstr "Atcelt" -#: openbox/actions/exit.c:53 +#: openbox/actions/exit.c:63 msgid "Exit" msgstr "Iziet" -#: openbox/actions/exit.c:56 -msgid "Are you sure you want to exit Openbox?" -msgstr "Vai tiešām vēlaties iziet no Openbox?" - -#: openbox/actions/exit.c:57 -msgid "Exit Openbox" -msgstr "Iziet no Openbox" - -#. TRANSLATORS: Don't translate the word "SessionLogout" as it's the -#. name of the action you write in rc.xml -#: openbox/actions/session.c:43 -msgid "" -"The SessionLogout action is not available since Openbox was built without " -"session management support" -msgstr "" -"SessionLogout darbība nav pieejama, jo Openbox tika kompilēts bez sesijas " -"pārvaldes atbalsta" - -#: openbox/actions/session.c:65 openbox/actions/session.c:70 -msgid "Log Out" -msgstr "Atteikties" - -#: openbox/actions/session.c:69 +#: openbox/actions/exit.c:67 msgid "Are you sure you want to log out?" msgstr "Vai tiešām vēlaties atteikties?" -#: openbox/client.c:2012 +#: openbox/actions/exit.c:68 +msgid "Log Out" +msgstr "Atteikties" + +#: openbox/actions/exit.c:71 +msgid "Are you sure you want to exit Openbox?" +msgstr "Vai tiešām vēlaties iziet no Openbox?" + +#: openbox/actions/exit.c:72 +msgid "Exit Openbox" +msgstr "Iziet no Openbox" + +#: openbox/client.c:2016 msgid "Unnamed Window" msgstr "Logs bez nosaukuma" -#: openbox/client.c:2026 openbox/client.c:2058 +#: openbox/client.c:2030 openbox/client.c:2062 msgid "Killing..." msgstr "Nogalina..." -#: openbox/client.c:2028 openbox/client.c:2060 +#: openbox/client.c:2032 openbox/client.c:2064 msgid "Not Responding" msgstr "Neatbild" -#: openbox/client.c:3454 +#: openbox/client.c:3463 #, c-format msgid "" "The window \"%s\" does not seem to be responding. Do you want to force it " "to exit by sending the %s signal?" -msgstr "Logs \"%s\" neatbild. Vai vēlieties to piespiest, nosūtot signālu %s?" +msgstr "" +"Logs \"%s\" neatbild. Vai vēlieties to aizvērt piespiedu kārtā, nosūtot " +"signālu %s?" -#: openbox/client.c:3456 +#: openbox/client.c:3465 msgid "End Process" msgstr "Nobeigt procesu" -#: openbox/client.c:3460 +#: openbox/client.c:3469 #, c-format msgid "" "The window \"%s\" does not seem to be responding. Do you want to disconnect " "it from the X server?" msgstr "Logs \"%s\" neatbild. Vai vēlaties to atvienot no X servera?" -#: openbox/client.c:3462 +#: openbox/client.c:3471 msgid "Disconnect" msgstr "Atvienot" @@ -122,7 +114,7 @@ msgstr "Pievienot j_aunu darbvirsmu" #: openbox/client_list_combined_menu.c:96 openbox/client_list_menu.c:156 msgid "_Remove last desktop" -msgstr "Aizvākt pēdējo da_rbvirsmu" +msgstr "Noņemt pēdējo da_rbvirsmu" #: openbox/client_list_combined_menu.c:149 msgid "Windows" @@ -146,7 +138,7 @@ msgstr "Vienmēr augšā" #: openbox/client_menu.c:376 msgid "_Normal" -msgstr "_Normāli" +msgstr "_Normāls" #: openbox/client_menu.c:377 msgid "Always on _bottom" @@ -158,7 +150,7 @@ msgstr "No_sūtīt uz darbvirsmu" #: openbox/client_menu.c:383 msgid "Client menu" -msgstr "Klientizvēlne" +msgstr "Klienta izvēlne" #: openbox/client_menu.c:393 msgid "R_estore" @@ -192,7 +184,7 @@ msgstr "Bez/Ar _dekorācijām" msgid "_Close" msgstr "Ai_zvērt" -#: openbox/config.c:782 +#: openbox/config.c:798 #, c-format msgid "Invalid button \"%s\" specified in config file" msgstr "Konfigurācijas failā \"%s\" norādīts neatļauts taustiņš" @@ -221,7 +213,7 @@ msgstr "Neatļauta izvade no skriptētās izvēlnes \"%s\"" msgid "Attempted to access menu \"%s\" but it does not exist" msgstr "Mēģināja piekļūt izvēlnei \"%s\", bet tā neeksistē" -#: openbox/menu.c:367 openbox/menu.c:368 +#: openbox/menu.c:370 openbox/menu.c:371 msgid "More..." msgstr "Vairāk..." @@ -242,7 +234,7 @@ msgstr "Nevarēja pāriet uz mājas mapi \"%s\": %s" #: openbox/openbox.c:152 msgid "Failed to open the display from the DISPLAY environment variable." -msgstr "Neizdevās atvēŗt displeju no DISPLAY vides mainīgā." +msgstr "Neizdevās atvērt displeju no DISPLAY vides mainīgā." #: openbox/openbox.c:183 msgid "Failed to initialize the obrender library." @@ -256,80 +248,80 @@ msgstr "X serveris neatbalsta lokāli." msgid "Cannot set locale modifiers for the X server." msgstr "Nevar uzstādīt lokāles modificētājus X serverim." -#: openbox/openbox.c:263 +#: openbox/openbox.c:265 msgid "Unable to find a valid config file, using some simple defaults" msgstr "" "Nevarēja atrast atļautu konfigurācijas failu, tiek izmantoti noklusējumi" -#: openbox/openbox.c:297 +#: openbox/openbox.c:299 msgid "Unable to load a theme." msgstr "Nebija iespējams ielādēt tēmu." -#: openbox/openbox.c:377 +#: openbox/openbox.c:379 #, c-format msgid "" "One or more XML syntax errors were found while parsing the Openbox " "configuration files. See stdout for more information. The last error seen " "was in file \"%s\" line %d, with message: %s" msgstr "" -"Analizējot Openbox konfigurācijas datnes, tika atrastas viena vai vairākas " +"Analizējot Openbox konfigurācijas failus, tika atrastas viena vai vairākas " "XML sintakses kļūdas. Aplūkojiet standarta izvadi, lai noskaidrotu vairāk. " "Pēdējā kļūda bija failā \"%s\" - %d rinda, kļūdas ziņojums: %s" -#: openbox/openbox.c:379 +#: openbox/openbox.c:381 msgid "Openbox Syntax Error" msgstr "Openbox sintakses kļūda" -#: openbox/openbox.c:379 +#: openbox/openbox.c:381 msgid "Close" msgstr "Aizvērt" -#: openbox/openbox.c:448 +#: openbox/openbox.c:463 #, c-format msgid "Restart failed to execute new executable \"%s\": %s" -msgstr "" +msgstr "Pārstartētājam neizdevās palaist jauno izpildāmo \"%s\": %s" -#: openbox/openbox.c:518 openbox/openbox.c:520 +#: openbox/openbox.c:533 openbox/openbox.c:535 msgid "Copyright (c)" -msgstr "Copyright (c)" +msgstr "Autortiesības (c)" -#: openbox/openbox.c:529 +#: openbox/openbox.c:544 msgid "Syntax: openbox [options]\n" -msgstr "Sintakse: openbox [iespējas]\n" +msgstr "Sintakse: openbox [opcijas]\n" -#: openbox/openbox.c:530 +#: openbox/openbox.c:545 msgid "" "\n" "Options:\n" msgstr "" "\n" -"Iespējas:\n" +"Opcijas:\n" -#: openbox/openbox.c:531 +#: openbox/openbox.c:546 msgid " --help Display this help and exit\n" msgstr " --help Parāda šo palīdzības tekstu un iziet\n" -#: openbox/openbox.c:532 +#: openbox/openbox.c:547 msgid " --version Display the version and exit\n" msgstr " --version Parāda versiju un iziet\n" -#: openbox/openbox.c:533 +#: openbox/openbox.c:548 msgid " --replace Replace the currently running window manager\n" msgstr " --replace Aizvieto pašreiz palaisto logu pārvaldnieku\n" #. TRANSLATORS: if you translate "FILE" here, make sure to keep the "Specify..." #. aligned still, if you have to, make a new line with \n and 22 spaces. It's #. fine to leave it as FILE though. -#: openbox/openbox.c:537 +#: openbox/openbox.c:552 msgid " --config-file FILE Specify the path to the config file to use\n" msgstr "" " --config-file FAILS Norāda ceļu uz izmantojamo konfigurācijas failu\n" -#: openbox/openbox.c:538 +#: openbox/openbox.c:553 msgid " --sm-disable Disable connection to the session manager\n" -msgstr " --sm-disable Atspējo savienojumu ar sesiju pārvaldnieku\n" +msgstr " --sm-disable Pārtrauc savienojumu ar sesiju pārvaldnieku\n" -#: openbox/openbox.c:539 +#: openbox/openbox.c:554 msgid "" "\n" "Passing messages to a running Openbox instance:\n" @@ -337,19 +329,19 @@ msgstr "" "\n" "Nodod ziņojumus esošai Openbox instancei:\n" -#: openbox/openbox.c:540 +#: openbox/openbox.c:555 msgid " --reconfigure Reload Openbox's configuration\n" msgstr " --reconfigure Pārlādē Openbox konfigurācijas failus\n" -#: openbox/openbox.c:541 +#: openbox/openbox.c:556 msgid " --restart Restart Openbox\n" msgstr " --restart Pārstartē Openbox\n" -#: openbox/openbox.c:542 +#: openbox/openbox.c:557 msgid " --exit Exit Openbox\n" msgstr " --exit Iziet no Openbox\n" -#: openbox/openbox.c:543 +#: openbox/openbox.c:558 msgid "" "\n" "Debugging options:\n" @@ -357,24 +349,24 @@ msgstr "" "\n" "Atkļūdošanas iespējas:\n" -#: openbox/openbox.c:544 +#: openbox/openbox.c:559 msgid " --sync Run in synchronous mode\n" msgstr " --sync Palaist sinhronajā režīmā\n" -#: openbox/openbox.c:545 +#: openbox/openbox.c:560 msgid " --debug Display debugging output\n" msgstr " --debug Rādīt atkļūdošanas izvadi\n" -#: openbox/openbox.c:546 +#: openbox/openbox.c:561 msgid " --debug-focus Display debugging output for focus handling\n" msgstr " --debug-focus Rādīt atkļūdošanas izvadi fokusēšanas darbībām\n" -#: openbox/openbox.c:547 +#: openbox/openbox.c:562 msgid " --debug-xinerama Split the display into fake xinerama screens\n" msgstr "" " --debug-xinerama Sadalīt displeju vairākos viltus xinerama ekrānos\n" -#: openbox/openbox.c:548 +#: openbox/openbox.c:563 #, c-format msgid "" "\n" @@ -383,26 +375,26 @@ msgstr "" "\n" "Lūdzu, ziņojiet kļūdas %s\n" -#: openbox/openbox.c:617 +#: openbox/openbox.c:645 msgid "--config-file requires an argument\n" msgstr "--config-file vajadzīgs arguments\n" -#: openbox/openbox.c:660 +#: openbox/openbox.c:688 #, c-format msgid "Invalid command line argument \"%s\"\n" msgstr "Neatļauts komandrindas arguments \"%s\"\n" -#: openbox/screen.c:102 openbox/screen.c:190 +#: openbox/screen.c:103 openbox/screen.c:191 #, c-format msgid "A window manager is already running on screen %d" -msgstr "Logu pārvaldnieks jau eksistē uz %d. ekrāna" +msgstr "Logu pārvaldnieks jau palaists uz %d. ekrāna" -#: openbox/screen.c:124 +#: openbox/screen.c:125 #, c-format msgid "Could not acquire window manager selection on screen %d" msgstr "Nevarēja iegūt logu pārvaldnieka izvēli uz %d. ekrāna" -#: openbox/screen.c:145 +#: openbox/screen.c:146 #, c-format msgid "The WM on screen %d is not exiting" msgstr "Logu pārvaldnieks uz %d. ekrāna nebeidz darbību" @@ -411,7 +403,7 @@ msgstr "Logu pārvaldnieks uz %d. ekrāna nebeidz darbību" #. arguments, you can use %1$d for the first one and %2$d for the #. second one. For example, #. "The current session has %2$d desktops, but Openbox is configured for %1$d ..." -#: openbox/screen.c:412 +#: openbox/screen.c:416 #, c-format msgid "" "Openbox is configured for %d desktop, but the current session has %d. " @@ -429,27 +421,27 @@ msgstr[2] "" "Openbox ir konfigurēts %d darbvirsmām, bet pašreizējai sesijai tādu ir %d. " "Šī Openbox konfigurācijas opcija tiks ignorēta." -#: openbox/screen.c:1180 +#: openbox/screen.c:1199 #, c-format msgid "desktop %i" msgstr "darbvirsma %i" -#: openbox/session.c:104 +#: openbox/session.c:105 #, c-format msgid "Unable to make directory \"%s\": %s" -msgstr "Nav iespējams izveidot mapi \"%s\": %s" +msgstr "Nevarēja izveidot mapi \"%s\": %s" -#: openbox/session.c:466 +#: openbox/session.c:472 #, c-format msgid "Unable to save the session to \"%s\": %s" -msgstr "Nav iespējams saglabāt sesiju \"%s\": %s" +msgstr "Neizdevās saglabāt sesiju \"%s\": %s" -#: openbox/session.c:605 +#: openbox/session.c:611 #, c-format msgid "Error while saving the session to \"%s\": %s" msgstr "Kļūda saglabājot sesiju \"%s\": %s" -#: openbox/session.c:842 +#: openbox/session.c:848 msgid "Not connected to a session manager" msgstr "Nav savienots ar sesiju pārvaldnieku" @@ -486,3 +478,10 @@ msgstr "X kļūda: %s" #: openbox/prompt.c:200 msgid "OK" msgstr "Labi" + +#~ msgid "" +#~ "The SessionLogout action is not available since Openbox was built without " +#~ "session management support" +#~ msgstr "" +#~ "Darbība 'SessionLogout' nav pieejama, jo Openbox ir kompilēts bez sesiju " +#~ "pārvaldības atbalsta" From d3a01a40f35cb3ae6c5ad8329291e86e2e599691 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 11 Jan 2010 11:02:48 -0500 Subject: [PATCH 09/16] If a window is added to the focus order while focus cycling, stop the focus cycling istead of crashing (See bug #4411) --- openbox/focus_cycle.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/openbox/focus_cycle.c b/openbox/focus_cycle.c index c92b5a54..5849d7d6 100644 --- a/openbox/focus_cycle.c +++ b/openbox/focus_cycle.c @@ -55,10 +55,18 @@ void focus_cycle_stop(ObClient *ifclient) { /* stop focus cycling if the given client is a valid focus target, and so the cycling is being disrupted */ - if (focus_cycle_target && - ((ifclient && (ifclient == focus_cycle_target || - focus_cycle_popup_is_showing(ifclient))) || - !ifclient)) + if (focus_cycle_target && ifclient && + /* shortcut check, it is what we are pointing at right now */ + (ifclient == focus_cycle_target || + /* it's shown but it shouldn't be anymore */ + focus_cycle_popup_is_showing(ifclient) || + /* it's not shown but it should be */ + focus_valid_target(ifclient, TRUE, + focus_cycle_iconic_windows, + focus_cycle_all_desktops, + focus_cycle_dock_windows, + focus_cycle_desktop_windows, + FALSE))) { focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,TRUE); focus_directional_cycle(0, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); From 12653a4153bccd5d9a46998753e7a1bc17479505 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 11 Jan 2010 12:47:59 -0500 Subject: [PATCH 10/16] Redraw the focus cycle popup when the list of focusable windows changes, rather than closing it --- openbox/client.c | 3 ++ openbox/client.h | 1 + openbox/focus.c | 12 ++++-- openbox/focus_cycle.c | 82 +++++++++++++++++++++++++++++-------- openbox/focus_cycle.h | 4 +- openbox/focus_cycle_popup.c | 73 ++++++++++++++++++++++++++------- openbox/focus_cycle_popup.h | 10 ++++- openbox/screen.c | 6 +-- 8 files changed, 148 insertions(+), 43 deletions(-) diff --git a/openbox/client.c b/openbox/client.c index e3a7d6ec..ae87ff0b 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -304,6 +304,7 @@ void client_manage(Window window, ObPrompt *prompt) self->obwin.type = Window_Client; self->window = window; self->prompt = prompt; + self->managed = TRUE; /* non-zero defaults */ self->wmstate = WithdrawnState; /* make sure it gets updated first time */ @@ -633,6 +634,8 @@ void client_unmanage(ObClient *self) mouse_grab_for_client(self, FALSE); + self->managed = FALSE; + /* remove the window from our save set, unless we are managing an internal ObPrompt window */ if (!self->prompt) diff --git a/openbox/client.h b/openbox/client.h index 3b1e042c..e5a61d53 100644 --- a/openbox/client.h +++ b/openbox/client.h @@ -73,6 +73,7 @@ struct _ObClient { ObWindow obwin; Window window; + gboolean managed; /*! If this client is managing an ObPrompt window, then this is set to the prompt */ diff --git a/openbox/focus.c b/openbox/focus.c index a0e9c666..c82c4f62 100644 --- a/openbox/focus.c +++ b/openbox/focus.c @@ -98,6 +98,9 @@ void focus_set_client(ObClient *client) PROP_SET32(RootWindow(ob_display, ob_screen), net_active_window, window, active); } + + /* make sure the focus cycle popup shows things in the right order */ + focus_cycle_reorder(); } static ObClient* focus_fallback_target(gboolean allow_refocus, @@ -206,16 +209,14 @@ void focus_order_add_new(ObClient *c) focus_order = g_list_insert(focus_order, c, 1); } - /* in the middle of cycling..? kill it. */ - focus_cycle_stop(c); + focus_cycle_add(c); } void focus_order_remove(ObClient *c) { focus_order = g_list_remove(focus_order, c); - /* in the middle of cycling..? kill it. */ - focus_cycle_stop(c); + focus_cycle_remove(c); } void focus_order_to_top(ObClient *c) @@ -293,6 +294,9 @@ gboolean focus_valid_target(ObClient *ft, { gboolean ok = FALSE; + /* see if the window is still managed or is going away */ + if (!ft->managed) return FALSE; + /* it's on this desktop unless you want all desktops. do this check first because it will usually filter out the most diff --git a/openbox/focus_cycle.c b/openbox/focus_cycle.c index 5849d7d6..07cc2e83 100644 --- a/openbox/focus_cycle.c +++ b/openbox/focus_cycle.c @@ -31,6 +31,7 @@ #include ObClient *focus_cycle_target = NULL; +static gboolean focus_cycle_directional = FALSE; static gboolean focus_cycle_iconic_windows; static gboolean focus_cycle_all_desktops; static gboolean focus_cycle_dock_windows; @@ -51,26 +52,64 @@ void focus_cycle_shutdown(gboolean reconfig) if (reconfig) return; } -void focus_cycle_stop(ObClient *ifclient) +void focus_cycle_add(ObClient *ifclient) { - /* stop focus cycling if the given client is a valid focus target, - and so the cycling is being disrupted */ - if (focus_cycle_target && ifclient && - /* shortcut check, it is what we are pointing at right now */ - (ifclient == focus_cycle_target || - /* it's shown but it shouldn't be anymore */ - focus_cycle_popup_is_showing(ifclient) || - /* it's not shown but it should be */ - focus_valid_target(ifclient, TRUE, - focus_cycle_iconic_windows, - focus_cycle_all_desktops, - focus_cycle_dock_windows, - focus_cycle_desktop_windows, - FALSE))) - { - focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,TRUE); - focus_directional_cycle(0, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); + if (!(focus_cycle_target && ifclient && !focus_cycle_directional)) + return; + + if (focus_valid_target(ifclient, TRUE, + focus_cycle_iconic_windows, + focus_cycle_all_desktops, + focus_cycle_dock_windows, + focus_cycle_desktop_windows, + FALSE)) + focus_cycle_popup_refresh(focus_cycle_target, + focus_cycle_iconic_windows, + focus_cycle_all_desktops, + focus_cycle_dock_windows, + focus_cycle_desktop_windows); +} + +void focus_cycle_remove(ObClient *ifclient) +{ + if (!(focus_cycle_target && ifclient)) + return; + + if (focus_cycle_directional) { + if (focus_cycle_target == ifclient) { + focus_directional_cycle(0, TRUE, TRUE, TRUE, TRUE, + TRUE, TRUE, TRUE); + } } + else { + if (!focus_valid_target(ifclient, TRUE, + focus_cycle_iconic_windows, + focus_cycle_all_desktops, + focus_cycle_dock_windows, + focus_cycle_desktop_windows, + FALSE)) { + if (focus_cycle_target == ifclient) { + focus_cycle_target = + focus_cycle_popup_revert(focus_cycle_target); + focus_cycle_update_indicator(focus_cycle_target); + } + focus_cycle_popup_refresh(focus_cycle_target, + focus_cycle_iconic_windows, + focus_cycle_all_desktops, + focus_cycle_dock_windows, + focus_cycle_desktop_windows); + } + } +} + +void focus_cycle_reorder() +{ + if (focus_cycle_target && !focus_cycle_directional) + focus_cycle_popup_refresh(focus_cycle_target, + focus_cycle_iconic_windows, + focus_cycle_all_desktops, + focus_cycle_dock_windows, + focus_cycle_desktop_windows); } ObClient* focus_cycle(gboolean forward, gboolean all_desktops, @@ -87,6 +126,7 @@ ObClient* focus_cycle(gboolean forward, gboolean all_desktops, if (interactive) { if (cancel) { focus_cycle_target = NULL; + focus_cycle_directional = FALSE; goto done_cycle; } else if (done) goto done_cycle; @@ -134,6 +174,7 @@ ObClient* focus_cycle(gboolean forward, gboolean all_desktops, if (interactive) { if (ft != focus_cycle_target) { /* prevents flicker */ focus_cycle_target = ft; + focus_cycle_directional = FALSE; focus_cycle_draw_indicator(showbar ? ft : NULL); } if (dialog) @@ -146,6 +187,7 @@ ObClient* focus_cycle(gboolean forward, gboolean all_desktops, return focus_cycle_target; } else if (ft != focus_cycle_target) { focus_cycle_target = ft; + focus_cycle_directional = FALSE; done = TRUE; break; } @@ -156,6 +198,7 @@ done_cycle: if (done && !cancel) ret = focus_cycle_target; focus_cycle_target = NULL; + focus_cycle_directional = FALSE; g_list_free(order); order = NULL; @@ -275,6 +318,7 @@ ObClient* focus_directional_cycle(ObDirection dir, gboolean dock_windows, if (cancel) { focus_cycle_target = NULL; + focus_cycle_directional = FALSE; goto done_cycle; } else if (done && interactive) goto done_cycle; @@ -310,6 +354,7 @@ ObClient* focus_directional_cycle(ObDirection dir, gboolean dock_windows, if (ft && ft != focus_cycle_target) {/* prevents flicker */ focus_cycle_target = ft; + focus_cycle_directional = TRUE; if (!interactive) goto done_cycle; focus_cycle_draw_indicator(showbar ? ft : NULL); @@ -328,6 +373,7 @@ done_cycle: first = NULL; focus_cycle_target = NULL; + focus_cycle_directional = FALSE; focus_cycle_draw_indicator(NULL); focus_cycle_popup_single_hide(); diff --git a/openbox/focus_cycle.h b/openbox/focus_cycle.h index 6e1c2c9d..c074a52b 100644 --- a/openbox/focus_cycle.h +++ b/openbox/focus_cycle.h @@ -47,6 +47,8 @@ struct _ObClient* focus_directional_cycle(ObDirection dir, gboolean dialog, gboolean done, gboolean cancel); -void focus_cycle_stop(struct _ObClient *ifclient); +void focus_cycle_add(struct _ObClient *ifclient); +void focus_cycle_remove(struct _ObClient *ifclient); +void focus_cycle_reorder(); #endif diff --git a/openbox/focus_cycle_popup.c b/openbox/focus_cycle_popup.c index d01be03c..aff84579 100644 --- a/openbox/focus_cycle_popup.c +++ b/openbox/focus_cycle_popup.c @@ -217,6 +217,22 @@ static void popup_setup(ObFocusCyclePopup *p, gboolean create_targets, p->maxtextw = maxwidth; } +static void popup_cleanup(void) +{ + while(popup.targets) { + ObFocusCyclePopupTarget *t = popup.targets->data; + + RrImageUnref(t->icon); + g_free(t->text); + XDestroyWindow(ob_display, t->win); + g_free(t); + + popup.targets = g_list_delete_link(popup.targets, popup.targets); + } + popup.n_targets = 0; + popup.last_target = NULL; +} + static gchar *popup_get_name(ObClient *c) { ObClient *p; @@ -479,18 +495,7 @@ void focus_cycle_popup_hide(void) popup.mapped = FALSE; - while(popup.targets) { - ObFocusCyclePopupTarget *t = popup.targets->data; - - RrImageUnref(t->icon); - g_free(t->text); - XDestroyWindow(ob_display, t->win); - g_free(t); - - popup.targets = g_list_delete_link(popup.targets, popup.targets); - } - popup.n_targets = 0; - popup.last_target = NULL; + popup_cleanup(); g_free(popup.hilite_rgba); popup.hilite_rgba = NULL; @@ -536,7 +541,7 @@ void focus_cycle_popup_single_hide(void) icon_popup_hide(single_popup); } -gboolean focus_cycle_popup_is_showing(ObClient *client) +GList* focus_cycle_popup_is_showing(ObClient *client) { if (popup.mapped) { GList *it; @@ -544,8 +549,46 @@ gboolean focus_cycle_popup_is_showing(ObClient *client) for (it = popup.targets; it; it = g_list_next(it)) { ObFocusCyclePopupTarget *t = it->data; if (t->client == client) - return TRUE; + return it; } } - return FALSE; + return NULL; +} + +ObClient* focus_cycle_popup_revert(ObClient *target) +{ + GList *it; + + if (!popup.mapped) return NULL; + + for (it = popup.targets; it; it = g_list_next(it)) { + ObFocusCyclePopupTarget *t = it->data; + if (t->client == target) { + if (it->prev) + return ((ObFocusCyclePopupTarget*)it->prev->data)->client; + else if (it->next) + return ((ObFocusCyclePopupTarget*)it->next->data)->client; + else + return NULL; + } + } + g_assert_not_reached(); +} + +void focus_cycle_popup_refresh(ObClient *target, + gboolean iconic_windows, + gboolean all_desktops, + gboolean dock_windows, + gboolean desktop_windows) +{ + if (!popup.mapped) return; + + popup_cleanup(); + popup_setup(&popup, TRUE, iconic_windows, all_desktops, + dock_windows, desktop_windows); + + popup.mapped = FALSE; + popup_render(&popup, target); + XFlush(ob_display); + popup.mapped = TRUE; } diff --git a/openbox/focus_cycle_popup.h b/openbox/focus_cycle_popup.h index 19279a62..b4c9e350 100644 --- a/openbox/focus_cycle_popup.h +++ b/openbox/focus_cycle_popup.h @@ -39,7 +39,13 @@ void focus_cycle_popup_single_show(struct _ObClient *c, gboolean desktop_windows); void focus_cycle_popup_single_hide(); -/*! Returns TRUE if the popup is showing the client, otherwise FALSE. */ -gboolean focus_cycle_popup_is_showing(struct _ObClient *client); +/*! Reverts from the current @target to a new focus cycle target window */ +struct _ObClient* focus_cycle_popup_revert(struct _ObClient *target); +/*! Redraws the focus cycle popup */ +void focus_cycle_popup_refresh(struct _ObClient *target, + gboolean iconic_windows, + gboolean all_desktops, + gboolean dock_windows, + gboolean desktop_windows); #endif diff --git a/openbox/screen.c b/openbox/screen.c index d88be432..075d3074 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -708,7 +708,8 @@ void screen_set_desktop(guint num, gboolean dofocus) for (it = stacking_list; it; it = g_list_next(it)) { if (WINDOW_IS_CLIENT(it->data)) { ObClient *c = it->data; - client_show(c); + if (client_show(c)) + focus_cycle_add(c); } } @@ -719,8 +720,7 @@ void screen_set_desktop(guint num, gboolean dofocus) if (WINDOW_IS_CLIENT(it->data)) { ObClient *c = it->data; if (client_hide(c)) { - /* in the middle of cycling..? kill it. */ - focus_cycle_stop(c); + focus_cycle_remove(c); if (c == focus_client) { /* c was focused and we didn't do fallback clearly so make From b8e994e837d260860a4dc0a1ee3a680e2cdfc75a Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 11 Jan 2010 13:12:09 -0500 Subject: [PATCH 11/16] Reuse ObFocusCyclePopupTargets when refreshing the focus cycle dialog --- openbox/focus_cycle_popup.c | 150 +++++++++++++++++++++++++----------- 1 file changed, 103 insertions(+), 47 deletions(-) diff --git a/openbox/focus_cycle_popup.c b/openbox/focus_cycle_popup.c index aff84579..b97bc97b 100644 --- a/openbox/focus_cycle_popup.c +++ b/openbox/focus_cycle_popup.c @@ -75,15 +75,16 @@ static ObFocusCyclePopup popup; /*! This popup shows a single window */ static ObIconPopup *single_popup; -static gchar *popup_get_name (ObClient *c); -static void popup_setup (ObFocusCyclePopup *p, - gboolean create_targets, - gboolean iconic_windows, - gboolean all_desktops, - gboolean dock_windows, - gboolean desktop_windows); -static void popup_render (ObFocusCyclePopup *p, - const ObClient *c); +static gchar *popup_get_name (ObClient *c); +static gboolean popup_setup (ObFocusCyclePopup *p, + gboolean create_targets, + gboolean refresh_targets, + gboolean iconic_windows, + gboolean all_desktops, + gboolean dock_windows, + gboolean desktop_windows); +static void popup_render (ObFocusCyclePopup *p, + const ObClient *c); static Window create_window(Window parent, guint bwidth, gulong mask, XSetWindowAttributes *attr) @@ -162,12 +163,36 @@ void focus_cycle_popup_shutdown(gboolean reconfig) RrAppearanceFree(popup.a_bg); } -static void popup_setup(ObFocusCyclePopup *p, gboolean create_targets, - gboolean iconic_windows, gboolean all_desktops, - gboolean dock_windows, gboolean desktop_windows) +static void popup_target_free(ObFocusCyclePopupTarget *t) +{ + RrImageUnref(t->icon); + g_free(t->text); + XDestroyWindow(ob_display, t->win); + g_free(t); +} + +static gboolean popup_setup(ObFocusCyclePopup *p, gboolean create_targets, + gboolean refresh_targets, + gboolean iconic_windows, gboolean all_desktops, + gboolean dock_windows, gboolean desktop_windows) { gint maxwidth, n; GList *it; + GList *rtargets; /* old targets for refresh */ + GList *rtlast; + gboolean change; + + if (refresh_targets) { + rtargets = p->targets; + rtlast = g_list_last(rtargets); + p->targets = NULL; + p->n_targets = 0; + change = FALSE; + } + else { + rtargets = rtlast = NULL; + change = TRUE; + } g_assert(p->targets == NULL); g_assert(p->n_targets == 0); @@ -188,45 +213,76 @@ static void popup_setup(ObFocusCyclePopup *p, gboolean create_targets, desktop_windows, FALSE)) { - gchar *text = popup_get_name(ft); + GList *rit; - /* measure */ - p->a_text->texture[0].data.text.string = text; - maxwidth = MAX(maxwidth, RrMinWidth(p->a_text)); + /* reuse the target if possible during refresh */ + for (rit = rtlast; rit; rit = g_list_previous(rit)) { + ObFocusCyclePopupTarget *t = rit->data; + if (t->client == ft) { + if (rit == rtlast) + rtlast = g_list_previous(rit); + rtargets = g_list_remove_link(rtargets, rit); - if (!create_targets) - g_free(text); - else { - ObFocusCyclePopupTarget *t = g_new(ObFocusCyclePopupTarget, 1); + p->targets = g_list_concat(rit, p->targets); + ++n; - t->client = ft; - t->text = text; - t->icon = client_icon(t->client); - RrImageRef(t->icon); /* own the icon so it won't go away */ - t->win = create_window(p->bg, 0, 0, NULL); - - XMapWindow(ob_display, t->win); - - p->targets = g_list_prepend(p->targets, t); - ++n; + if (rit != rtlast) + change = TRUE; /* order changed */ + break; + } } + + if (!rit) { + gchar *text = popup_get_name(ft); + + /* measure */ + p->a_text->texture[0].data.text.string = text; + maxwidth = MAX(maxwidth, RrMinWidth(p->a_text)); + + if (!create_targets) + g_free(text); + else { + ObFocusCyclePopupTarget *t = + g_new(ObFocusCyclePopupTarget, 1); + + t->client = ft; + t->text = text; + t->icon = client_icon(t->client); + RrImageRef(t->icon); /* own the icon so it won't go away */ + t->win = create_window(p->bg, 0, 0, NULL); + + XMapWindow(ob_display, t->win); + + p->targets = g_list_prepend(p->targets, t); + ++n; + + change = TRUE; /* added a window */ + } + } + } + } + + if (rtargets) { + change = TRUE; /* removed a window */ + + while (rtargets) { + popup_target_free(rtargets->data); + rtargets = g_list_delete_link(rtargets, rtargets); + + popup.targets = g_list_delete_link(popup.targets, popup.targets); } } p->n_targets = n; p->maxtextw = maxwidth; + + return change; } static void popup_cleanup(void) { while(popup.targets) { - ObFocusCyclePopupTarget *t = popup.targets->data; - - RrImageUnref(t->icon); - g_free(t->text); - XDestroyWindow(ob_display, t->win); - g_free(t); - + popup_target_free(popup.targets->data); popup.targets = g_list_delete_link(popup.targets, popup.targets); } popup.n_targets = 0; @@ -467,7 +523,7 @@ void focus_cycle_popup_show(ObClient *c, gboolean iconic_windows, /* do this stuff only when the dialog is first showing */ if (!popup.mapped) - popup_setup(&popup, TRUE, iconic_windows, all_desktops, + popup_setup(&popup, TRUE, FALSE, iconic_windows, all_desktops, dock_windows, desktop_windows); g_assert(popup.targets != NULL); @@ -515,7 +571,7 @@ void focus_cycle_popup_single_show(struct _ObClient *c, if (!popup.mapped) { Rect *a; - popup_setup(&popup, FALSE, iconic_windows, all_desktops, + popup_setup(&popup, FALSE, FALSE, iconic_windows, all_desktops, dock_windows, desktop_windows); g_assert(popup.targets == NULL); @@ -583,12 +639,12 @@ void focus_cycle_popup_refresh(ObClient *target, { if (!popup.mapped) return; - popup_cleanup(); - popup_setup(&popup, TRUE, iconic_windows, all_desktops, - dock_windows, desktop_windows); - - popup.mapped = FALSE; - popup_render(&popup, target); - XFlush(ob_display); - popup.mapped = TRUE; + if (popup_setup(&popup, TRUE, TRUE, iconic_windows, all_desktops, + dock_windows, desktop_windows)) + { + popup.mapped = FALSE; + popup_render(&popup, target); + XFlush(ob_display); + popup.mapped = TRUE; + } } From 91af4d5bc9e04b766735aaa3ac098233ba103959 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 11 Jan 2010 13:42:50 -0500 Subject: [PATCH 12/16] Add _OB_VERSION and _OB_APP_ROLE/CLASS/NAME/TYPE Add _OB_VERSION property on the root window. Change _OB_ROLE/CLASS/NAME to _OB_APP_*. Add _OB_APP_TYPE which has a string for the type chosen for the window on mapping by Openbox. Adjust the rc.xml to match these changes. --- configure.ac | 2 +- data/rc.xml | 15 +++++++-------- openbox/client.c | 41 +++++++++++++++++++++++++++++++++-------- openbox/prop.c | 8 +++++--- openbox/prop.h | 8 +++++--- openbox/screen.c | 11 ++++++++--- version.h.in | 2 +- 7 files changed, 60 insertions(+), 27 deletions(-) diff --git a/configure.ac b/configure.ac index bba1b5c6..eb11c03f 100644 --- a/configure.ac +++ b/configure.ac @@ -18,7 +18,7 @@ OB_MINOR_VERSION=4 OB_MICRO_VERSION=16 OB_INTERFACE_AGE=0 OB_BINARY_AGE=0 -OB_VERSION=$OB_MAJOR_VERSION.$OB_MINOR_VERSION +OB_VERSION=$PACKAGE_VERSION AC_SUBST(OB_MAJOR_VERSION) AC_SUBST(OB_MINOR_VERSION) diff --git a/data/rc.xml b/data/rc.xml index c89625dd..a576ca60 100644 --- a/data/rc.xml +++ b/data/rc.xml @@ -653,14 +653,13 @@ # this is an example with comments through out. use these to make your # own rules, but without the comments of course. - - # the name or the class can be set, or both. this is used to match - # windows when they appear. role can optionally be set as well, to - # further restrict your matches. + # you may set only one of name/class/role/type, or you may use more than one + # together to restrict your matches. # the name, class, and role use simple wildcard matching such as those # used by a shell. you can use * to match any characters and ? to match @@ -673,7 +672,7 @@ # order that they appear in this list - # each element can be left out or set to 'default' to specify to not + # each rule element can be left out or set to 'default' to specify to not # change that attribute of the window yes diff --git a/openbox/client.c b/openbox/client.c index ae87ff0b..6799654e 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -76,7 +76,7 @@ static RrImage *client_default_icon = NULL; static void client_get_all(ObClient *self, gboolean real); static void client_get_startup_id(ObClient *self); static void client_get_session_ids(ObClient *self); -static void client_save_session_ids(ObClient *self); +static void client_save_app_rule_values(ObClient *self); static void client_get_area(ObClient *self); static void client_get_desktop(ObClient *self); static void client_get_state(ObClient *self); @@ -1163,7 +1163,9 @@ static void client_get_all(ObClient *self, gboolean real) /* get the session related properties, these can change decorations from per-app settings */ client_get_session_ids(self); - client_save_session_ids(self); + + /* save the values of the variables used for app rule matching */ + client_save_app_rule_values(self); /* now we got everything that can affect the decorations */ if (!real) @@ -2372,13 +2374,36 @@ static void client_get_session_ids(ObClient *self) } } -/*! Save the session IDs as seen by Openbox when the window mapped, so that - users can still access them later if the app changes them */ -static void client_save_session_ids(ObClient *self) +/*! Save the properties used for app matching rules, as seen by Openbox when + the window mapped, so that users can still access them later if the app + changes them */ +static void client_save_app_rule_values(ObClient *self) { - PROP_SETS(self->window, ob_role, self->role); - PROP_SETS(self->window, ob_name, self->name); - PROP_SETS(self->window, ob_class, self->class); + const gchar *type; + + PROP_SETS(self->window, ob_app_role, self->role); + PROP_SETS(self->window, ob_app_name, self->name); + PROP_SETS(self->window, ob_app_class, self->class); + + switch (self->type) { + case OB_CLIENT_TYPE_NORMAL: + type = "normal"; break; + case OB_CLIENT_TYPE_DIALOG: + type = "dialog"; break; + case OB_CLIENT_TYPE_UTILITY: + type = "utility"; break; + case OB_CLIENT_TYPE_MENU: + type = "menu"; break; + case OB_CLIENT_TYPE_TOOLBAR: + type = "toolbar"; break; + case OB_CLIENT_TYPE_SPLASH: + type = "splash"; break; + case OB_CLIENT_TYPE_DESKTOP: + type = "desktop"; break; + case OB_CLIENT_TYPE_DOCK: + type = "dock"; break; + } + PROP_SETS(self->window, ob_app_type, type); } static void client_change_wm_state(ObClient *self) diff --git a/openbox/prop.c b/openbox/prop.c index b21b3f53..5184edae 100644 --- a/openbox/prop.c +++ b/openbox/prop.c @@ -179,9 +179,11 @@ void prop_startup(void) CREATE(ob_wm_action_undecorate, "_OB_WM_ACTION_UNDECORATE"); CREATE(ob_wm_state_undecorated, "_OB_WM_STATE_UNDECORATED"); CREATE(ob_control, "_OB_CONTROL"); - CREATE(ob_role, "_OB_ROLE"); - CREATE(ob_name, "_OB_NAME"); - CREATE(ob_class, "_OB_CLASS"); + CREATE(ob_version, "_OB_VERSION"); + CREATE(ob_app_role, "_OB_APP_ROLE"); + CREATE(ob_app_name, "_OB_APP_NAME"); + CREATE(ob_app_class, "_OB_APP_CLASS"); + CREATE(ob_app_type, "_OB_APP_TYPE"); } #include diff --git a/openbox/prop.h b/openbox/prop.h index 419aa512..71645673 100644 --- a/openbox/prop.h +++ b/openbox/prop.h @@ -202,9 +202,11 @@ typedef struct Atoms { Atom ob_theme; Atom ob_config_file; Atom ob_control; - Atom ob_role; - Atom ob_name; - Atom ob_class; + Atom ob_version; + Atom ob_app_role; + Atom ob_app_name; + Atom ob_app_class; + Atom ob_app_type; } Atoms; extern Atoms prop_atoms; diff --git a/openbox/screen.c b/openbox/screen.c index 075d3074..5ae07907 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -303,15 +303,20 @@ gboolean screen_annex(void) supported[i++] = prop_atoms.ob_theme; supported[i++] = prop_atoms.ob_config_file; supported[i++] = prop_atoms.ob_control; - supported[i++] = prop_atoms.ob_role; - supported[i++] = prop_atoms.ob_name; - supported[i++] = prop_atoms.ob_class; + supported[i++] = prop_atoms.ob_version; + supported[i++] = prop_atoms.ob_app_role; + supported[i++] = prop_atoms.ob_app_name; + supported[i++] = prop_atoms.ob_app_class; + supported[i++] = prop_atoms.ob_app_type; g_assert(i == num_support); PROP_SETA32(RootWindow(ob_display, ob_screen), net_supported, atom, supported, num_support); g_free(supported); + PROP_SETS(RootWindow(ob_display, ob_screen), ob_version, + OB_VERSION); + screen_tell_ksplash(); return TRUE; diff --git a/version.h.in b/version.h.in index da3f02ef..70cfcec6 100644 --- a/version.h.in +++ b/version.h.in @@ -4,7 +4,7 @@ #define OB_MAJOR_VERSION @OB_MAJOR_VERSION@ #define OB_MINOR_VERSION @OB_MINOR_VERSION@ #define OB_MICRO_VERSION @OB_MICRO_VERSION@ -#define OB_VERSION OB_MAJOR_VERSION.OB_MINOR_VERSION.OB_MICRO_VERSION +#define OB_VERSION "@OB_VERSION@" #define OB_CHECK_VERSION(major,minor,micro) \ (OB_MAJOR_VERSION > (major) || \ From 358056b102f633cb63ac7b9aa0cfdd25af77ddf3 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 11 Jan 2010 13:43:25 -0500 Subject: [PATCH 13/16] When a user id is specified, or --root, use the ID directly, don't try find a client child of it --- tools/obxprop/obxprop.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/obxprop/obxprop.c b/tools/obxprop/obxprop.c index 2e6b2a03..44b33041 100644 --- a/tools/obxprop/obxprop.c +++ b/tools/obxprop/obxprop.c @@ -334,9 +334,10 @@ int main(int argc, char **argv) break; } } + id = find_client(d, userid); } - - id = find_client(d, userid); + else + id = userid; /* they picked this one */ if (id == None) return fail("Unable to find window with the requested ID"); From 14180a6b0dee05e73fd193db28fd94b4ef3046d1 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 11 Jan 2010 15:13:55 -0500 Subject: [PATCH 14/16] More work on refreshing the focus cycle dialog when windows are added/removed from the valid focus order --- openbox/client.c | 18 ++++-- openbox/focus.c | 26 ++++++-- openbox/focus.h | 4 ++ openbox/focus_cycle.c | 118 ++++++++++++++++-------------------- openbox/focus_cycle.h | 6 +- openbox/focus_cycle_popup.c | 98 +++++++++++++++--------------- openbox/focus_cycle_popup.h | 16 ++--- openbox/screen.c | 7 +-- 8 files changed, 152 insertions(+), 141 deletions(-) diff --git a/openbox/client.c b/openbox/client.c index 6799654e..afea324b 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -34,6 +34,7 @@ #include "grab.h" #include "prompt.h" #include "focus.h" +#include "focus_cycle.h" #include "stacking.h" #include "openbox.h" #include "group.h" @@ -1996,6 +1997,8 @@ void client_update_wmhints(ObClient *self) XFree(hints); } + + focus_cycle_addremove(self, TRUE); } void client_update_title(ObClient *self) @@ -3254,7 +3257,7 @@ static void client_iconify_recursive(ObClient *self, self->iconic = iconic; /* update the focus lists.. iconic windows go to the bottom of - the list */ + the list. this will also call focus_cycle_addremove(). */ focus_order_to_bottom(self); changed = TRUE; @@ -3266,9 +3269,10 @@ static void client_iconify_recursive(ObClient *self, self->desktop != DESKTOP_ALL) client_set_desktop(self, screen_desktop, FALSE, FALSE); - /* this puts it after the current focused window */ - focus_order_remove(self); - focus_order_add_new(self); + /* this puts it after the current focused window, this will + also cause focus_cycle_addremove() to be called for the + client */ + focus_order_like_new(self); changed = TRUE; } @@ -3601,6 +3605,8 @@ static void client_set_desktop_recursive(ObClient *self, /* the new desktop's geometry may be different, so we may need to resize, for example if we are maximized */ client_reconfigure(self, FALSE); + + focus_cycle_addremove(self, FALSE); } /* move all transients */ @@ -3616,6 +3622,8 @@ void client_set_desktop(ObClient *self, guint target, { self = client_search_top_direct_parent(self); client_set_desktop_recursive(self, target, donthide, dontraise); + + focus_cycle_addremove(NULL, TRUE); } gboolean client_is_direct_child(ObClient *parent, ObClient *child) @@ -3864,6 +3872,8 @@ void client_set_state(ObClient *self, Atom action, glong data1, glong data2) client_hilite(self, demands_attention); client_change_state(self); /* change the hint to reflect these changes */ + + focus_cycle_addremove(self, TRUE); } ObClient *client_focus_target(ObClient *self) diff --git a/openbox/focus.c b/openbox/focus.c index c82c4f62..36d754f4 100644 --- a/openbox/focus.c +++ b/openbox/focus.c @@ -90,6 +90,9 @@ void focus_set_client(ObClient *client) push_to_top(client); /* remove hiliting from the window when it gets focused */ client_hilite(client, FALSE); + + /* make sure the focus cycle popup shows things in the right order */ + focus_cycle_reorder(); } /* set the NET_ACTIVE_WINDOW hint, but preserve it on shutdown */ @@ -98,9 +101,6 @@ void focus_set_client(ObClient *client) PROP_SET32(RootWindow(ob_display, ob_screen), net_active_window, window, active); } - - /* make sure the focus cycle popup shows things in the right order */ - focus_cycle_reorder(); } static ObClient* focus_fallback_target(gboolean allow_refocus, @@ -201,7 +201,7 @@ void focus_order_add_new(ObClient *c) focus_order_to_top(c); else { g_assert(!g_list_find(focus_order, c)); - /* if there are any iconic windows, put this above them in the order, + /* if there are only iconic windows, put this above them in the order, but if there are not, then put it under the currently focused one */ if (focus_order && ((ObClient*)focus_order->data)->iconic) focus_order = g_list_insert(focus_order, c, 0); @@ -209,14 +209,20 @@ void focus_order_add_new(ObClient *c) focus_order = g_list_insert(focus_order, c, 1); } - focus_cycle_add(c); + focus_cycle_addremove(c, TRUE); } void focus_order_remove(ObClient *c) { focus_order = g_list_remove(focus_order, c); - focus_cycle_remove(c); + focus_cycle_addremove(c, TRUE); +} + +void focus_order_like_new(struct _ObClient *c) +{ + focus_order = g_list_remove(focus_order, c); + focus_order_add_new(c); } void focus_order_to_top(ObClient *c) @@ -232,6 +238,8 @@ void focus_order_to_top(ObClient *c) it && !((ObClient*)it->data)->iconic; it = g_list_next(it)); focus_order = g_list_insert_before(focus_order, it, c); } + + focus_cycle_reorder(); } void focus_order_to_bottom(ObClient *c) @@ -247,6 +255,8 @@ void focus_order_to_bottom(ObClient *c) it && !((ObClient*)it->data)->iconic; it = g_list_next(it)); focus_order = g_list_insert_before(focus_order, it, c); } + + focus_cycle_reorder(); } ObClient *focus_order_find_first(guint desktop) @@ -292,6 +302,10 @@ gboolean focus_valid_target(ObClient *ft, gboolean desktop_windows, gboolean user_request) { + /* NOTE: if any of these things change on a client, then they should call + focus_cycle_addremove() to make sure the client is not shown/hidden + when it should not be */ + gboolean ok = FALSE; /* see if the window is still managed or is going away */ diff --git a/openbox/focus.h b/openbox/focus.h index 19ab406e..c8af1101 100644 --- a/openbox/focus.h +++ b/openbox/focus.h @@ -58,6 +58,10 @@ void focus_order_remove(struct _ObClient *c); /*! Move a client to the top of the focus order */ void focus_order_to_top(struct _ObClient *c); +/*! Move a client to where it would be if it was newly added to the focus order + */ +void focus_order_like_new(struct _ObClient *c); + /*! Move a client to the bottom of the focus order (keeps iconic windows at the very bottom always though). */ void focus_order_to_bottom(struct _ObClient *c); diff --git a/openbox/focus_cycle.c b/openbox/focus_cycle.c index 07cc2e83..40436683 100644 --- a/openbox/focus_cycle.c +++ b/openbox/focus_cycle.c @@ -30,8 +30,14 @@ #include #include +typedef enum { + OB_CYCLE_NONE = 0, + OB_CYCLE_NORMAL, + OB_CYCLE_DIRECTIONAL +} ObCycleType; + ObClient *focus_cycle_target = NULL; -static gboolean focus_cycle_directional = FALSE; +static ObCycleType focus_cycle_type = OB_CYCLE_NONE; static gboolean focus_cycle_iconic_windows; static gboolean focus_cycle_all_desktops; static gboolean focus_cycle_dock_windows; @@ -52,64 +58,43 @@ void focus_cycle_shutdown(gboolean reconfig) if (reconfig) return; } -void focus_cycle_add(ObClient *ifclient) +void focus_cycle_addremove(ObClient *c, gboolean redraw) { - if (!(focus_cycle_target && ifclient && !focus_cycle_directional)) + if (!focus_cycle_type) return; - if (focus_valid_target(ifclient, TRUE, - focus_cycle_iconic_windows, - focus_cycle_all_desktops, - focus_cycle_dock_windows, - focus_cycle_desktop_windows, - FALSE)) - focus_cycle_popup_refresh(focus_cycle_target, - focus_cycle_iconic_windows, - focus_cycle_all_desktops, - focus_cycle_dock_windows, - focus_cycle_desktop_windows); -} - -void focus_cycle_remove(ObClient *ifclient) -{ - if (!(focus_cycle_target && ifclient)) - return; - - if (focus_cycle_directional) { - if (focus_cycle_target == ifclient) { + if (focus_cycle_type == OB_CYCLE_DIRECTIONAL) { + if (c && focus_cycle_target == c) { focus_directional_cycle(0, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE); } } - else { - if (!focus_valid_target(ifclient, TRUE, - focus_cycle_iconic_windows, - focus_cycle_all_desktops, - focus_cycle_dock_windows, - focus_cycle_desktop_windows, - FALSE)) { - if (focus_cycle_target == ifclient) { - focus_cycle_target = - focus_cycle_popup_revert(focus_cycle_target); - focus_cycle_update_indicator(focus_cycle_target); - } - focus_cycle_popup_refresh(focus_cycle_target, - focus_cycle_iconic_windows, - focus_cycle_all_desktops, - focus_cycle_dock_windows, - focus_cycle_desktop_windows); + else if (c && redraw) { + gboolean v, s; + + v = focus_cycle_valid(c); + s = focus_cycle_popup_is_showing(c); + + if (v != s) { + focus_cycle_target = + focus_cycle_popup_refresh(focus_cycle_target, redraw); } } + else if (redraw) { + focus_cycle_reorder(); + } } void focus_cycle_reorder() { - if (focus_cycle_target && !focus_cycle_directional) - focus_cycle_popup_refresh(focus_cycle_target, - focus_cycle_iconic_windows, - focus_cycle_all_desktops, - focus_cycle_dock_windows, - focus_cycle_desktop_windows); + if (focus_cycle_type == OB_CYCLE_NORMAL) { + focus_cycle_target = focus_cycle_popup_refresh(focus_cycle_target, + TRUE); + focus_cycle_update_indicator(focus_cycle_target); + if (!focus_cycle_target) + focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE, + TRUE, TRUE, TRUE, TRUE, TRUE); + } } ObClient* focus_cycle(gboolean forward, gboolean all_desktops, @@ -126,7 +111,6 @@ ObClient* focus_cycle(gboolean forward, gboolean all_desktops, if (interactive) { if (cancel) { focus_cycle_target = NULL; - focus_cycle_directional = FALSE; goto done_cycle; } else if (done) goto done_cycle; @@ -164,17 +148,11 @@ ObClient* focus_cycle(gboolean forward, gboolean all_desktops, if (it == NULL) it = g_list_last(list); } ft = it->data; - if (focus_valid_target(ft, TRUE, - focus_cycle_iconic_windows, - focus_cycle_all_desktops, - focus_cycle_dock_windows, - focus_cycle_desktop_windows, - FALSE)) - { + if (focus_cycle_valid(ft)) { if (interactive) { if (ft != focus_cycle_target) { /* prevents flicker */ focus_cycle_target = ft; - focus_cycle_directional = FALSE; + focus_cycle_type = OB_CYCLE_NORMAL; focus_cycle_draw_indicator(showbar ? ft : NULL); } if (dialog) @@ -187,7 +165,7 @@ ObClient* focus_cycle(gboolean forward, gboolean all_desktops, return focus_cycle_target; } else if (ft != focus_cycle_target) { focus_cycle_target = ft; - focus_cycle_directional = FALSE; + focus_cycle_type = OB_CYCLE_NORMAL; done = TRUE; break; } @@ -198,7 +176,7 @@ done_cycle: if (done && !cancel) ret = focus_cycle_target; focus_cycle_target = NULL; - focus_cycle_directional = FALSE; + focus_cycle_type = OB_CYCLE_NONE; g_list_free(order); order = NULL; @@ -238,8 +216,7 @@ static ObClient *focus_find_directional(ObClient *c, ObDirection dir, /* the currently selected window isn't interesting */ if (cur == c) continue; - if (!focus_valid_target(it->data, TRUE, FALSE, FALSE, dock_windows, - desktop_windows, FALSE)) + if (!focus_cycle_valid(it->data)) continue; /* find the centre coords of this window, from the @@ -318,7 +295,6 @@ ObClient* focus_directional_cycle(ObDirection dir, gboolean dock_windows, if (cancel) { focus_cycle_target = NULL; - focus_cycle_directional = FALSE; goto done_cycle; } else if (done && interactive) goto done_cycle; @@ -344,17 +320,15 @@ ObClient* focus_directional_cycle(ObDirection dir, gboolean dock_windows, GList *it; for (it = focus_order; it; it = g_list_next(it)) - if (focus_valid_target(it->data, TRUE, - focus_cycle_iconic_windows, - focus_cycle_all_desktops, - focus_cycle_dock_windows, - focus_cycle_desktop_windows, FALSE)) + if (focus_cycle_valid(it->data)) { ft = it->data; + break; + } } if (ft && ft != focus_cycle_target) {/* prevents flicker */ focus_cycle_target = ft; - focus_cycle_directional = TRUE; + focus_cycle_type = OB_CYCLE_DIRECTIONAL; if (!interactive) goto done_cycle; focus_cycle_draw_indicator(showbar ? ft : NULL); @@ -373,10 +347,20 @@ done_cycle: first = NULL; focus_cycle_target = NULL; - focus_cycle_directional = FALSE; + focus_cycle_type = OB_CYCLE_NONE; focus_cycle_draw_indicator(NULL); focus_cycle_popup_single_hide(); return ret; } + +gboolean focus_cycle_valid(struct _ObClient *client) +{ + return focus_valid_target(client, TRUE, + focus_cycle_iconic_windows, + focus_cycle_all_desktops, + focus_cycle_dock_windows, + focus_cycle_desktop_windows, + FALSE); +} diff --git a/openbox/focus_cycle.h b/openbox/focus_cycle.h index c074a52b..4a97c103 100644 --- a/openbox/focus_cycle.h +++ b/openbox/focus_cycle.h @@ -47,8 +47,10 @@ struct _ObClient* focus_directional_cycle(ObDirection dir, gboolean dialog, gboolean done, gboolean cancel); -void focus_cycle_add(struct _ObClient *ifclient); -void focus_cycle_remove(struct _ObClient *ifclient); +/*! Set @redraw to FALSE if there are more clients to be added/removed first */ +void focus_cycle_addremove(struct _ObClient *ifclient, gboolean redraw); void focus_cycle_reorder(); +gboolean focus_cycle_valid(struct _ObClient *client); + #endif diff --git a/openbox/focus_cycle_popup.c b/openbox/focus_cycle_popup.c index b97bc97b..16522802 100644 --- a/openbox/focus_cycle_popup.c +++ b/openbox/focus_cycle_popup.c @@ -18,6 +18,7 @@ */ #include "focus_cycle_popup.h" +#include "focus_cycle.h" #include "popup.h" #include "client.h" #include "screen.h" @@ -78,11 +79,7 @@ static ObIconPopup *single_popup; static gchar *popup_get_name (ObClient *c); static gboolean popup_setup (ObFocusCyclePopup *p, gboolean create_targets, - gboolean refresh_targets, - gboolean iconic_windows, - gboolean all_desktops, - gboolean dock_windows, - gboolean desktop_windows); + gboolean refresh_targets); static void popup_render (ObFocusCyclePopup *p, const ObClient *c); @@ -172,9 +169,7 @@ static void popup_target_free(ObFocusCyclePopupTarget *t) } static gboolean popup_setup(ObFocusCyclePopup *p, gboolean create_targets, - gboolean refresh_targets, - gboolean iconic_windows, gboolean all_desktops, - gboolean dock_windows, gboolean desktop_windows) + gboolean refresh_targets) { gint maxwidth, n; GList *it; @@ -206,13 +201,7 @@ static gboolean popup_setup(ObFocusCyclePopup *p, gboolean create_targets, for (it = g_list_last(focus_order); it; it = g_list_previous(it)) { ObClient *ft = it->data; - if (focus_valid_target(ft, TRUE, - iconic_windows, - all_desktops, - dock_windows, - desktop_windows, - FALSE)) - { + if (focus_cycle_valid(ft)) { GList *rit; /* reuse the target if possible during refresh */ @@ -268,8 +257,6 @@ static gboolean popup_setup(ObFocusCyclePopup *p, gboolean create_targets, while (rtargets) { popup_target_free(rtargets->data); rtargets = g_list_delete_link(rtargets, rtargets); - - popup.targets = g_list_delete_link(popup.targets, popup.targets); } } @@ -523,8 +510,7 @@ void focus_cycle_popup_show(ObClient *c, gboolean iconic_windows, /* do this stuff only when the dialog is first showing */ if (!popup.mapped) - popup_setup(&popup, TRUE, FALSE, iconic_windows, all_desktops, - dock_windows, desktop_windows); + popup_setup(&popup, TRUE, FALSE); g_assert(popup.targets != NULL); popup_render(&popup, c); @@ -571,8 +557,7 @@ void focus_cycle_popup_single_show(struct _ObClient *c, if (!popup.mapped) { Rect *a; - popup_setup(&popup, FALSE, FALSE, iconic_windows, all_desktops, - dock_windows, desktop_windows); + popup_setup(&popup, FALSE, FALSE); g_assert(popup.targets == NULL); /* position the popup */ @@ -597,54 +582,67 @@ void focus_cycle_popup_single_hide(void) icon_popup_hide(single_popup); } -GList* focus_cycle_popup_is_showing(ObClient *client) +gboolean focus_cycle_popup_is_showing(ObClient *c) { if (popup.mapped) { GList *it; for (it = popup.targets; it; it = g_list_next(it)) { ObFocusCyclePopupTarget *t = it->data; - if (t->client == client) - return it; + if (t->client == c) + return TRUE; + } + } + return FALSE; +} + +static ObClient* popup_revert(ObClient *target) +{ + GList *it, *itt; + + for (it = popup.targets; it; it = g_list_next(it)) { + ObFocusCyclePopupTarget *t = it->data; + if (t->client == target) { + /* move to a previous window if possible */ + for (itt = it->prev; itt; itt = g_list_previous(itt)) { + ObFocusCyclePopupTarget *t2 = it->data; + if (focus_cycle_valid(t2->client)) + return t2->client; + } + + /* otherwise move to a following window if possible */ + for (itt = it->next; itt; itt = g_list_next(itt)) { + ObFocusCyclePopupTarget *t2 = it->data; + if (focus_cycle_valid(t2->client)) + return t2->client; + } + + /* otherwise, we can't go anywhere there is nowhere valid to go */ + return NULL; } } return NULL; } -ObClient* focus_cycle_popup_revert(ObClient *target) +ObClient* focus_cycle_popup_refresh(ObClient *target, + gboolean redraw) { - GList *it; - if (!popup.mapped) return NULL; - for (it = popup.targets; it; it = g_list_next(it)) { - ObFocusCyclePopupTarget *t = it->data; - if (t->client == target) { - if (it->prev) - return ((ObFocusCyclePopupTarget*)it->prev->data)->client; - else if (it->next) - return ((ObFocusCyclePopupTarget*)it->next->data)->client; - else - return NULL; - } - } - g_assert_not_reached(); -} + if (!focus_cycle_valid(target)) + target = popup_revert(target); -void focus_cycle_popup_refresh(ObClient *target, - gboolean iconic_windows, - gboolean all_desktops, - gboolean dock_windows, - gboolean desktop_windows) -{ - if (!popup.mapped) return; + redraw = popup_setup(&popup, TRUE, TRUE) && redraw; - if (popup_setup(&popup, TRUE, TRUE, iconic_windows, all_desktops, - dock_windows, desktop_windows)) - { + if (!target && popup.targets) + target = ((ObFocusCyclePopupTarget*)popup.targets->data)->client; + + if (target && redraw) { popup.mapped = FALSE; popup_render(&popup, target); XFlush(ob_display); popup.mapped = TRUE; } + + return target; } diff --git a/openbox/focus_cycle_popup.h b/openbox/focus_cycle_popup.h index b4c9e350..934d9a67 100644 --- a/openbox/focus_cycle_popup.h +++ b/openbox/focus_cycle_popup.h @@ -39,13 +39,13 @@ void focus_cycle_popup_single_show(struct _ObClient *c, gboolean desktop_windows); void focus_cycle_popup_single_hide(); -/*! Reverts from the current @target to a new focus cycle target window */ -struct _ObClient* focus_cycle_popup_revert(struct _ObClient *target); -/*! Redraws the focus cycle popup */ -void focus_cycle_popup_refresh(struct _ObClient *target, - gboolean iconic_windows, - gboolean all_desktops, - gboolean dock_windows, - gboolean desktop_windows); +gboolean focus_cycle_popup_is_showing(struct _ObClient *c); + +/*! Redraws the focus cycle popup, and returns the current target. If + the target given to the function is no longer valid, this will return + a different target that is valid, and which should be considered the + current focus cycling target. */ +struct _ObClient *focus_cycle_popup_refresh(struct _ObClient *target, + gboolean redraw); #endif diff --git a/openbox/screen.c b/openbox/screen.c index 5ae07907..55fd58d6 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -713,8 +713,7 @@ void screen_set_desktop(guint num, gboolean dofocus) for (it = stacking_list; it; it = g_list_next(it)) { if (WINDOW_IS_CLIENT(it->data)) { ObClient *c = it->data; - if (client_show(c)) - focus_cycle_add(c); + client_show(c); } } @@ -725,8 +724,6 @@ void screen_set_desktop(guint num, gboolean dofocus) if (WINDOW_IS_CLIENT(it->data)) { ObClient *c = it->data; if (client_hide(c)) { - focus_cycle_remove(c); - if (c == focus_client) { /* c was focused and we didn't do fallback clearly so make sure openbox doesnt still consider the window focused. @@ -742,6 +739,8 @@ void screen_set_desktop(guint num, gboolean dofocus) } } + focus_cycle_addremove(NULL, TRUE); + event_end_ignore_all_enters(ignore_start); if (event_curtime != CurrentTime) From bd864012cd17f68c3a25ccfc2fc6cfd304c557f2 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 11 Jan 2010 15:35:47 -0500 Subject: [PATCH 15/16] Make the focus cycle indicator follow target fallback in the popup --- openbox/focus_cycle.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/openbox/focus_cycle.c b/openbox/focus_cycle.c index 40436683..da9cd4cc 100644 --- a/openbox/focus_cycle.c +++ b/openbox/focus_cycle.c @@ -75,10 +75,8 @@ void focus_cycle_addremove(ObClient *c, gboolean redraw) v = focus_cycle_valid(c); s = focus_cycle_popup_is_showing(c); - if (v != s) { - focus_cycle_target = - focus_cycle_popup_refresh(focus_cycle_target, redraw); - } + if (v != s) + focus_cycle_reorder(); } else if (redraw) { focus_cycle_reorder(); From e8200ae603f33b70824c125ba6b37bfaec7d89ea Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Mon, 11 Jan 2010 15:37:36 -0500 Subject: [PATCH 16/16] make focus cycle target fallback work right by going to the next prev window --- openbox/focus_cycle_popup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openbox/focus_cycle_popup.c b/openbox/focus_cycle_popup.c index 16522802..d7ac9f53 100644 --- a/openbox/focus_cycle_popup.c +++ b/openbox/focus_cycle_popup.c @@ -605,14 +605,14 @@ static ObClient* popup_revert(ObClient *target) if (t->client == target) { /* move to a previous window if possible */ for (itt = it->prev; itt; itt = g_list_previous(itt)) { - ObFocusCyclePopupTarget *t2 = it->data; + ObFocusCyclePopupTarget *t2 = itt->data; if (focus_cycle_valid(t2->client)) return t2->client; } /* otherwise move to a following window if possible */ for (itt = it->next; itt; itt = g_list_next(itt)) { - ObFocusCyclePopupTarget *t2 = it->data; + ObFocusCyclePopupTarget *t2 = itt->data; if (focus_cycle_valid(t2->client)) return t2->client; }