From 976d073496cd1bed1283b18947b8d303eb678f25 Mon Sep 17 00:00:00 2001 From: galtgendo Date: Sat, 17 Aug 2013 20:25:07 +0200 Subject: [PATCH] Stop using libglade GtkOptionMenu -> GtkComboBoxText move is to make porting to gtk3 easier (this needs gtk+ 2.24), most of the pixbuf changes in src/preview.c for the same reason. Other changes should not go beyond 2.18. The changes in packing in glade file are also for the sake of gtk3 - they shouldn't affect gtk2 (hbox51 removal was mostly to make things cleaner - there didn't seem to be a reason for extra container there). The added catch is that http://savannah.gnu.org/bugs/?34506 was only fixed in gettext 0.18.3 (just a few weeks old) and there's a little problem with gtk2 version of glade (http://bugzilla.gnome.org/show_bug.cgi?id=689667). The ui file itself nevertheless works. --- .gitignore | 1 + Makefile.am | 14 +- NEWS | 0 TODO | 0 configure.ac | 9 +- src/about.c | 3 +- src/desktops.c | 6 +- src/dock.c | 120 +-- src/main.c | 32 +- src/main.h | 5 +- src/mouse.c | 43 +- src/moveresize.c | 114 +-- src/obconf.gladep | 13 - src/{obconf.glade => obconf.ui} | 2153 ++++++++++++++++++--------------------- src/preview.c | 136 ++- src/preview_update.c | 4 +- src/tree.c | 4 +- src/windows.c | 92 +- 18 files changed, 1227 insertions(+), 1522 deletions(-) delete mode 100644 NEWS delete mode 100644 TODO delete mode 100644 src/obconf.gladep rename src/{obconf.glade => obconf.ui} (75%) diff --git a/Makefile.am b/Makefile.am index 369ec3d..61c3805 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ SUBDIRS = po localedir = $(datadir)/locale -gladedir = $(datadir)/obconf +resourcedir = $(datadir)/obconf pixmapdir = $(datadir)/pixmaps themedir = $(datadir)/openbox/themes desktopdir = $(datadir)/applications @@ -19,12 +19,11 @@ src_obconf_CPPFLAGS = \ $(OPENBOX_CFLAGS) \ $(LIBSTARTUPNOTIFICATION_CFLAGS) \ $(GTK_CFLAGS) \ - $(GLADE_CFLAGS) \ $(GDK_PIXBUF_CFLAGS) \ $(XML_CFLAGS) \ -DLOCALEDIR=\"$(localedir)\" \ -DPIXMAPDIR=\"$(pixmapdir)\" \ - -DGLADEDIR=\"$(gladedir)\" \ + -DRESOURCEDIR=\"$(resourcedir)\" \ -DTHEMEDIR=\"$(themedir)\" \ -DG_LOG_DOMAIN=\"Obconf\" src_obconf_LDADD = \ @@ -31,7 +30,6 @@ src_obconf_LDADD = \ $(OPENBOX_LIBS) \ $(LIBSTARTUPNOTIFICATION_LIBS) \ $(GTK_LIBS) \ - $(GLADE_LIBS) \ $(GDK_PIXBUF_LIBS) \ $(LIBINTL) \ $(ZLIB_LIBS) \ @@ -66,13 +64,10 @@ src_obconf_SOURCES = \ src/tree.c \ src/tree.h -dist_glade_DATA = \ - src/obconf.glade \ +dist_resource_DATA = \ + src/obconf.ui \ pixmaps/video-display.png -dist_noinst_DATA = \ - src/obconf.gladep - dist_desktop_DATA = \ obconf.desktop @@ -121,8 +116,7 @@ EXTRA_DIST = \ m4/wchar_t.m4 \ m4/wint_t.m4 \ m4/xsize.m4 \ - data/video-display.svg \ - config.rpath + data/video-display.svg # Packages need to run these... diff --git a/NEWS b/NEWS deleted file mode 100644 index e69de29..0000000 diff --git a/TODO b/TODO deleted file mode 100644 index e69de29..0000000 diff --git a/configure.ac b/configure.ac index f9b0775..b99620f 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ AC_PREREQ([2.54]) AC_INIT([obconf], [2.0.4], [http://bugzilla.icculus.org]) -AM_INIT_AUTOMAKE +AM_INIT_AUTOMAKE([subdir-objects foreign dist-xz]) AC_CONFIG_SRCDIR([src/main.c]) AC_PREFIX_DEFAULT([/usr/local]) @@ -16,7 +16,6 @@ AC_PROG_INSTALL CHECK_EXPORT_DYNAMIC LDFLAGS="$LDFLAGS $EXPORT_DYNAMIC_FLAGS" -ALL_LINGUAS="" AM_GNU_GETTEXT_VERSION(0.15) AM_GNU_GETTEXT([external]) @@ -28,7 +27,7 @@ PKG_CHECK_MODULES(LIBSTARTUPNOTIFICATION, [libstartup-notification-1.0]) AC_SUBST(LIBSTARTUPNOTIFICATION_CFLAGS) AC_SUBST(LIBSTARTUPNOTIFICATION_LIBS) -PKG_CHECK_MODULES(GTK, [gtk+-2.0]) +PKG_CHECK_MODULES(GTK, [gtk+-2.0 >= 2.24.0]) AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) @@ -36,10 +35,6 @@ PKG_CHECK_MODULES(GDK_PIXBUF, [gdk-pixbuf-2.0]) AC_SUBST(GDK_PIXBUF_CFLAGS) AC_SUBST(GDK_PIXBUF_LIBS) -PKG_CHECK_MODULES(GLADE, [libglade-2.0]) -AC_SUBST(GLADE_CFLAGS) -AC_SUBST(GLADE_LIBS) - AC_CHECK_PROG(TAR, [tar], [yes], [no]) if test "$TAR" = "no"; then AC_MSG_ERROR([Unable to find the tar command.]) diff --git a/src/about.c b/src/about.c index c56eb26..5fed1a9 100644 --- a/src/about.c +++ b/src/about.c @@ -10,7 +10,8 @@ void on_about_close_clicked() gtk_widget_hide(get_widget("about_window")); } -void on_about_window_delete_event() +gboolean on_about_window_delete_event() { gtk_widget_hide(get_widget("about_window")); + return TRUE; } diff --git a/src/desktops.c b/src/desktops.c index 6f205c4..8297f00 100644 --- a/src/desktops.c +++ b/src/desktops.c @@ -212,7 +212,7 @@ static void desktops_write_names() tree_apply(); /* make openbox re-set the property */ - XDeleteProperty(GDK_DISPLAY(), GDK_ROOT_WINDOW(), + XDeleteProperty(gdk_x11_get_default_xdisplay(), GDK_ROOT_WINDOW(), gdk_x11_get_xatom_by_name("_NET_DESKTOP_NAMES")); } @@ -225,7 +225,7 @@ static void desktops_write_number() ce.xclient.type = ClientMessage; ce.xclient.message_type = gdk_x11_get_xatom_by_name("_NET_NUMBER_OF_DESKTOPS"); - ce.xclient.display = GDK_DISPLAY(); + ce.xclient.display = gdk_x11_get_default_xdisplay(); ce.xclient.window = GDK_ROOT_WINDOW(); ce.xclient.format = 32; ce.xclient.data.l[0] = num_desktops; @@ -233,7 +233,7 @@ static void desktops_write_number() ce.xclient.data.l[2] = 0; ce.xclient.data.l[3] = 0; ce.xclient.data.l[4] = 0; - XSendEvent(GDK_DISPLAY(), GDK_ROOT_WINDOW(), FALSE, + XSendEvent(gdk_x11_get_default_xdisplay(), GDK_ROOT_WINDOW(), FALSE, SubstructureNotifyMask | SubstructureRedirectMask, &ce); } diff --git a/src/dock.c b/src/dock.c index c1b8d54..4055524 100644 --- a/src/dock.c +++ b/src/dock.c @@ -82,7 +82,7 @@ void dock_setup_tab() else if (!strcasecmp(s, "Floating")) pos = POSITION_FLOATING; else pos = POSITION_TOPLEFT; g_free(s); - gtk_option_menu_set_history(GTK_OPTION_MENU(w), pos); + gtk_combo_box_set_active(GTK_COMBO_BOX(w), pos); w = get_widget("dock_float_x"); gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), @@ -107,7 +107,7 @@ void dock_setup_tab() if (!strcasecmp(s, "Horizontal")) pos = DIRECTION_HORIZONTAL; else pos = DIRECTION_VERTICAL; g_free(s); - gtk_option_menu_set_history(GTK_OPTION_MENU(w), pos); + gtk_combo_box_set_active(GTK_COMBO_BOX(w), pos); w = get_widget("dock_nostrut"); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w), @@ -136,7 +136,7 @@ static void dock_enable_stuff() gboolean b; w = get_widget("dock_position"); - b = gtk_option_menu_get_history(GTK_OPTION_MENU(w)) == POSITION_FLOATING; + b = gtk_combo_box_get_active(GTK_COMBO_BOX(w)) == POSITION_FLOATING; s = get_widget("dock_float_x"); gtk_widget_set_sensitive(s, b); @@ -166,75 +166,39 @@ static void dock_enable_stuff() gtk_widget_set_sensitive(s, b); } -void on_dock_top_left_activate(GtkMenuItem *w, gpointer data) +void on_dock_position_changed(GtkComboBox *w, gpointer data) { if (mapping) return; - tree_set_string("dock/position", "TopLeft"); - dock_enable_stuff(); -} - -void on_dock_top_activate(GtkMenuItem *w, gpointer data) -{ - if (mapping) return; - - tree_set_string("dock/position", "Top"); - dock_enable_stuff(); -} - -void on_dock_top_right_activate(GtkMenuItem *w, gpointer data) -{ - if (mapping) return; - - tree_set_string("dock/position", "TopRight"); - dock_enable_stuff(); -} - -void on_dock_left_activate(GtkMenuItem *w, gpointer data) -{ - if (mapping) return; - - tree_set_string("dock/position", "Left"); - dock_enable_stuff(); -} - -void on_dock_right_activate(GtkMenuItem *w, gpointer data) -{ - if (mapping) return; - - tree_set_string("dock/position", "Right"); - dock_enable_stuff(); -} - -void on_dock_bottom_left_activate(GtkMenuItem *w, gpointer data) -{ - if (mapping) return; - - tree_set_string("dock/position", "BottomLeft"); - dock_enable_stuff(); -} - -void on_dock_bottom_activate(GtkMenuItem *w, gpointer data) -{ - if (mapping) return; - - tree_set_string("dock/position", "Bottom"); - dock_enable_stuff(); -} - -void on_dock_bottom_right_activate(GtkMenuItem *w, gpointer data) -{ - if (mapping) return; - - tree_set_string("dock/position", "BottomRight"); - dock_enable_stuff(); -} - -void on_dock_floating_activate(GtkMenuItem *w, gpointer data) -{ - if (mapping) return; - - tree_set_string("dock/position", "Floating"); + switch (gtk_combo_box_get_active(w)) { + case 0: + tree_set_string("dock/position", "TopLeft"); + break; + case 1: + tree_set_string("dock/position", "Top"); + break; + case 2: + tree_set_string("dock/position", "TopRight"); + break; + case 3: + tree_set_string("dock/position", "Left"); + break; + case 4: + tree_set_string("dock/position", "Right"); + break; + case 5: + tree_set_string("dock/position", "BottomLeft"); + break; + case 6: + tree_set_string("dock/position", "Bottom"); + break; + case 7: + tree_set_string("dock/position", "BottomRight"); + break; + case 8: + tree_set_string("dock/position", "Floating"); + break; + } dock_enable_stuff(); } @@ -276,18 +240,18 @@ void on_dock_stacking_bottom_toggled(GtkToggleButton *w, gpointer data) tree_set_string("dock/stacking", "Below"); } -void on_dock_horizontal_activate(GtkMenuItem *w, gpointer data) -{ - if (mapping) return; - - tree_set_string("dock/direction", "Horizontal"); -} - -void on_dock_vertical_activate(GtkMenuItem *w, gpointer data) +void on_dock_direction_changed(GtkComboBox *w, gpointer data) { if (mapping) return; - tree_set_string("dock/direction", "Vertical"); + switch (gtk_combo_box_get_active(w)) { + case 0: + tree_set_string("dock/direction", "Vertical"); + break; + case 1: + tree_set_string("dock/direction", "Horizontal"); + break; + } } void on_dock_nostrut_toggled(GtkToggleButton *w, gpointer data) diff --git a/src/main.c b/src/main.c index 7acc3ec..ff11ef9 100644 --- a/src/main.c +++ b/src/main.c @@ -38,7 +38,7 @@ GtkWidget *mainwin = NULL; GtkWidget *tabstrip = NULL; -GladeXML *glade; +GtkBuilder *builder; xmlDocPtr doc; xmlNodePtr root; RrInstance *rrinst; @@ -63,9 +63,9 @@ void obconf_error(gchar *msg, gboolean modal) if (modal) gtk_dialog_run(GTK_DIALOG(d)); else { - g_signal_connect_swapped(GTK_OBJECT(d), "response", + g_signal_connect_swapped(G_OBJECT(d), "response", G_CALLBACK(gtk_widget_destroy), - GTK_OBJECT(d)); + G_OBJECT(d)); gtk_widget_show(d); } } @@ -149,7 +149,7 @@ static gboolean get_all(Window win, Atom prop, Atom type, gint size, gint ret_size; gulong ret_items, bytes_left; - res = XGetWindowProperty(GDK_DISPLAY(), win, prop, 0l, G_MAXLONG, + res = XGetWindowProperty(gdk_x11_get_default_xdisplay(), win, prop, 0l, G_MAXLONG, FALSE, type, &ret_type, &ret_size, &ret_items, &bytes_left, &xdata); if (res == Success) { @@ -203,6 +203,7 @@ static gboolean prop_get_string_utf8(Window win, Atom prop, gchar **ret) int main(int argc, char **argv) { gchar *p; + GError *error = NULL; gboolean exit_with_error = FALSE; bindtextdomain(PACKAGE_NAME, LOCALEDIR); @@ -217,18 +218,21 @@ int main(int argc, char **argv) return 0; } - p = g_build_filename(GLADEDIR, "obconf.glade", NULL); - glade = glade_xml_new(p, NULL, NULL); + p = g_build_filename(RESOURCEDIR, "obconf.ui", NULL); + builder = gtk_builder_new(); + gtk_builder_add_from_file(builder, p, &error); g_free(p); - if (!glade) { - obconf_error(_("Failed to load the obconf.glade interface file. You have probably failed to install ObConf properly."), TRUE); + if (error) { + obconf_error(_("Failed to load the obconf.ui interface file. You have probably failed to install ObConf properly."), TRUE); + g_printerr("%s\n", error->message); + g_error_free(error); exit_with_error = TRUE; } paths = obt_paths_new(); parse_i = obt_xml_instance_new(); - rrinst = RrInstanceNew(GDK_DISPLAY(), gdk_x11_get_default_screen()); + rrinst = RrInstanceNew(gdk_x11_get_default_xdisplay(), gdk_x11_get_default_screen()); if (!obc_config_file) { gchar *p; @@ -270,14 +274,14 @@ int main(int argc, char **argv) } if (!exit_with_error) { - glade_xml_signal_autoconnect(glade); + gtk_builder_connect_signals(builder, NULL); { gchar *s = g_strdup_printf ("ObConf %s", PACKAGE_VERSION); gtk_label_set_markup(GTK_LABEL - (glade_xml_get_widget(glade, "title_label")), + (gtk_builder_get_object(builder, "title_label")), s); g_free(s); } @@ -292,7 +296,7 @@ int main(int argc, char **argv) dock_setup_tab(); mainwin = get_widget("main_window"); - tabstrip = glade_xml_get_widget(glade, "tabstrip"); + tabstrip = get_widget("tabstrip"); if (obc_theme_install) theme_install(obc_theme_install); @@ -336,7 +340,7 @@ void obconf_show_main() SnDisplay *sn_d; SnLauncheeContext *sn_cx; - if (GTK_WIDGET_VISIBLE(mainwin)) return; + if (gtk_widget_get_visible(mainwin)) return; gtk_widget_show_all(mainwin); @@ -354,7 +358,7 @@ void obconf_show_main() if (sn_cx) sn_launchee_context_setup_window - (sn_cx, GDK_WINDOW_XWINDOW(GDK_WINDOW(mainwin->window))); + (sn_cx, GDK_WINDOW_XID(gtk_widget_get_window(mainwin))); if (sn_cx) sn_launchee_context_complete(sn_cx); diff --git a/src/main.h b/src/main.h index 4f3213b..23852d3 100644 --- a/src/main.h +++ b/src/main.h @@ -25,16 +25,15 @@ #include #include -#include -extern GladeXML *glade; +extern GtkBuilder *builder; 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) +#define get_widget(s) GTK_WIDGET(gtk_builder_get_object(builder, s)) void obconf_error(gchar *msg, gboolean model); void obconf_show_main(); diff --git a/src/mouse.c b/src/mouse.c index 88f13d9..ce9059a 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -30,8 +30,6 @@ static xmlNodePtr saved_custom = NULL; static gint read_doubleclick_action(); static void write_doubleclick_action(gint a); -static void on_titlebar_doubleclick_custom_activate(GtkMenuItem *w, - gpointer data); static void enable_stuff(); void mouse_setup_tab() @@ -69,16 +67,10 @@ void mouse_setup_tab() w = get_widget("titlebar_doubleclick"); a = read_doubleclick_action(); if (a == TITLEBAR_CUSTOM) { - GtkWidget *i = gtk_menu_item_new_with_label(_("Custom actions")); - g_signal_connect(i, "activate", - G_CALLBACK (on_titlebar_doubleclick_custom_activate), - NULL); - gtk_menu_shell_append - (GTK_MENU_SHELL - (gtk_option_menu_get_menu - (GTK_OPTION_MENU(w))), i); + gtk_combo_box_text_append_text + (GTK_COMBO_BOX_TEXT(w), _("Custom actions")); } - gtk_option_menu_set_history(GTK_OPTION_MENU(w), a); + gtk_combo_box_set_active(GTK_COMBO_BOX(w), a); enable_stuff(); @@ -147,26 +139,21 @@ void on_focus_under_mouse_toggled(GtkToggleButton *w, gpointer data) tree_set_bool("focus/underMouse", gtk_toggle_button_get_active(w)); } -void on_titlebar_doubleclick_maximize_activate(GtkMenuItem *w, gpointer data) +void on_titlebar_doubleclick_changed(GtkComboBox *w, gpointer data) { if (mapping) return; - write_doubleclick_action(TITLEBAR_MAXIMIZE); -} - -void on_titlebar_doubleclick_shade_activate(GtkMenuItem *w, gpointer data) -{ - if (mapping) return; - - write_doubleclick_action(TITLEBAR_SHADE); -} - -static void on_titlebar_doubleclick_custom_activate(GtkMenuItem *w, - gpointer data) -{ - if (mapping) return; - - write_doubleclick_action(TITLEBAR_CUSTOM); + switch (gtk_combo_box_get_active(w)) { + case 0: + write_doubleclick_action(TITLEBAR_MAXIMIZE); + break; + case 1: + write_doubleclick_action(TITLEBAR_SHADE); + break; + case 2: + write_doubleclick_action(TITLEBAR_CUSTOM); + break; + } } void on_doubleclick_time_value_changed(GtkSpinButton *w, gpointer data) diff --git a/src/moveresize.c b/src/moveresize.c index 6048a37..c6fb3dd 100644 --- a/src/moveresize.c +++ b/src/moveresize.c @@ -82,7 +82,7 @@ void moveresize_setup_tab() else if (!strcasecmp(s, "Never")) pos = POPUP_NEVER; else pos = POPUP_NONPIXEL; g_free(s); - gtk_option_menu_set_history(GTK_OPTION_MENU(w), pos); + gtk_combo_box_set_active(GTK_COMBO_BOX(w), pos); w = get_widget("drag_threshold"); gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), @@ -94,7 +94,7 @@ void moveresize_setup_tab() if (!strcasecmp(s, "Fixed")) pos = POSITION_FIXED; else pos = POSITION_CENTER; g_free(s); - gtk_option_menu_set_history(GTK_OPTION_MENU(w), pos); + gtk_combo_box_set_active(GTK_COMBO_BOX(w), pos); w = get_widget("fixed_x_popup"); s = tree_get_string("resize/popupFixedPosition/x", "0"); @@ -103,7 +103,7 @@ void moveresize_setup_tab() if (!strcasecmp(s, "Center")) pos = EDGE_CENTER; else if (opp) pos = EDGE_RIGHT; else pos = EDGE_LEFT; - gtk_option_menu_set_history(GTK_OPTION_MENU(w), pos); + gtk_combo_box_set_active(GTK_COMBO_BOX(w), pos); w = get_widget("fixed_x_pos"); gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), MAX(atoi(s), 0)); @@ -115,7 +115,7 @@ void moveresize_setup_tab() if (!strcasecmp(s, "Center")) pos = EDGE_CENTER; else if (opp) pos = EDGE_RIGHT; else pos = EDGE_LEFT; - gtk_option_menu_set_history(GTK_OPTION_MENU(w), pos); + gtk_combo_box_set_active(GTK_COMBO_BOX(w), pos); w = get_widget("fixed_y_pos"); gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), MAX(atoi(s), 0)); @@ -140,7 +140,7 @@ static void enable_stuff() gboolean b; w = get_widget("resize_popup"); - b = gtk_option_menu_get_history(GTK_OPTION_MENU(w)) != POPUP_NEVER; + b = gtk_combo_box_get_active(GTK_COMBO_BOX(w)) != POPUP_NEVER; w = get_widget("resize_position"); gtk_widget_set_sensitive(w, b); @@ -150,7 +150,7 @@ static void enable_stuff() gtk_widget_set_sensitive(w, b); w = get_widget("resize_position"); - b = gtk_option_menu_get_history(GTK_OPTION_MENU(w)) == POSITION_FIXED; + b = gtk_combo_box_get_active(GTK_COMBO_BOX(w)) == POSITION_FIXED; w = get_widget("fixed_x_popup"); gtk_widget_set_sensitive(w, b); w = get_widget("fixed_y_popup"); @@ -163,12 +163,12 @@ static void enable_stuff() } else { w = get_widget("fixed_x_popup"); - b = gtk_option_menu_get_history(GTK_OPTION_MENU(w)) != EDGE_CENTER; + b = gtk_combo_box_get_active(GTK_COMBO_BOX(w)) != EDGE_CENTER; w = get_widget("fixed_x_pos"); gtk_widget_set_sensitive(w, b); w = get_widget("fixed_y_popup"); - b = gtk_option_menu_get_history(GTK_OPTION_MENU(w)) != EDGE_CENTER; + b = gtk_combo_box_get_active(GTK_COMBO_BOX(w)) != EDGE_CENTER; w = get_widget("fixed_y_pos"); gtk_widget_set_sensitive(w, b); } @@ -196,27 +196,21 @@ void on_resize_contents_toggled(GtkToggleButton *w, gpointer data) tree_set_bool("resize/drawContents", gtk_toggle_button_get_active(w)); } -void on_resize_popup_nonpixel_activate(GtkMenuItem *w, gpointer data) +void on_resize_popup_changed(GtkComboBox *w, gpointer data) { if (mapping) return; - tree_set_string("resize/popupShow", "NonPixel"); - enable_stuff(); -} - -void on_resize_popup_always_activate(GtkMenuItem *w, gpointer data) -{ - if (mapping) return; - - tree_set_string("resize/popupShow", "Always"); - enable_stuff(); -} - -void on_resize_popup_never_activate(GtkMenuItem *w, gpointer data) -{ - if (mapping) return; - - tree_set_string("resize/popupShow", "Never"); + switch(gtk_combo_box_get_active(w)) { + case 0: + tree_set_string("resize/popupShow", "NonPixel"); + break; + case 1: + tree_set_string("resize/popupShow", "Always"); + break; + case 2: + tree_set_string("resize/popupShow", "Never"); + break; + } enable_stuff(); } @@ -228,27 +222,21 @@ void on_drag_threshold_value_changed(GtkSpinButton *w, gpointer data) gtk_spin_button_get_value_as_int(w)); } -void on_resize_position_center_activate(GtkMenuItem *w, gpointer data) +void on_resize_position_changed(GtkComboBox *w, gpointer data) { if (mapping) return; - tree_set_string("resize/popupPosition", "Center"); - enable_stuff(); -} - -void on_resize_position_top_activate(GtkMenuItem *w, gpointer data) -{ - if (mapping) return; - - tree_set_string("resize/popupPosition", "Top"); - enable_stuff(); -} - -void on_resize_position_fixed_activate(GtkMenuItem *w, gpointer data) -{ - if (mapping) return; - - tree_set_string("resize/popupPosition", "Fixed"); + switch(gtk_combo_box_get_active(w)) { + case 0: + tree_set_string("resize/popupPosition", "Center"); + break; + case 1: + tree_set_string("resize/popupPosition", "Top"); + break; + case 2: + tree_set_string("resize/popupPosition", "Fixed"); + break; + } enable_stuff(); } @@ -266,7 +254,7 @@ static void write_fixed_position(const gchar *coord) popup = get_widget(popupname); g_free(popupname); - edge = gtk_option_menu_get_history(GTK_OPTION_MENU(popup)); + edge = gtk_combo_box_get_active(GTK_COMBO_BOX(popup)); g_assert(edge == EDGE_CENTER || edge == EDGE_LEFT || edge == EDGE_RIGHT); if (edge == EDGE_CENTER) @@ -295,23 +283,7 @@ static void write_fixed_position(const gchar *coord) } -void on_fixed_x_position_left_activate(GtkMenuItem *w, gpointer data) -{ - if (mapping) return; - - write_fixed_position("x"); - enable_stuff(); -} - -void on_fixed_x_position_right_activate(GtkMenuItem *w, gpointer data) -{ - if (mapping) return; - - write_fixed_position("x"); - enable_stuff(); -} - -void on_fixed_x_position_center_activate(GtkMenuItem *w, gpointer data) +void on_fixed_x_position_changed(GtkComboBox *w, gpointer data) { if (mapping) return; @@ -319,23 +291,7 @@ void on_fixed_x_position_center_activate(GtkMenuItem *w, gpointer data) enable_stuff(); } -void on_fixed_y_position_top_activate(GtkMenuItem *w, gpointer data) -{ - if (mapping) return; - - write_fixed_position("y"); - enable_stuff(); -} - -void on_fixed_y_position_bottom_activate(GtkMenuItem *w, gpointer data) -{ - if (mapping) return; - - write_fixed_position("y"); - enable_stuff(); -} - -void on_fixed_y_position_center_activate(GtkMenuItem *w, gpointer data) +void on_fixed_y_position_changed(GtkComboBox *w, gpointer data) { if (mapping) return; diff --git a/src/obconf.gladep b/src/obconf.gladep deleted file mode 100644 index 5bcc940..0000000 --- a/src/obconf.gladep +++ /dev/null @@ -1,13 +0,0 @@ - - - - - ObConf - obconf - ../ - - ../pixmaps - FALSE - TRUE - strings.c - diff --git a/src/obconf.glade b/src/obconf.ui similarity index 75% rename from src/obconf.glade rename to src/obconf.ui index faf98e0..b2efefb 100644 --- a/src/obconf.glade +++ b/src/obconf.ui @@ -1,31 +1,182 @@ - - + + + + 100 + 1 + 10 + 1 + 0 + 1 + + + 10000 + 1 + 10 + 10 + 0 + 1 + + + 100 + 1 + 10 + 1 + 0 + 1 + + + 10000 + 0 + 10 + 1 + 0 + 20 + + + 10000 + 0 + 10 + 1 + 0 + 20 + + + 10000 + 0 + 10 + 1 + 0 + 20 + + + 10000 + 0 + 10 + 1 + 0 + 20 + + + 10000 + 0 + 10 + 1 + 0 + 1 + + + 10000 + 0 + 10 + 1 + 0 + 1 + + + 10000 + 0 + 10 + 10 + 0 + 300 + + + 10000 + 0 + 10 + 10 + 0 + 300 + + + 100 + 1 + 10 + 1 + 0 + 1 + + + 100 + 0 + 10 + 1 + 0 + 20 + + + 100 + 0 + 10 + 1 + 0 + 1 + + + 10000 + 100 + 10 + 10 + 0 + 100 + + + 1000 + 0 + 10 + 1 + 0 + 1 + + + 1000 + 0 + 10 + 1 + 0 + 1 + + + 10000 + 0 + 10 + 10 + 0 + 0 + + + 10000 + 0 + 10 + 10 + 0 + 0 + - + False About ObConf - dialog - - - + + + True False 12 12 - + True False 6 - + True True <span weight="bold" size="xx-large">ObConf VERSION</span> True True - + False False @@ -33,12 +184,12 @@ - + True True A preferences manager for Openbox True - + False False @@ -46,7 +197,7 @@ - + True True Copyright (c) 2003-2008 @@ -55,27 +206,27 @@ Tim Riley <tr@slackzone.org> Javeed Shaikh <syscrash2k@gmail.com> center True - + False False 2 - + True True 0 - - + + True False end - + gtk-close True True @@ -85,41 +236,39 @@ Javeed Shaikh <syscrash2k@gmail.com> False False True - - + + False False 0 - - - True - True - 1 - + - + - - + + about_close + + + False window1 - + True False 12 18 - + True False 0 <span weight="bold">Press the key you wish to bind...</span> True - + False False @@ -127,61 +276,61 @@ Javeed Shaikh <syscrash2k@gmail.com> - + True True True - + False False True True - + False False 1 - + - - + + False 6 Openbox Configuration Manager preferences-system-windows - + - + True False 6 - + True True left True - + True False 12 6 - + True False 6 - + True False 0 <span weight="bold">Theme</span> True - + False False @@ -189,15 +338,15 @@ Javeed Shaikh <syscrash2k@gmail.com> - + True False - + True False - + False False @@ -205,46 +354,46 @@ Javeed Shaikh <syscrash2k@gmail.com> - + True False 6 - + True True never automatic in - + True True False - + - + True True 0 - + True True 1 - + True True 1 - + True True @@ -252,34 +401,34 @@ Javeed Shaikh <syscrash2k@gmail.com> - + True False - + True True False False - + - + True False 0 0 0 - + True False 2 - + True False gtk-open - + False False @@ -287,30 +436,30 @@ Javeed Shaikh <syscrash2k@gmail.com> - + True False _Install a new theme... True - + False False 1 - + - + - + False False 0 - + False True @@ -318,34 +467,34 @@ Javeed Shaikh <syscrash2k@gmail.com> - + True False - + True True False False - + - + True False 0 0 0 - + True False 2 - + True False gtk-save - + False False @@ -353,71 +502,70 @@ Javeed Shaikh <syscrash2k@gmail.com> - + True False Create a theme _archive (.obt)... True - + False False 1 - + - + - + False False 0 - + False True 2 - + - - + + True False 0 6 8 Theme - + False - tab - + True False 12 18 - + True False 6 - + True False 0 <span weight="bold">Windows</span> True - + False False @@ -425,23 +573,23 @@ Javeed Shaikh <syscrash2k@gmail.com> - + True False - + True False - + True False - + True False - + False False @@ -449,40 +597,29 @@ Javeed Shaikh <syscrash2k@gmail.com> - + True False 6 - + + _Windows retain a border when undecorated True - False - - - _Windows retain a border when undecorated - True - True - False - False - True - True - - - - False - False - 0 - - - + True + False + False + True + True + + - True - True + False + False 0 - + A_nimate iconify and restore True True @@ -490,43 +627,43 @@ Javeed Shaikh <syscrash2k@gmail.com> False True True - - + + False False 1 - + True True 1 - + True True 0 - + True True 0 - + False True 1 - + False True @@ -534,18 +671,18 @@ Javeed Shaikh <syscrash2k@gmail.com> - + True False 6 - + True False 0 <span weight="bold">Window Titles</span> True - + False False @@ -553,15 +690,15 @@ Javeed Shaikh <syscrash2k@gmail.com> - + True False - + True False - + False False @@ -569,23 +706,23 @@ Javeed Shaikh <syscrash2k@gmail.com> - + True False 6 - + True False 6 - + True False _Button order: True title_layout - + False False @@ -593,10 +730,10 @@ Javeed Shaikh <syscrash2k@gmail.com> - + True True - N - The window's icon + N - The window's icon D - The all-desktops (sticky) button S - The shade (roll up) button L - The label (window title) @@ -607,15 +744,15 @@ C - The close button False True True - - + + False True 1 - + True True @@ -623,16 +760,16 @@ C - The close button - + True False 6 - + True False - + False False @@ -640,12 +777,12 @@ C - The close button - + True False 6 - + True False 0 @@ -654,7 +791,7 @@ C - The close button L: I: M: - + False False @@ -662,7 +799,7 @@ M: - + True False 0 @@ -671,7 +808,7 @@ M: Window label (Title) Iconify (Minimize) Maximize - + False False @@ -679,10 +816,10 @@ Maximize - + True False - + False False @@ -690,7 +827,7 @@ Maximize - + True False 0 @@ -698,7 +835,7 @@ Maximize C: S: D: - + False False @@ -706,7 +843,7 @@ D: - + True False 0 @@ -714,42 +851,42 @@ D: Close Shade (Roll up) Omnipresent (On all desktops) - + False False 4 - + True True 1 - + True True 1 - + True True 1 - + True True 1 - + False True @@ -757,18 +894,18 @@ Omnipresent (On all desktops) - + True False 6 - + True False 0 <span weight="bold">Fonts</span> True - + False False @@ -776,15 +913,15 @@ Omnipresent (On all desktops) - + True False - + True False - + False False @@ -792,21 +929,21 @@ Omnipresent (On all desktops) - + True False 6 2 3 - + True True False False True - - + + 1 2 @@ -817,14 +954,14 @@ Omnipresent (On all desktops) - + True True False False True - - + + 1 2 @@ -835,14 +972,14 @@ Omnipresent (On all desktops) - + True True False False True - - + + 1 2 @@ -853,28 +990,28 @@ Omnipresent (On all desktops) - + True False 1 _Active window title: True font_active - + GTK_FILL - + True False 1 _Inactive window title: True font_inactive - + 1 2 @@ -883,14 +1020,14 @@ Omnipresent (On all desktops) - + True False 1 Menu _header: True font_menu_header - + 2 3 @@ -899,14 +1036,14 @@ Omnipresent (On all desktops) - + True False 1 _Menu Item: True font_menu_item - + 3 4 @@ -915,13 +1052,13 @@ Omnipresent (On all desktops) - + True False 1 Active _On-screen display: True - + 4 5 @@ -930,14 +1067,14 @@ Omnipresent (On all desktops) - + True True False False True - - + + 1 2 @@ -945,13 +1082,13 @@ Omnipresent (On all desktops) - + True False 1 Inactive O_n-screen display: True - + 5 6 @@ -960,14 +1097,14 @@ Omnipresent (On all desktops) - + True True False False True - - + + 1 2 @@ -978,14 +1115,14 @@ Omnipresent (On all desktops) - + True True False False True - - + + 1 2 @@ -995,66 +1132,62 @@ Omnipresent (On all desktops) - + True True 1 - + True True 1 - + False True 2 - - - 1 - + - - + + True False 0 6 8 Appearance - + 1 False - tab - + True False 12 18 - + True False 6 - + True False 0 <span weight="bold">Focusing Windows</span> True - + False False @@ -1062,15 +1195,15 @@ Omnipresent (On all desktops) - + True False - + True False - + False False @@ -1078,12 +1211,12 @@ Omnipresent (On all desktops) - + True False 6 - + Focus _new windows when they appear True True @@ -1091,29 +1224,29 @@ Omnipresent (On all desktops) False True True - - + + False False 0 - + True True 1 - + - True + False True 1 - + False True @@ -1121,18 +1254,18 @@ Omnipresent (On all desktops) - + True False 6 - + True False 0 <span weight="bold">Placing Windows</span> True - + False False @@ -1140,15 +1273,15 @@ Omnipresent (On all desktops) - + True False - + True False - + False False @@ -1156,12 +1289,12 @@ Omnipresent (On all desktops) - + True False 6 - + _Place new windows under the mouse pointer True True @@ -1169,8 +1302,8 @@ Omnipresent (On all desktops) False True True - - + + False False @@ -1181,19 +1314,19 @@ Omnipresent (On all desktops) - + True False 12 - + True False 0 Prefer to place new windows _on: True place_active_popup - + False False @@ -1201,84 +1334,46 @@ Omnipresent (On all desktops) - + True True False - - - False - - - True - False - False - The primary monitor - True - - - - - - True - False - False - The active monitor - True - - - - - - True - False - False - The monitor with the mouse - True - - - - - - True - False - False - All monitors - True - - - - - - + + The primary monitor + The active monitor + The monitor with the mouse + All monitors + + + False False 1 - + - True + False True 2 - + True True 1 - + - True + False True 1 - + False True @@ -1286,18 +1381,18 @@ Omnipresent (On all desktops) - + True False 6 - + True False 0 <span weight="bold">Primary Monitor</span> True - + False False @@ -1305,15 +1400,15 @@ Omnipresent (On all desktops) - + True False - + True False - + False False @@ -1321,16 +1416,16 @@ Omnipresent (On all desktops) - + True False 6 - + True False - + True False 0 @@ -1338,14 +1433,14 @@ Omnipresent (On all desktops) The primary monitor is where Openbox will place dialogs, such as the one used for cycling windows. True 0 - + False False 0 - + False False @@ -1353,19 +1448,19 @@ Omnipresent (On all desktops) - + True False 6 - + True False 0 Primary _monitor: True primary_monitor_popup - + False False @@ -1373,70 +1468,41 @@ Omnipresent (On all desktops) - + True True False - - - False - - - True - False - False - Fixed Monitor - True - - - - - - True - False - False - Active Monitor - True - - - - - - True - False - False - Monitor With Mouse Pointer - True - - - - - - + + Fixed Monitor + Active Monitor + Monitor With Mouse Pointer + + + False False 1 - + - True + False True 1 - + True False 6 - + True False - + False False @@ -1444,14 +1510,14 @@ Omnipresent (On all desktops) - + True False 0 _Fixed monitor: True fixed_monitor - + False False @@ -1459,90 +1525,86 @@ Omnipresent (On all desktops) - + True True False False True True - 1 1 100 1 10 0 + adjustment1 1 - - + + False False 2 - + - True + False True 2 - + True True 1 - + False True 1 - + False True 2 - - - 2 - + - - + + True False 0 6 8 Windows - + 2 False - tab - + True False 12 18 - + True False 6 - + True False 0 <span weight="bold">Moving and Resizing Windows</span> True - + False False @@ -1550,15 +1612,15 @@ Omnipresent (On all desktops) - + True False - + True False - + False False @@ -1566,12 +1628,12 @@ Omnipresent (On all desktops) - + True False 6 - + Update the window contents while _resizing True True @@ -1579,8 +1641,8 @@ Omnipresent (On all desktops) False True True - - + + False False @@ -1588,19 +1650,19 @@ Omnipresent (On all desktops) - + True False 6 - + True False 0 Drag _threshold distance: True drag_threshold - + False False @@ -1608,18 +1670,18 @@ Omnipresent (On all desktops) - + True True False False True True - 1 1 100 1 10 0 + adjustment2 1 True - - + + False True @@ -1627,38 +1689,38 @@ Omnipresent (On all desktops) - + True False px - + False False 2 - + - True + False True 1 - + True False 6 - + True False 0 Amount of resistance against other _windows: True resist_window - + False False @@ -1666,18 +1728,18 @@ Omnipresent (On all desktops) - + True True False False True True - 20 0 100 1 10 0 + adjustment3 1 True - - + + False True @@ -1685,18 +1747,18 @@ Omnipresent (On all desktops) - + True False px - + False False 2 - + False True @@ -1704,19 +1766,19 @@ Omnipresent (On all desktops) - + True False 6 - + True False 0 Amount of resistance against screen _edges: True resist_edge - + False False @@ -1724,18 +1786,18 @@ Omnipresent (On all desktops) - + True True False False True True - 1 0 100 1 10 0 + adjustment4 1 True - - + + False True @@ -1743,18 +1805,18 @@ Omnipresent (On all desktops) - + True False px - + False False 2 - + False True @@ -1762,7 +1824,7 @@ Omnipresent (On all desktops) - + _Switch desktops when moving a window past the screen edge True True @@ -1770,8 +1832,8 @@ Omnipresent (On all desktops) False True True - - + + False False @@ -1779,15 +1841,15 @@ Omnipresent (On all desktops) - + True False - + True False - + False False @@ -1795,19 +1857,19 @@ Omnipresent (On all desktops) - + True False 6 - + True False 0 _Amount of time to wait before switching: True warp_edge_time - + False False @@ -1815,18 +1877,18 @@ Omnipresent (On all desktops) - + True True False False True True - 100 100 10000 10 10 0 + adjustment5 1 True - - + + False True @@ -1834,46 +1896,46 @@ Omnipresent (On all desktops) - + True False ms - + False False 2 - + True True 1 - + False True 5 - + True True 1 - + False True 1 - + False True @@ -1881,18 +1943,18 @@ Omnipresent (On all desktops) - + True False 6 - + True False 0 <span weight="bold">Information Dialog</span> True - + False False @@ -1900,24 +1962,24 @@ Omnipresent (On all desktops) - + True False 6 - + True False 12 - + True False 0 Show _information dialog: True resize_popup - + False False @@ -1925,69 +1987,40 @@ Omnipresent (On all desktops) - + True True False - - - False - - - True - False - False - When resizing terminal windows - True - - - - - - True - False - False - Always - True - - - - - - True - False - False - Never - True - - - - - - + + When resizing terminal windows + Always + Never + + + False False 1 - + - True + False True 0 - + True False - + True False - + False False @@ -1995,24 +2028,24 @@ Omnipresent (On all desktops) - + True False 6 - + True False 12 - + True False 0 Information dialog's _position: True resize_position - + False False @@ -2020,69 +2053,40 @@ Omnipresent (On all desktops) - + True True False - - - False - - - True - False - False - Centered on the window - True - - - - - - True - False - False - Above the window - True - - - - - - True - False - False - Fixed position on screen - True - - - - - - + + Centered on the window + Above the window + Fixed position on screen + + + False False 1 - + - True + False True 0 - + True False - + True False - + False False @@ -2090,24 +2094,24 @@ Omnipresent (On all desktops) - + True False 6 - + True False 12 - + True False 0 Fixed _x position: True fixed_x_popup - + False False @@ -2115,46 +2119,17 @@ Omnipresent (On all desktops) - + True True False - - - False - - - True - False - False - Centered - True - - - - - - True - False - False - From left edge - True - - - - - - True - False - False - From right edge - True - - - - - - + + Centered + From left edge + From right edge + + + False False @@ -2162,23 +2137,23 @@ Omnipresent (On all desktops) - + True False 6 - + True True False False True True - 1 0 1000 1 10 0 + adjustment6 1 True - - + + False True @@ -2186,45 +2161,45 @@ Omnipresent (On all desktops) - + True False px - + False False 1 - + True True 2 - + - True + False True 0 - + True False 12 - + True False 0 Fixed _y position: True fixed_y_popup - + False False @@ -2232,46 +2207,17 @@ Omnipresent (On all desktops) - + True True False - - - False - - - True - False - False - Centered - True - - - - - - True - False - False - From top edge - True - - - - - - True - False - False - From bottom edge - True - - - - - - + + Centered + From top edge + From bottom edge + + + False False @@ -2279,23 +2225,23 @@ Omnipresent (On all desktops) - + True False 6 - + True True False False True True - 1 0 1000 1 10 0 + adjustment7 1 True - - + + False True @@ -2303,112 +2249,108 @@ Omnipresent (On all desktops) - + True False px - + False False 1 - + True True 2 - + - True + False True 1 - + True True 1 - + True True 1 - + True True 1 - + True True 1 - + False True 1 - + False True 1 - - - 3 - + - - + + True False 0 6 8 Move & Resize - + 3 False - tab - + True False 12 18 - + True False 6 - + True False 0 <span weight="bold">Focusing Windows</span> True - + False False @@ -2416,15 +2358,15 @@ Omnipresent (On all desktops) - + True False - + True False - + False False @@ -2432,12 +2374,12 @@ Omnipresent (On all desktops) - + True False 6 - + _Focus windows when the mouse pointer moves over them True True @@ -2445,8 +2387,8 @@ Omnipresent (On all desktops) False True True - - + + False False @@ -2454,15 +2396,15 @@ Omnipresent (On all desktops) - + True False - + True False - + False False @@ -2470,12 +2412,12 @@ Omnipresent (On all desktops) - + True False 6 - + Move focus under the mouse when _switching desktops True True @@ -2483,8 +2425,8 @@ Omnipresent (On all desktops) False True True - - + + False False @@ -2492,7 +2434,7 @@ Omnipresent (On all desktops) - + Move focus _under the mouse when the mouse is not moving True True @@ -2500,8 +2442,8 @@ Omnipresent (On all desktops) False True True - - + + False False @@ -2509,7 +2451,7 @@ Omnipresent (On all desktops) - + _Raise windows when the mouse pointer moves over them True True @@ -2517,8 +2459,8 @@ Omnipresent (On all desktops) False True True - - + + False False @@ -2526,18 +2468,18 @@ Omnipresent (On all desktops) - + True False 6 - + True False _Delay before focusing and raising windows: True focus_delay - + False False @@ -2545,18 +2487,18 @@ Omnipresent (On all desktops) - + True True False False True True - 0 0 10000 10 10 0 + adjustment8 1 True - - + + False True @@ -2564,53 +2506,53 @@ Omnipresent (On all desktops) - + True False ms - + False False 2 - + - True + False True 3 - + True True 1 - + False - False + True 1 - + True True 1 - + False True 1 - + False True @@ -2618,18 +2560,18 @@ Omnipresent (On all desktops) - + True False 6 - + True False 0 <span weight="bold">Titlebar</span> True - + False False @@ -2637,15 +2579,15 @@ Omnipresent (On all desktops) - + True False - + True False - + False False @@ -2653,24 +2595,24 @@ Omnipresent (On all desktops) - + True False 6 - + True False 12 - + True False 0 Double click on the _titlebar: True titlebar_doubleclick - + False False @@ -2678,63 +2620,43 @@ Omnipresent (On all desktops) - + True True False - - - False - - - True - False - False - Maximizes the window - True - - - - - - True - False - False - Shades the window - True - - - - - - + + Maximizes the window + Shades the window + + + False False 1 - + - True + False True 0 - + True False 6 - + True False 0 Double click ti_me: True doubleclick_time - + False False @@ -2742,18 +2664,18 @@ Omnipresent (On all desktops) - + True True False False True True - 0 0 10000 10 10 0 + adjustment9 1 True - - + + False True @@ -2761,39 +2683,39 @@ Omnipresent (On all desktops) - + True False ms - + False False 2 - + - True + False True 1 - + True True 1 - + True True 1 - + False True @@ -2801,73 +2723,69 @@ Omnipresent (On all desktops) - + True False - + True False - + True False - + False False 0 - + - True + False True 0 - + False True 2 - - - 4 - + - - + + True False 0 6 8 Mouse - + 4 False - tab - + True False 12 6 - + True False 0 <span weight="bold">Desktops</span> True - + False False @@ -2875,15 +2793,15 @@ Omnipresent (On all desktops) - + True False - + True False - + False False @@ -2891,12 +2809,12 @@ Omnipresent (On all desktops) - + True False 6 - + _Show a notification when switching desktops True True @@ -2904,8 +2822,8 @@ Omnipresent (On all desktops) False True True - - + + False False @@ -2913,15 +2831,15 @@ Omnipresent (On all desktops) - + True False - + True False - + False False @@ -2929,19 +2847,19 @@ Omnipresent (On all desktops) - + True False 6 - + True False 0 _Amount of time to show the notification for: True desktop_popup_time - + False False @@ -2949,18 +2867,18 @@ Omnipresent (On all desktops) - + True True False False True True - 1 1 10000 10 10 0 + adjustment10 1 True - - + + False True @@ -2968,25 +2886,25 @@ Omnipresent (On all desktops) - + True False ms - + False False 2 - + True True 1 - + False True @@ -2994,18 +2912,18 @@ Omnipresent (On all desktops) - + True False 6 - + True False _Number of desktops: True desktop_num - + False False @@ -3013,25 +2931,25 @@ Omnipresent (On all desktops) - + True True False False True True - 1 1 100 1 10 0 + adjustment11 1 True - - + + False True 1 - + False True @@ -3039,14 +2957,14 @@ Omnipresent (On all desktops) - + True False 0 _Desktop names: True desktop_names - + False False @@ -3054,74 +2972,70 @@ Omnipresent (On all desktops) - + True True never automatic in - + True True False - + - + True True 4 - + True True 1 - + True True 1 - - - 5 - + - - + + True False 0 6 8 Desktops - + 5 False - tab - + True False 12 6 - + True False 0 <span weight="bold">Desktop Margins</span> True - + False False @@ -3129,15 +3043,15 @@ Omnipresent (On all desktops) - + True False - + True False - + False False @@ -3145,19 +3059,19 @@ Omnipresent (On all desktops) - + True False 6 - + True False 0 0 Desktop margins are reserved areas on the edge of your screen. New windows will not be placed within a margin, and maximized windows will not cover them. True - + False False @@ -3165,14 +3079,14 @@ Omnipresent (On all desktops) - + True False - + True False - + True True @@ -3180,14 +3094,14 @@ Omnipresent (On all desktops) - + True False - + True False - + True True @@ -3195,18 +3109,18 @@ Omnipresent (On all desktops) - + True False - + True False 4 _Top True margins_top - + False True @@ -3214,15 +3128,15 @@ Omnipresent (On all desktops) - + True False 6 - + True False - + True True @@ -3230,18 +3144,18 @@ Omnipresent (On all desktops) - + True True False False True True - 20 0 10000 1 10 0 + adjustment12 1 True - - + + False False @@ -3249,11 +3163,11 @@ Omnipresent (On all desktops) - + True False px - + False False @@ -3261,31 +3175,31 @@ Omnipresent (On all desktops) - + True False - + True True 3 - + False True 1 - + False True 1 - + True True @@ -3293,17 +3207,17 @@ Omnipresent (On all desktops) - + True False - + True True 2 - + True True @@ -3311,14 +3225,14 @@ Omnipresent (On all desktops) - + True False - + True False - + True True @@ -3326,14 +3240,14 @@ Omnipresent (On all desktops) - + True False - + True False - + True True @@ -3341,14 +3255,14 @@ Omnipresent (On all desktops) - + True False 4 _Left True margins_left - + False True @@ -3356,15 +3270,15 @@ Omnipresent (On all desktops) - + True False 6 - + True False - + True True @@ -3372,18 +3286,18 @@ Omnipresent (On all desktops) - + True True False False True True - 20 0 10000 1 10 0 + adjustment13 1 True - - + + False False @@ -3391,11 +3305,11 @@ Omnipresent (On all desktops) - + True False px - + False False @@ -3403,17 +3317,17 @@ Omnipresent (On all desktops) - + True False - + True True 3 - + False True @@ -3421,17 +3335,17 @@ Omnipresent (On all desktops) - + True False - + True True 3 - + False True @@ -3439,12 +3353,12 @@ Omnipresent (On all desktops) - + True False 150 video-display - + False False @@ -3452,14 +3366,14 @@ Omnipresent (On all desktops) - + True False - + True False - + True True @@ -3467,14 +3381,14 @@ Omnipresent (On all desktops) - + True False 4 _Right True margins_right - + False True @@ -3482,15 +3396,15 @@ Omnipresent (On all desktops) - + True False 6 - + True False - + True True @@ -3498,18 +3412,18 @@ Omnipresent (On all desktops) - + True True False False True True - 20 0 10000 1 10 0 + adjustment14 1 True - - + + False False @@ -3517,11 +3431,11 @@ Omnipresent (On all desktops) - + True False px - + False False @@ -3529,17 +3443,17 @@ Omnipresent (On all desktops) - + True False - + True True 3 - + False True @@ -3547,17 +3461,17 @@ Omnipresent (On all desktops) - + True False - + True True 3 - + False True @@ -3565,17 +3479,17 @@ Omnipresent (On all desktops) - + True False - + True True 4 - + True True @@ -3583,14 +3497,14 @@ Omnipresent (On all desktops) - + True False - + True False - + True True @@ -3598,18 +3512,18 @@ Omnipresent (On all desktops) - + True False - + True False 4 _Bottom True margins_bottom - + False True @@ -3617,15 +3531,15 @@ Omnipresent (On all desktops) - + True False 6 - + True False - + True True @@ -3633,18 +3547,18 @@ Omnipresent (On all desktops) - + True True False False True True - 20 0 10000 1 10 0 + adjustment15 1 True - - + + False False @@ -3652,11 +3566,11 @@ Omnipresent (On all desktops) - + True False px - + False False @@ -3664,17 +3578,17 @@ Omnipresent (On all desktops) - + True False - + True True 3 - + False True @@ -3682,17 +3596,17 @@ Omnipresent (On all desktops) - + True False - + True True 2 - + False True @@ -3700,17 +3614,17 @@ Omnipresent (On all desktops) - + True False - + True True 2 - + True True @@ -3718,69 +3632,65 @@ Omnipresent (On all desktops) - + True False - + True True 4 - + True True 1 - + True True 1 - - - 6 - + - - + + True False 0 6 8 Margins - + 6 False - tab - + True False 12 18 - + True False 6 - + True False 0 <span weight="bold">Dock</span> True - + False False @@ -3788,15 +3698,15 @@ Omnipresent (On all desktops) - + True False - + True False - + False False @@ -3804,7 +3714,7 @@ Omnipresent (On all desktops) - + 490 True False @@ -3812,21 +3722,21 @@ Omnipresent (On all desktops) 0 The dock is a special container for "dockapps", or dock applications. It is not visible on screen until a dockapp is run. Dockapps can be used to show things like a clock, or to provide you with a system tray. True - + True True 1 - + True True 1 - + False True @@ -3834,18 +3744,18 @@ Omnipresent (On all desktops) - + True False 6 - + True False 0 <span weight="bold">Position</span> True - + False False @@ -3853,15 +3763,15 @@ Omnipresent (On all desktops) - + True False - + True False - + False False @@ -3869,24 +3779,24 @@ Omnipresent (On all desktops) - + True False 6 - + True False 12 - + True False 0 _Position: True dock_position - + False False @@ -3894,113 +3804,30 @@ Omnipresent (On all desktops) - + True True False - - - False - - - True - False - False - Top Left - True - - - - - - True - False - False - Top - True - - - - - - True - False - False - Top Right - True - - - - - - True - False - False - Left - True - - - - - - True - False - False - Right - True - - - - - - True - False - False - Bottom Left - True - - - - - - True - False - False - Bottom - True - - - - - - True - False - False - Bottom Right - True - - - - - - True - False - False - Floating - True - - - - - - + + Top Left + Top + Top Right + Left + Right + Bottom Left + Bottom + Bottom Right + Floating + + + False False 1 - + False False @@ -4008,15 +3835,15 @@ Omnipresent (On all desktops) - + True False - + True False - + False False @@ -4024,18 +3851,18 @@ Omnipresent (On all desktops) - + True False 6 - + True False _Floating position: True dock_float_x - + False False @@ -4043,18 +3870,18 @@ Omnipresent (On all desktops) - + True True False False True True - 1 0 10000 1 10 0 + adjustment16 1 True - - + + False True @@ -4062,11 +3889,11 @@ Omnipresent (On all desktops) - + True False x - + False False @@ -4074,32 +3901,32 @@ Omnipresent (On all desktops) - + True True False False True True - 1 0 10000 1 10 0 + adjustment17 1 True - - + + False True 3 - + True True 1 - + False False @@ -4107,15 +3934,15 @@ Omnipresent (On all desktops) - + True False - + True False - + False False @@ -4123,7 +3950,7 @@ Omnipresent (On all desktops) - + Allow _windows to be placed within the dock's area True True @@ -4131,15 +3958,15 @@ Omnipresent (On all desktops) False True True - - + + False False 1 - + True True @@ -4147,19 +3974,19 @@ Omnipresent (On all desktops) - + True False 12 - + True False 0 _Orientation: True dock_direction - + False False @@ -4167,64 +3994,44 @@ Omnipresent (On all desktops) - + True True False - - - False - - - True - False - False - Vertical - True - - - - - - True - False - False - Horizontal - True - - - - - - + + Vertical + Horizontal + + + False False 1 - + True True 3 - + True True 1 - + False False 1 - + False False @@ -4232,18 +4039,18 @@ Omnipresent (On all desktops) - + True False 6 - + True False 0 <span weight="bold">Stacking</span> True - + False False @@ -4251,15 +4058,15 @@ Omnipresent (On all desktops) - + True False - + True False - + False False @@ -4267,12 +4074,12 @@ Omnipresent (On all desktops) - + True False 6 - + Keep dock _above other windows True True @@ -4280,8 +4087,8 @@ Omnipresent (On all desktops) False True True - - + + False False @@ -4289,7 +4096,7 @@ Omnipresent (On all desktops) - + A_llow dock to be both above and below windows True True @@ -4298,8 +4105,8 @@ Omnipresent (On all desktops) True True dock_stack_top - - + + False False @@ -4307,7 +4114,7 @@ Omnipresent (On all desktops) - + Keep dock _below other windows True True @@ -4316,29 +4123,29 @@ Omnipresent (On all desktops) True True dock_stack_top - - + + False False 2 - + False False 1 - + False False 1 - + False False @@ -4346,18 +4153,18 @@ Omnipresent (On all desktops) - + True False 6 - + True False 0 <span weight="bold">Hiding</span> True - + False False @@ -4365,15 +4172,15 @@ Omnipresent (On all desktops) - + True False - + True False - + False False @@ -4381,12 +4188,12 @@ Omnipresent (On all desktops) - + True False 6 - + _Hide off screen True True @@ -4394,8 +4201,8 @@ Omnipresent (On all desktops) False True True - - + + False False @@ -4403,15 +4210,15 @@ Omnipresent (On all desktops) - + True False - + True False - + False False @@ -4419,19 +4226,19 @@ Omnipresent (On all desktops) - + True False 6 - + True False 0 _Delay before hiding: True dock_hide_delay - + False False @@ -4439,18 +4246,18 @@ Omnipresent (On all desktops) - + True True False False True True - 300 0 10000 10 10 0 + adjustment18 1 True - - + + False True @@ -4458,25 +4265,25 @@ Omnipresent (On all desktops) - + True False ms - + False False 2 - + True True 1 - + True True @@ -4484,15 +4291,15 @@ Omnipresent (On all desktops) - + True False - + True False - + False False @@ -4500,19 +4307,19 @@ Omnipresent (On all desktops) - + True False 6 - + True False 0 Delay before _showing: True dock_show_delay - + False False @@ -4520,18 +4327,18 @@ Omnipresent (On all desktops) - + True True False False True True - 300 0 10000 10 10 0 + adjustment19 1 True - - + + False True @@ -4539,73 +4346,69 @@ Omnipresent (On all desktops) - + True False ms - + False False 2 - + True True 1 - + True True 2 - + True True 1 - + True True 1 - + False False 3 - - - 7 - + - - + + True False 0 6 8 Dock - + 7 False - tab - + True True @@ -4613,16 +4416,16 @@ Omnipresent (On all desktops) - + True False - + True False start - + Abo_ut True True @@ -4630,15 +4433,15 @@ Omnipresent (On all desktops) False False True - - + + False False 0 - + True True @@ -4646,12 +4449,12 @@ Omnipresent (On all desktops) - + True False end - + gtk-close True True @@ -4659,29 +4462,29 @@ Omnipresent (On all desktops) False False True - - + + False False 0 - + True True 1 - + False False 1 - + - - + + diff --git a/src/preview.c b/src/preview.c index 36fc94a..f52bb32 100644 --- a/src/preview.c +++ b/src/preview.c @@ -54,7 +54,7 @@ static GdkPixbuf* preview_menu(RrTheme *theme) RrAppearance *bullet; /* for submenu */ GdkPixmap *pixmap; - GdkPixbuf *pixbuf; + GdkPixbuf *pixbuf, *tmp_pixbuf; /* width and height of the whole menu */ gint width, height; @@ -104,6 +104,7 @@ static GdkPixbuf* preview_menu(RrTheme *theme) /* set border */ pixbuf = gdk_pixbuf_new(GDK_COLORSPACE_RGB, FALSE, 8, width, height); gdk_pixbuf_fill(pixbuf, rr_color_pixel(theme->menu_border_color)); + tmp_pixbuf = gdk_pixbuf_copy(pixbuf); /* menu appears after inside the border */ x = y = theme->mbwidth; @@ -126,9 +127,11 @@ static GdkPixbuf* preview_menu(RrTheme *theme) theme_pixmap_paint(title_text, bw, title_h); pixmap = gdk_pixmap_foreign_new(title_text->pixmap); - pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap, - gdk_colormap_get_system(), - 0, 0, x, y, bw, title_h); + tmp_pixbuf = gdk_pixbuf_get_from_drawable(tmp_pixbuf, pixmap, + gdk_colormap_get_system(), + 0, 0, 0, 0, + bw, title_h); + gdk_pixbuf_copy_area(tmp_pixbuf, 0, 0, bw, title_h, pixbuf, x, y); y += title_h + theme->mbwidth; @@ -141,9 +144,11 @@ static GdkPixbuf* preview_menu(RrTheme *theme) /* draw background for normal entry */ theme_pixmap_paint(background, bw, bh); pixmap = gdk_pixmap_foreign_new(background->pixmap); - pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap, - gdk_colormap_get_system(), - 0, 0, x, y, bw, bh); + tmp_pixbuf = gdk_pixbuf_get_from_drawable(tmp_pixbuf, pixmap, + gdk_colormap_get_system(), + 0, 0, 0, 0, + bw, bh); + gdk_pixbuf_copy_area(tmp_pixbuf, 0, 0, bw, bh, pixbuf, x, y); /* draw normal entry */ normal->surface.parent = background; @@ -152,10 +157,12 @@ static GdkPixbuf* preview_menu(RrTheme *theme) RrMinSize(normal, &tw, &th); theme_pixmap_paint(normal, tw, th); pixmap = gdk_pixmap_foreign_new(normal->pixmap); - pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap, - gdk_colormap_get_system(), - 0, 0, x + PADDING, y + PADDING, - tw, th); + tmp_pixbuf = gdk_pixbuf_get_from_drawable(tmp_pixbuf, pixmap, + gdk_colormap_get_system(), + 0, 0, 0, 0, + tw, th); + gdk_pixbuf_copy_area(tmp_pixbuf, 0, 0, tw, th, pixbuf, + x + PADDING, y + PADDING); /* draw bullet */ RrMinSize(normal, &tw, &th); @@ -164,12 +171,12 @@ static GdkPixbuf* preview_menu(RrTheme *theme) bullet->surface.parenty = PADDING; theme_pixmap_paint(bullet, th, th); pixmap = gdk_pixmap_foreign_new(bullet->pixmap); - pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap, - gdk_colormap_get_system(), - 0, 0, - width - theme->mbwidth - th, - y + PADDING, - th, th); + tmp_pixbuf = gdk_pixbuf_get_from_drawable(tmp_pixbuf, pixmap, + gdk_colormap_get_system(), + 0, 0, 0, 0, + th, th); + gdk_pixbuf_copy_area(tmp_pixbuf, 0, 0, th, th, pixbuf, + width - theme->mbwidth - th, y + PADDING); y += th + 2*PADDING; @@ -179,10 +186,11 @@ static GdkPixbuf* preview_menu(RrTheme *theme) background->surface.parenty = y - theme->mbwidth; theme_pixmap_paint(background, bw, bh); pixmap = gdk_pixmap_foreign_new(background->pixmap); - pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap, - gdk_colormap_get_system(), - 0, 0, x, y, - bw, bh); + tmp_pixbuf = gdk_pixbuf_get_from_drawable(tmp_pixbuf, pixmap, + gdk_colormap_get_system(), + 0, 0, 0, 0, + bw, bh); + gdk_pixbuf_copy_area(tmp_pixbuf, 0, 0, bw, bh, pixbuf, x, y); /* draw disabled entry */ RrMinSize(disabled, &tw, &th); @@ -191,10 +199,12 @@ static GdkPixbuf* preview_menu(RrTheme *theme) disabled->surface.parenty = PADDING; theme_pixmap_paint(disabled, tw, th); pixmap = gdk_pixmap_foreign_new(disabled->pixmap); - pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap, - gdk_colormap_get_system(), - 0, 0, x + PADDING, y + PADDING, - tw, th); + tmp_pixbuf = gdk_pixbuf_get_from_drawable(tmp_pixbuf, pixmap, + gdk_colormap_get_system(), + 0, 0, 0, 0, + tw, th); + gdk_pixbuf_copy_area(tmp_pixbuf, 0, 0, tw, th, pixbuf, + x + PADDING, y + PADDING); y += th + 2*PADDING; @@ -206,10 +216,11 @@ static GdkPixbuf* preview_menu(RrTheme *theme) theme_pixmap_paint(background, bw, bh); pixmap = gdk_pixmap_foreign_new(background->pixmap); - pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap, - gdk_colormap_get_system(), - 0, 0, x, y, - bw, bh); + tmp_pixbuf = gdk_pixbuf_get_from_drawable(tmp_pixbuf, pixmap, + gdk_colormap_get_system(), + 0, 0, 0, 0, + bw, bh); + gdk_pixbuf_copy_area(tmp_pixbuf, 0, 0, bw, bh, pixbuf, x, y); /* draw selected entry */ RrMinSize(selected, &tw, &th); @@ -218,10 +229,13 @@ static GdkPixbuf* preview_menu(RrTheme *theme) selected->surface.parenty = PADDING; theme_pixmap_paint(selected, tw, th); pixmap = gdk_pixmap_foreign_new(selected->pixmap); - pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap, - gdk_colormap_get_system(), - 0, 0, x + PADDING, y + PADDING, - tw, th); + tmp_pixbuf = gdk_pixbuf_get_from_drawable(tmp_pixbuf, pixmap, + gdk_colormap_get_system(), + 0, 0, 0, 0, + tw, th); + gdk_pixbuf_copy_area(tmp_pixbuf, 0, 0, tw, th, pixbuf, + x + PADDING, y + PADDING); + g_object_unref(tmp_pixbuf); return pixbuf; } @@ -234,7 +248,7 @@ static GdkPixbuf* preview_window(RrTheme *theme, const gchar *titlelayout, RrAppearance *a; GdkPixmap *pixmap; - GdkPixbuf *pixbuf = NULL; + GdkPixbuf *pixbuf = NULL, *tmp_pixbuf = NULL; GdkPixbuf *scratch; gint w, label_w, h, x, y; @@ -249,6 +263,7 @@ static GdkPixbuf* preview_window(RrTheme *theme, const gchar *titlelayout, rr_color_pixel(focus ? theme->frame_focused_border_color : theme->frame_unfocused_border_color)); + tmp_pixbuf = gdk_pixbuf_copy(pixbuf); /* title */ w = width - 2*theme->fbwidth; @@ -257,9 +272,10 @@ static GdkPixbuf* preview_window(RrTheme *theme, const gchar *titlelayout, x = y = theme->fbwidth; pixmap = gdk_pixmap_foreign_new(title->pixmap); - pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap, - gdk_colormap_get_system(), - 0, 0, x, y, w, h); + tmp_pixbuf = gdk_pixbuf_get_from_drawable(tmp_pixbuf, pixmap, + gdk_colormap_get_system(), + 0, 0, 0, 0, w, h); + gdk_pixbuf_copy_area(tmp_pixbuf, 0, 0, w, h, pixbuf, x, y); /* calculate label width */ label_w = width - (theme->paddingx + theme->fbwidth + 1) * 2; @@ -302,9 +318,10 @@ static GdkPixbuf* preview_window(RrTheme *theme, const gchar *titlelayout, theme_pixmap_paint(a, w, h); pixmap = gdk_pixmap_foreign_new(a->pixmap); - pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap, - gdk_colormap_get_system(), - 0, 0, x, y, w, h); + tmp_pixbuf = gdk_pixbuf_get_from_drawable(tmp_pixbuf, pixmap, + gdk_colormap_get_system(), + 0, 0, 0, 0, w, h); + gdk_pixbuf_copy_area(tmp_pixbuf, 0, 0, w, h, pixbuf, x, y); x += theme->button_size + 2 + theme->paddingx + 1; } else if (*layout == 'L') { /* label */ @@ -319,9 +336,10 @@ static GdkPixbuf* preview_window(RrTheme *theme, const gchar *titlelayout, theme_pixmap_paint(a, w, h); pixmap = gdk_pixmap_foreign_new(a->pixmap); - pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap, - gdk_colormap_get_system(), - 0, 0, x, y, w, h); + tmp_pixbuf = gdk_pixbuf_get_from_drawable(tmp_pixbuf, pixmap, + gdk_colormap_get_system(), + 0, 0, 0, 0, w, h); + gdk_pixbuf_copy_area(tmp_pixbuf, 0, 0, w, h, pixbuf, x, y); x += w + theme->paddingx + 1; } else { @@ -367,9 +385,10 @@ static GdkPixbuf* preview_window(RrTheme *theme, const gchar *titlelayout, pixmap = gdk_pixmap_foreign_new(a->pixmap); /* use y + 1 because these buttons should be centered wrt the label */ - pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap, - gdk_colormap_get_system(), - 0, 0, x, y + 1, w, h); + tmp_pixbuf = gdk_pixbuf_get_from_drawable(tmp_pixbuf, pixmap, + gdk_colormap_get_system(), + 0, 0, 0, 0, w, h); + gdk_pixbuf_copy_area(tmp_pixbuf, 0, 0, w, h, pixbuf, x, y + 1); x += theme->button_size + theme->paddingx + 1; } @@ -385,9 +404,10 @@ static GdkPixbuf* preview_window(RrTheme *theme, const gchar *titlelayout, theme_pixmap_paint(handle, w, h); pixmap = gdk_pixmap_foreign_new(handle->pixmap); - pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap, - gdk_colormap_get_system(), - 0, 0, x, y, w, h); + tmp_pixbuf = gdk_pixbuf_get_from_drawable(tmp_pixbuf, pixmap, + gdk_colormap_get_system(), + 0, 0, 0, 0, w, h); + gdk_pixbuf_copy_area(tmp_pixbuf, 0, 0, w, h, pixbuf, x, y); /* openbox handles this drawing stuff differently (it fills the bottom * of the window with the handle), so it avoids this bug where @@ -406,15 +426,17 @@ static GdkPixbuf* preview_window(RrTheme *theme, const gchar *titlelayout, theme_pixmap_paint(a, w, h); pixmap = gdk_pixmap_foreign_new(a->pixmap); - pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap, - gdk_colormap_get_system(), - 0, 0, x, y, w, h); + tmp_pixbuf = gdk_pixbuf_get_from_drawable(tmp_pixbuf, pixmap, + gdk_colormap_get_system(), + 0, 0, 0, 0, w, h); + gdk_pixbuf_copy_area(tmp_pixbuf, 0, 0, w, h, pixbuf, x, y); /* right grip */ x = width - theme->fbwidth - theme->grip_width; - pixbuf = gdk_pixbuf_get_from_drawable(pixbuf, pixmap, - gdk_colormap_get_system(), - 0, 0, x, y, w, h); + tmp_pixbuf = gdk_pixbuf_get_from_drawable(tmp_pixbuf, pixmap, + gdk_colormap_get_system(), + 0, 0, 0, 0, w, h); + gdk_pixbuf_copy_area(tmp_pixbuf, 0, 0, w, h, pixbuf, x, y); } /* title separator colour */ @@ -452,6 +474,7 @@ static GdkPixbuf* preview_window(RrTheme *theme, const gchar *titlelayout, pixbuf, x + theme->cbwidthx, y + theme->cbwidthy); + g_object_unref(scratch); return pixbuf; } @@ -531,13 +554,16 @@ GdkPixbuf *preview_theme(const gchar *name, const gchar *titlelayout, window = preview_window(theme, titlelayout, FALSE, window_w, h); gdk_pixbuf_copy_area(window, 0, 0, window_w, h, preview, 20, 0); + g_object_unref(window); window = preview_window(theme, titlelayout, TRUE, window_w, h); gdk_pixbuf_copy_area(window, 0, 0, window_w, h, preview, 10, theme->title_height + 5); + g_object_unref(window); gdk_pixbuf_copy_area(menu, 0, 0, menu_w, h, preview, 0, 2 * (theme->title_height + 5)); + g_object_unref(menu); RrThemeFree(theme); diff --git a/src/preview_update.c b/src/preview_update.c index 638f364..965431e 100644 --- a/src/preview_update.c +++ b/src/preview_update.c @@ -136,8 +136,10 @@ static gboolean update_theme_preview_iterate(gpointer data) inactive_window_font, menu_title_font, menu_item_font, osd_active_font, osd_inactive_font); - if (preview) + if (preview) { gtk_list_store_set(GTK_LIST_STORE(ls), &iter, 1, preview, -1); + g_object_unref(preview); + } return TRUE; } diff --git a/src/tree.c b/src/tree.c index cbe9b90..4ad4a38 100644 --- a/src/tree.c +++ b/src/tree.c @@ -114,7 +114,7 @@ void tree_apply() ce.xclient.type = ClientMessage; ce.xclient.message_type = gdk_x11_get_xatom_by_name("_OB_CONTROL"); - ce.xclient.display = GDK_DISPLAY(); + ce.xclient.display = gdk_x11_get_default_xdisplay(); ce.xclient.window = GDK_ROOT_WINDOW(); ce.xclient.format = 32; ce.xclient.data.l[0] = 1; /* reconfigure */ @@ -122,7 +122,7 @@ void tree_apply() ce.xclient.data.l[2] = 0; ce.xclient.data.l[3] = 0; ce.xclient.data.l[4] = 0; - XSendEvent(GDK_DISPLAY(), GDK_ROOT_WINDOW(), FALSE, + XSendEvent(gdk_x11_get_default_xdisplay(), GDK_ROOT_WINDOW(), FALSE, SubstructureNotifyMask | SubstructureRedirectMask, &ce); } diff --git a/src/windows.c b/src/windows.c index 146a99d..ed289b7 100644 --- a/src/windows.c +++ b/src/windows.c @@ -50,23 +50,23 @@ void windows_setup_tab() w = get_widget("place_active_popup"); s = tree_get_string("placement/monitor", "Any"); if (!g_ascii_strcasecmp(s, "Active")) - gtk_option_menu_set_history(GTK_OPTION_MENU(w), PLACE_ON_ACTIVE); + gtk_combo_box_set_active(GTK_COMBO_BOX(w), PLACE_ON_ACTIVE); else if (!g_ascii_strcasecmp(s, "Mouse")) - gtk_option_menu_set_history(GTK_OPTION_MENU(w), PLACE_ON_MOUSE); + gtk_combo_box_set_active(GTK_COMBO_BOX(w), PLACE_ON_MOUSE); else if (!g_ascii_strcasecmp(s, "Primary")) - gtk_option_menu_set_history(GTK_OPTION_MENU(w), PLACE_ON_PRIMARY); + gtk_combo_box_set_active(GTK_COMBO_BOX(w), PLACE_ON_PRIMARY); else - gtk_option_menu_set_history(GTK_OPTION_MENU(w), PLACE_ON_ALL); + gtk_combo_box_set_active(GTK_COMBO_BOX(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); + gtk_combo_box_set_active(GTK_COMBO_BOX(w), PLACE_ON_ACTIVE); else if (!g_ascii_strcasecmp(s, "Mouse")) - gtk_option_menu_set_history(GTK_OPTION_MENU(w), PLACE_ON_MOUSE); + gtk_combo_box_set_active(GTK_COMBO_BOX(w), PLACE_ON_MOUSE); else { - gtk_option_menu_set_history(GTK_OPTION_MENU(w), PLACE_ON_FIXED); + gtk_combo_box_set_active(GTK_COMBO_BOX(w), PLACE_ON_FIXED); w = get_widget("fixed_monitor"); gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), @@ -88,36 +88,30 @@ static void enable_stuff() b = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)); w = get_widget("primary_monitor_popup"); - b = gtk_option_menu_get_history(GTK_OPTION_MENU(w)) == PLACE_ON_FIXED; + b = gtk_combo_box_get_active(GTK_COMBO_BOX(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) +void on_primary_monitor_changed(GtkComboBox *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))); + switch (gtk_combo_box_get_active(w)) { + case 0: + { + GtkWidget *w2 = get_widget("fixed_monitor"); + tree_set_int("placement/primaryMonitor", + gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(w2))); + break; + } + break; + case 1: + tree_set_string("placement/primaryMonitor", "Active"); + break; + case 2: + tree_set_string("placement/primaryMonitor", "Mouse"); + } enable_stuff(); } @@ -146,30 +140,22 @@ void on_place_mouse_toggled(GtkToggleButton *w, gpointer data) enable_stuff(); } -void on_place_active_popup_all_activate(GtkMenuItem *w, gpointer data) +void on_place_active_popup_changed(GtkComboBox *w, gpointer data) { if (mapping) return; - tree_set_string("placement/monitor", "Any"); -} - -void on_place_active_popup_active_activate(GtkMenuItem *w, gpointer data) -{ - if (mapping) return; - - tree_set_string("placement/monitor", "Active"); -} - -void on_place_active_popup_mouse_activate(GtkMenuItem *w, gpointer data) -{ - if (mapping) return; - - tree_set_string("placement/monitor", "Mouse"); -} - -void on_place_active_popup_primary_activate(GtkMenuItem *w, gpointer data) -{ - if (mapping) return; - - tree_set_string("placement/monitor", "Primary"); + switch (gtk_combo_box_get_active(w)) { + case 0: + tree_set_string("placement/monitor", "Primary"); + break; + case 1: + tree_set_string("placement/monitor", "Active"); + break; + case 2: + tree_set_string("placement/monitor", "Mouse"); + break; + case 3: + tree_set_string("placement/monitor", "Any"); + break; + } } -- 1.9.1