diff --git a/x11-wm/obconf/Makefile b/x11-wm/obconf/Makefile index ec6ae1f00ff4..da0735c0578b 100644 --- a/x11-wm/obconf/Makefile +++ b/x11-wm/obconf/Makefile @@ -15,13 +15,13 @@ MAINTAINER= novel@FreeBSD.org COMMENT= Preferences manager for the Openbox window manager LIB_DEPENDS= startup-notification-1.0:${PORTSDIR}/x11/startup-notification \ - obparser.21:${PORTSDIR}/x11-wm/openbox - -BROKEN= bad depobj + obrender.27:${PORTSDIR}/x11-wm/openbox USE_GNOME= gnomehier libglade2 GNU_CONFIGURE= yes -CONFIGURE_ENV= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" +CONFIGURE_ENV= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" \ + OPENBOX_CFLAGS="`pkg-config --cflags obrender-3.5 obt-3.5`" \ + OPENBOX_LIBS="`pkg-config --libs obrender-3.5 obt-3.5`" CONFIGURE_ARGS= --sysconfdir=${PREFIX}/etc/openbox MAKE_ARGS= mkdir_p='${MKDIR}' diff --git a/x11-wm/obconf/files/patch-openbox-compat b/x11-wm/obconf/files/patch-openbox-compat new file mode 100644 index 000000000000..b3f708b0ae9a --- /dev/null +++ b/x11-wm/obconf/files/patch-openbox-compat @@ -0,0 +1,1061 @@ +diff --git configure.ac configure.ac +index bae2dfb..f9b0775 100644 +--- configure.ac ++++ configure.ac +@@ -1,5 +1,5 @@ + AC_PREREQ([2.54]) +-AC_INIT([obconf], [2.0.3], [http://bugzilla.icculus.org]) ++AC_INIT([obconf], [2.0.4], [http://bugzilla.icculus.org]) + AM_INIT_AUTOMAKE + AC_CONFIG_SRCDIR([src/main.c]) + +@@ -20,7 +20,7 @@ ALL_LINGUAS="" + AM_GNU_GETTEXT_VERSION(0.15) + AM_GNU_GETTEXT([external]) + +-PKG_CHECK_MODULES(OPENBOX, [obrender-3.0 >= 3.4.2 obparser-3.0 >= 3.4.2]) ++PKG_CHECK_MODULES(OPENBOX, [obrender-3.5 obt-3.5]) + AC_SUBST(OPENBOX_CFLAGS) + AC_SUBST(OPENBOX_LIBS) + +diff --git src/appearance.c src/appearance.c +index 293e43f..f130311 100644 +--- src/appearance.c ++++ src/appearance.c +@@ -23,7 +23,7 @@ + + static gboolean mapping = FALSE; + +-static RrFont *read_font(GtkFontButton *w, const gchar *place); ++static RrFont *read_font(GtkFontButton *w, const gchar *place, gboolean def); + static RrFont *write_font(GtkFontButton *w, const gchar *place); + + void appearance_setup_tab() +@@ -49,24 +49,31 @@ void appearance_setup_tab() + g_free(layout); + + w = get_widget("font_active"); +- f = read_font(GTK_FONT_BUTTON(w), "ActiveWindow"); ++ f = read_font(GTK_FONT_BUTTON(w), "ActiveWindow", TRUE); + preview_update_set_active_font(f); + + w = get_widget("font_inactive"); +- f = read_font(GTK_FONT_BUTTON(w), "InactiveWindow"); ++ f = read_font(GTK_FONT_BUTTON(w), "InactiveWindow", TRUE); + preview_update_set_inactive_font(f); + + w = get_widget("font_menu_header"); +- f = read_font(GTK_FONT_BUTTON(w), "MenuHeader"); ++ f = read_font(GTK_FONT_BUTTON(w), "MenuHeader", TRUE); + preview_update_set_menu_header_font(f); + + w = get_widget("font_menu_item"); +- f = read_font(GTK_FONT_BUTTON(w), "MenuItem"); ++ f = read_font(GTK_FONT_BUTTON(w), "MenuItem", TRUE); + preview_update_set_menu_item_font(f); + +- w = get_widget("font_display"); +- f = read_font(GTK_FONT_BUTTON(w), "OnScreenDisplay"); +- preview_update_set_osd_font(f); ++ w = get_widget("font_active_display"); ++ if (!(f = read_font(GTK_FONT_BUTTON(w), "ActiveOnScreenDisplay", FALSE))) { ++ f = read_font(GTK_FONT_BUTTON(w), "OnScreenDisplay", TRUE); ++ tree_delete_node("theme/font:place=OnScreenDisplay"); ++ } ++ preview_update_set_osd_active_font(f); ++ ++ w = get_widget("font_inactive_display"); ++ f = read_font(GTK_FONT_BUTTON(w), "InactiveOnScreenDisplay", TRUE); ++ preview_update_set_osd_inactive_font(f); + + mapping = FALSE; + } +@@ -185,14 +192,23 @@ void on_font_menu_item_font_set(GtkFontButton *w, gpointer data) + preview_update_set_menu_item_font(write_font(w, "MenuItem")); + } + +-void on_font_display_font_set(GtkFontButton *w, gpointer data) ++void on_font_active_display_font_set(GtkFontButton *w, gpointer data) + { + if (mapping) return; + +- preview_update_set_osd_font(write_font(w, "OnScreenDisplay")); ++ preview_update_set_osd_active_font(write_font(w, "ActiveOnScreenDisplay")); + } + +-static RrFont *read_font(GtkFontButton *w, const gchar *place) ++void on_font_inactive_display_font_set(GtkFontButton *w, gpointer data) ++{ ++ if (mapping) return; ++ ++ preview_update_set_osd_inactive_font ++ (write_font(w, "InactiveOnScreenDisplay")); ++} ++ ++static RrFont *read_font(GtkFontButton *w, const gchar *place, ++ gboolean use_default) + { + RrFont *font; + gchar *fontstring, *node; +@@ -207,9 +223,14 @@ static RrFont *read_font(GtkFontButton *w, const gchar *place) + mapping = TRUE; + + node = g_strdup_printf("theme/font:place=%s/name", place); +- name = tree_get_string(node, "Sans"); ++ name = tree_get_string(node, use_default ? "Sans" : NULL); + g_free(node); + ++ if (name[0] == '\0') { ++ g_free(name); ++ return NULL; ++ } ++ + node = g_strdup_printf("theme/font:place=%s/size", place); + size = tree_get_string(node, "8"); + g_free(node); +diff --git src/desktops.c src/desktops.c +index d7e9811..6f205c4 100644 +--- src/desktops.c ++++ src/desktops.c +@@ -156,7 +156,7 @@ static void desktops_read_names() + gchar *name; + + if (!xmlStrcmp(n->name, (const xmlChar*)"name")) { +- name = parse_string(doc, n); ++ name = obt_xml_node_string(n); + + desktop_names = g_list_append(desktop_names, name); + +diff --git src/main.c src/main.c +index 7083730..9035e8d 100644 +--- src/main.c ++++ src/main.c +@@ -42,6 +42,8 @@ xmlDocPtr doc; + xmlNodePtr root; + RrInstance *rrinst; + gchar *obc_config_file = NULL; ++ObtPaths *paths; ++ObtXmlInst *parse_i; + + static gchar *obc_theme_install = NULL; + static gchar *obc_theme_archive = NULL; +@@ -214,7 +216,8 @@ int main(int argc, char **argv) + exit_with_error = TRUE; + } + +- parse_paths_startup(); ++ paths = obt_paths_new(); ++ parse_i = obt_xml_instance_new(); + rrinst = RrInstanceNew(GDK_DISPLAY(), gdk_x11_get_default_screen()); + + if (!obc_config_file) { +@@ -230,10 +233,19 @@ int main(int argc, char **argv) + } + + xmlIndentTreeOutput = 1; +- if (!parse_load_rc(obc_config_file, &doc, &root)) { ++ if (!obt_xml_load_config_file(parse_i, ++ "openbox", ++ (obc_config_file ? ++ obc_config_file : "rc.xml"), ++ "openbox_config")) ++ { + obconf_error(_("Failed to load an rc.xml. You have probably failed to install Openbox properly."), TRUE); + exit_with_error = TRUE; + } ++ else { ++ doc = obt_xml_doc(parse_i); ++ root = obt_xml_root(parse_i); ++ } + + /* look for parsing errors */ + { +@@ -285,12 +297,14 @@ int main(int argc, char **argv) + preview_update_set_inactive_font(NULL); + preview_update_set_menu_header_font(NULL); + preview_update_set_menu_item_font(NULL); +- preview_update_set_osd_font(NULL); ++ preview_update_set_osd_active_font(NULL); ++ preview_update_set_osd_inactive_font(NULL); + preview_update_set_title_layout(NULL); + } + + RrInstanceFree(rrinst); +- parse_paths_shutdown(); ++ obt_xml_instance_unref(parse_i); ++ obt_paths_unref(paths); + + xmlFreeDoc(doc); + return 0; +diff --git src/main.h src/main.h +index 7d6303c..4f3213b 100644 +--- src/main.h ++++ src/main.h +@@ -19,19 +19,20 @@ + #ifndef obconf__main_h + #define obconf__main_h + +-#include +-#include +-#include ++#include ++#include ++#include ++#include + + #include + #include + + extern GladeXML *glade; +-extern xmlDocPtr doc; +-extern xmlNodePtr root; + extern RrInstance *rrinst; + extern GtkWidget *mainwin; + extern gchar *obc_config_file; ++extern ObtPaths *paths; ++extern ObtXmlInst *parse_i; + + #define get_widget(s) glade_xml_get_widget(glade, s) + +diff --git src/mouse.c src/mouse.c +index 68d9c55..88f13d9 100644 +--- src/mouse.c ++++ src/mouse.c +@@ -19,7 +19,7 @@ + #include "main.h" + #include "tree.h" + #include "gettext.h" +-#include ++#include + + static gboolean mapping = FALSE; + static xmlNodePtr saved_custom = NULL; +@@ -206,9 +206,9 @@ static gint read_doubleclick_action() + + while (n) { + if (!xmlStrcmp(n->name, (const xmlChar*)"action")) { +- if (parse_attr_contains("ToggleMaximizeFull", n, "name")) ++ if (obt_xml_attr_contains(n, "name", "ToggleMaximizeFull")) + ++max; +- else if (parse_attr_contains("ToggleShade", n, "name")) ++ else if (obt_xml_attr_contains(n, "name", "ToggleShade")) + ++shade; + else + ++other; +diff --git src/obconf.glade src/obconf.glade +index 81e926f..464acff 100644 +--- src/obconf.glade ++++ src/obconf.glade +@@ -943,7 +943,7 @@ Omnipresent (On all desktops) + + + True +- 5 ++ 6 + 2 + False + 3 +@@ -1013,27 +1013,6 @@ Omnipresent (On all desktops) + + + +- +- True +- True +- True +- True +- True +- False +- True +- +- +- +- 1 +- 2 +- 4 +- 5 +- fill +- +- +- +- +- + + True + _Active window title: +@@ -1152,7 +1131,7 @@ Omnipresent (On all desktops) + + + True +- _On-screen display: ++ Active _On-screen display: + True + False + GTK_JUSTIFY_LEFT +@@ -1162,7 +1141,6 @@ Omnipresent (On all desktops) + 0.5 + 0 + 0 +- font_display + PANGO_ELLIPSIZE_NONE + -1 + False +@@ -1197,6 +1175,76 @@ Omnipresent (On all desktops) + + + ++ ++ ++ ++ True ++ Inactive O_n-screen display: ++ True ++ False ++ GTK_JUSTIFY_LEFT ++ False ++ False ++ 1 ++ 0.5 ++ 0 ++ 0 ++ PANGO_ELLIPSIZE_NONE ++ -1 ++ False ++ 0 ++ ++ ++ 0 ++ 1 ++ 5 ++ 6 ++ fill ++ ++ ++ ++ ++ ++ ++ True ++ True ++ True ++ True ++ True ++ False ++ True ++ ++ ++ ++ 1 ++ 2 ++ 4 ++ 5 ++ fill ++ ++ ++ ++ ++ ++ ++ True ++ True ++ True ++ True ++ True ++ False ++ True ++ ++ ++ ++ 1 ++ 2 ++ 5 ++ 6 ++ fill ++ ++ ++ + + + 0 +@@ -1576,6 +1624,301 @@ Omnipresent (On all desktops) + True + + ++ ++ ++ ++ True ++ False ++ 6 ++ ++ ++ ++ True ++ <span weight="bold">Primary Monitor</span> ++ False ++ True ++ GTK_JUSTIFY_LEFT ++ False ++ False ++ 0 ++ 0.5 ++ 0 ++ 0 ++ PANGO_ELLIPSIZE_NONE ++ -1 ++ False ++ 0 ++ ++ ++ 0 ++ False ++ False ++ ++ ++ ++ ++ ++ True ++ False ++ 0 ++ ++ ++ ++ True ++ ++ False ++ False ++ GTK_JUSTIFY_LEFT ++ False ++ False ++ 0.5 ++ 0.5 ++ 0 ++ 0 ++ PANGO_ELLIPSIZE_NONE ++ -1 ++ False ++ 0 ++ ++ ++ 0 ++ False ++ False ++ ++ ++ ++ ++ ++ True ++ False ++ 6 ++ ++ ++ ++ True ++ False ++ 0 ++ ++ ++ ++ True ++ The primary monitor is where Openbox will place dialogs, such as the one used for cycling windows. ++ False ++ False ++ GTK_JUSTIFY_LEFT ++ True ++ False ++ 0 ++ 0 ++ 0 ++ 0 ++ PANGO_ELLIPSIZE_NONE ++ 0 ++ False ++ 0 ++ ++ ++ 0 ++ False ++ False ++ ++ ++ ++ ++ 0 ++ False ++ False ++ ++ ++ ++ ++ ++ True ++ False ++ 6 ++ ++ ++ ++ True ++ Primary _monitor: ++ True ++ False ++ GTK_JUSTIFY_LEFT ++ False ++ False ++ 0 ++ 0.5 ++ 0 ++ 0 ++ primary_monitor_popup ++ PANGO_ELLIPSIZE_NONE ++ -1 ++ False ++ 0 ++ ++ ++ 0 ++ False ++ False ++ ++ ++ ++ ++ ++ True ++ True ++ 1 ++ ++ ++ ++ ++ ++ ++ True ++ Fixed Monitor ++ True ++ ++ ++ ++ ++ ++ ++ True ++ Active Monitor ++ True ++ ++ ++ ++ ++ ++ ++ True ++ Monitor With Mouse Pointer ++ True ++ ++ ++ ++ ++ ++ ++ ++ 0 ++ False ++ False ++ ++ ++ ++ ++ 0 ++ True ++ True ++ ++ ++ ++ ++ ++ True ++ False ++ 6 ++ ++ ++ ++ True ++ ++ False ++ False ++ GTK_JUSTIFY_LEFT ++ False ++ False ++ 0.5 ++ 0.5 ++ 0 ++ 0 ++ PANGO_ELLIPSIZE_NONE ++ -1 ++ False ++ 0 ++ ++ ++ 0 ++ False ++ False ++ ++ ++ ++ ++ ++ True ++ _Fixed monitor: ++ True ++ False ++ GTK_JUSTIFY_LEFT ++ False ++ False ++ 0 ++ 0.5 ++ 0 ++ 0 ++ fixed_monitor ++ PANGO_ELLIPSIZE_NONE ++ -1 ++ False ++ 0 ++ ++ ++ 0 ++ False ++ False ++ ++ ++ ++ ++ ++ True ++ True ++ 1 ++ 0 ++ False ++ GTK_UPDATE_ALWAYS ++ False ++ False ++ 1 1 100 1 10 10 ++ ++ ++ ++ 0 ++ False ++ False ++ ++ ++ ++ ++ 0 ++ True ++ True ++ ++ ++ ++ ++ 0 ++ True ++ True ++ ++ ++ ++ ++ 0 ++ False ++ True ++ ++ ++ ++ ++ 0 ++ False ++ True ++ ++ + + + False +diff --git src/preview.c src/preview.c +index 7e463a8..a82cf15 100644 +--- src/preview.c ++++ src/preview.c +@@ -23,7 +23,7 @@ + + #include + +-#include ++#include + + #define PADDING 2 /* openbox does it :/ */ + +@@ -491,7 +491,8 @@ GdkPixbuf *preview_theme(const gchar *name, const gchar *titlelayout, + RrFont *inactive_window_font, + RrFont *menu_title_font, + RrFont *menu_item_font, +- RrFont *osd_font) ++ RrFont *osd_active_font, ++ RrFont *osd_inactive_font) + { + + GdkPixbuf *preview; +@@ -505,7 +506,8 @@ GdkPixbuf *preview_theme(const gchar *name, const gchar *titlelayout, + + RrTheme *theme = RrThemeNew(rrinst, name, FALSE, + active_window_font, inactive_window_font, +- menu_title_font, menu_item_font, osd_font); ++ menu_title_font, menu_item_font, ++ osd_active_font, osd_inactive_font); + if (!theme) + return NULL; + +diff --git src/preview.h src/preview.h +index ff43766..772984b 100644 +--- src/preview.h ++++ src/preview.h +@@ -21,7 +21,7 @@ + + #include + +-#include ++#include + #include + + GdkPixbuf *preview_theme(const gchar *name, const gchar *titlelayout, +@@ -29,6 +29,7 @@ GdkPixbuf *preview_theme(const gchar *name, const gchar *titlelayout, + RrFont *inactive_window_font, + RrFont *menu_title_font, + RrFont *menu_item_font, +- RrFont *osd_font); ++ RrFont *osd_active_font, ++ RrFont *osd_inactive_font); + + #endif +diff --git src/preview_update.c src/preview_update.c +index a0e17c8..638f364 100644 +--- src/preview_update.c ++++ src/preview_update.c +@@ -1,4 +1,5 @@ + #include "preview_update.h" ++#include "preview.h" + #include "main.h" + + static gboolean restart_theme_preview_update = TRUE; +@@ -10,18 +11,21 @@ static RrFont *active_window_font = NULL; + static RrFont *inactive_window_font = NULL; + static RrFont *menu_title_font = NULL; + static RrFont *menu_item_font = NULL; +-static RrFont *osd_font = NULL; ++static RrFont *osd_active_font = NULL; ++static RrFont *osd_inactive_font = NULL; + + static gboolean update_theme_preview_iterate(gpointer data); + + void preview_update_all() + { + if (!list_store) return; ++ if (!RR_CHECK_VERSION(3,5,0)) return; + + g_idle_remove_by_data(list_store); + + if (!(title_layout && active_window_font && inactive_window_font && +- menu_title_font && menu_item_font && osd_font)) ++ menu_title_font && menu_item_font && ++ osd_active_font && osd_inactive_font)) + return; /* not set up */ + + restart_theme_preview_update = TRUE; +@@ -70,10 +74,17 @@ void preview_update_set_menu_item_font(RrFont *f) + preview_update_all(); + } + +-void preview_update_set_osd_font(RrFont *f) ++void preview_update_set_osd_active_font(RrFont *f) + { +- RrFontClose(osd_font); +- osd_font = f; ++ RrFontClose(osd_active_font); ++ osd_active_font = f; ++ preview_update_all(); ++} ++ ++void preview_update_set_osd_inactive_font(RrFont *f) ++{ ++ RrFontClose(osd_inactive_font); ++ osd_inactive_font = f; + preview_update_all(); + } + +@@ -87,6 +98,7 @@ void preview_update_set_title_layout(const gchar *layout) + static gboolean update_theme_preview_iterate(gpointer data) + { + GtkListStore *ls = data; ++ GdkPixbuf *preview; + static GtkTreeIter iter; + gchar *name; + +@@ -120,11 +132,12 @@ static gboolean update_theme_preview_iterate(gpointer data) + + gtk_tree_model_get(GTK_TREE_MODEL(ls), &iter, 0, &name, -1); + +- gtk_list_store_set(GTK_LIST_STORE(ls), &iter, 1, +- preview_theme(name, title_layout, active_window_font, +- inactive_window_font, menu_title_font, +- menu_item_font, osd_font), +- -1); ++ preview = preview_theme(name, title_layout, active_window_font, ++ inactive_window_font, menu_title_font, ++ menu_item_font, osd_active_font, ++ osd_inactive_font); ++ if (preview) ++ gtk_list_store_set(GTK_LIST_STORE(ls), &iter, 1, preview, -1); + + return TRUE; + } +diff --git src/preview_update.h src/preview_update.h +index 1fe9674..596f092 100644 +--- src/preview_update.h ++++ src/preview_update.h +@@ -1,7 +1,7 @@ + #ifndef obconf__preview_update_h + #define obconf__preview_update_h + +-#include ++#include + #include + + void preview_update_all(); +@@ -11,7 +11,8 @@ void preview_update_set_active_font (RrFont *f); + void preview_update_set_inactive_font (RrFont *f); + void preview_update_set_menu_header_font (RrFont *f); + void preview_update_set_menu_item_font (RrFont *f); +-void preview_update_set_osd_font (RrFont *f); ++void preview_update_set_osd_active_font (RrFont *f); ++void preview_update_set_osd_inactive_font(RrFont *f); + void preview_update_set_title_layout (const gchar *layout); + + #endif +diff --git src/theme.c src/theme.c +index 093dc21..70206f9 100644 +--- src/theme.c ++++ src/theme.c +@@ -193,7 +193,7 @@ void theme_load_all() + + { + GSList *it; +- for (it = parse_xdg_data_dir_paths(); it; it = g_slist_next(it)) { ++ for (it = obt_paths_data_dirs(paths); it; it = g_slist_next(it)) { + p = g_build_filename(it->data, "themes", NULL); + add_theme_dir(p); + g_free(p); +diff --git src/tree.c src/tree.c +index 2c0f2dc..cbe9b90 100644 +--- src/tree.c ++++ src/tree.c +@@ -19,7 +19,7 @@ + #include "tree.h" + #include "main.h" + +-#include ++#include + #include + + xmlNodePtr tree_get_node(const gchar *path, const gchar *def) +@@ -28,7 +28,7 @@ xmlNodePtr tree_get_node(const gchar *path, const gchar *def) + gchar **nodes; + gchar **it, **next; + +- n = root; ++ n = obt_xml_root(parse_i); + + nodes = g_strsplit(path, "/", 0); + for (it = nodes; *it; it = next) { +@@ -39,19 +39,19 @@ xmlNodePtr tree_get_node(const gchar *path, const gchar *def) + next = it + 1; + + /* match attributes */ +- c = parse_find_node(attrs[0], n->children); ++ c = obt_xml_find_node(n->children, attrs[0]); + while (c && !ok) { + gint i; + + ok = TRUE; + for (i = 1; attrs[i]; ++i) { + gchar **eq = g_strsplit(attrs[i], "=", 2); +- if (eq[1] && !parse_attr_contains(eq[1], c, eq[0])) ++ if (eq[1] && !obt_xml_attr_contains(c, eq[0], eq[1])) + ok = FALSE; + g_strfreev(eq); + } + if (!ok) +- c = parse_find_node(attrs[0], c->next); ++ c = obt_xml_find_node(c->next, attrs[0]); + } + + if (!c) { +@@ -76,6 +76,15 @@ xmlNodePtr tree_get_node(const gchar *path, const gchar *def) + return n; + } + ++void tree_delete_node(const gchar *path) ++{ ++ xmlNodePtr n; ++ ++ n = tree_get_node(path, NULL); ++ xmlUnlinkNode(n); ++ xmlFreeNode(n); ++} ++ + void tree_apply() + { + gchar *p, *d; +@@ -84,15 +93,14 @@ void tree_apply() + if (obc_config_file) + p = g_strdup(obc_config_file); + else +- p = g_build_filename(parse_xdg_config_home_path(), "openbox", ++ p = g_build_filename(obt_paths_config_home(paths), "openbox", + "rc.xml", NULL); + + d = g_path_get_dirname(p); +- parse_mkdir_path(d, 0700); ++ obt_paths_mkdir_path(d, 0700); + g_free(d); + +- err = xmlSaveFormatFile(p, doc, 1) == -1; +- if (err) { ++ if (!obt_xml_save_file(parse_i, p, TRUE)) { + gchar *s; + s = g_strdup_printf("An error occured while saving the " + "config file '%s'", p); +@@ -158,7 +166,7 @@ gchar* tree_get_string(const gchar *node, const gchar *def) + xmlNodePtr n; + + n = tree_get_node(node, def); +- return parse_string(doc, n); ++ return obt_xml_node_string(n); + } + + gint tree_get_int(const gchar *node, gint def) +@@ -169,7 +177,7 @@ gint tree_get_int(const gchar *node, gint def) + d = g_strdup_printf("%d", def); + n = tree_get_node(node, d); + g_free(d); +- return parse_int(doc, n); ++ return obt_xml_node_int(n); + } + + gboolean tree_get_bool(const gchar *node, gboolean def) +@@ -177,5 +185,5 @@ gboolean tree_get_bool(const gchar *node, gboolean def) + xmlNodePtr n; + + n = tree_get_node(node, (def ? "yes" : "no")); +- return parse_bool(doc, n); ++ return obt_xml_node_bool(n); + } +diff --git src/tree.h src/tree.h +index 39c96b3..4e9e170 100644 +--- src/tree.h ++++ src/tree.h +@@ -19,10 +19,12 @@ + #ifndef obconf__tree_h + #define obconf__tree_h + +-#include "openbox/parse.h" ++#include + + xmlNodePtr tree_get_node(const gchar *path, const gchar *def); + ++void tree_delete_node(const gchar *path); ++ + gchar* tree_get_string(const gchar *node, const gchar *def); + gint tree_get_int(const gchar *node, gint def); + gboolean tree_get_bool(const gchar *node, gboolean def); +diff --git src/windows.c src/windows.c +index ed5ed35..d2b4d96 100644 +--- src/windows.c ++++ src/windows.c +@@ -23,6 +23,7 @@ + static gboolean mapping = FALSE; + + #define PLACE_ON_ALL 0 ++#define PLACE_ON_FIXED 0 + #define PLACE_ON_ACTIVE 1 + #define PLACE_ON_MOUSE 2 + +@@ -59,6 +60,21 @@ void windows_setup_tab() + gtk_option_menu_set_history(GTK_OPTION_MENU(w), PLACE_ON_ALL); + g_free(s); + ++ w = get_widget("primary_monitor_popup"); ++ s = tree_get_string("placement/primaryMonitor", ""); ++ if (!g_ascii_strcasecmp(s, "Active")) ++ gtk_option_menu_set_history(GTK_OPTION_MENU(w), PLACE_ON_ACTIVE); ++ else if (!g_ascii_strcasecmp(s, "Mouse")) ++ gtk_option_menu_set_history(GTK_OPTION_MENU(w), PLACE_ON_MOUSE); ++ else { ++ gtk_option_menu_set_history(GTK_OPTION_MENU(w), PLACE_ON_FIXED); ++ ++ w = get_widget("fixed_monitor"); ++ gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), ++ tree_get_int("placement/primaryMonitor", 1)); ++ } ++ g_free(s); ++ + enable_stuff(); + + mapping = FALSE; +@@ -71,8 +87,50 @@ static void enable_stuff() + + w = get_widget("place_mouse"); + b = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)); ++ + w = get_widget("place_center"); + gtk_widget_set_sensitive(w, !b); ++ ++ w = get_widget("primary_monitor_popup"); ++ b = gtk_option_menu_get_history(GTK_OPTION_MENU(w)) == PLACE_ON_FIXED; ++ w = get_widget("fixed_monitor"); ++ gtk_widget_set_sensitive(w, b); ++} ++ ++void on_primary_monitor_active_activate(GtkMenuItem *w, gpointer data) ++{ ++ if (mapping) return; ++ ++ tree_set_string("placement/primaryMonitor", "Active"); ++ enable_stuff(); ++} ++ ++void on_primary_monitor_mouse_activate(GtkMenuItem *w, gpointer data) ++{ ++ if (mapping) return; ++ ++ tree_set_string("placement/primaryMonitor", "Mouse"); ++ enable_stuff(); ++} ++ ++void on_primary_monitor_fixed_activate(GtkMenuItem *w, gpointer data) ++{ ++ GtkWidget *w2; ++ ++ if (mapping) return; ++ ++ w2 = get_widget("fixed_monitor"); ++ tree_set_int("placement/primaryMonitor", ++ gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(w2))); ++ enable_stuff(); ++} ++ ++void on_fixed_monitor_value_changed(GtkSpinButton *w, gpointer data) ++{ ++ if (mapping) return; ++ ++ tree_set_int("placement/primaryMonitor", ++ gtk_spin_button_get_value_as_int(w)); + } + + void on_focus_new_toggled(GtkToggleButton *w, gpointer data) diff --git a/x11-wm/obconf/files/patch-src__preview_update.c b/x11-wm/obconf/files/patch-src__preview_update.c deleted file mode 100644 index 31621f9c323b..000000000000 --- a/x11-wm/obconf/files/patch-src__preview_update.c +++ /dev/null @@ -1,8 +0,0 @@ ---- ./src/preview_update.c.orig 2010-05-12 20:09:07.177608591 +0400 -+++ ./src/preview_update.c 2010-05-12 20:09:21.638774481 +0400 -@@ -1,4 +1,5 @@ - #include "preview_update.h" -+#include "preview.h" - #include "main.h" - - static gboolean restart_theme_preview_update = TRUE;