From f327226643da300ecaa975c200d8d80a5449d1ad Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Mon, 8 Dec 2014 20:47:52 +0100 Subject: [PATCH 01/34] check for optional gtk3 support --- configure.ac.in | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configure.ac.in b/configure.ac.in index baef103..7e732ac 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -75,6 +75,10 @@ XDT_CHECK_OPTIONAL_PACKAGE([WNCK], [libwnck-1.0], [2.0], [wnck], [building with AM_CONDITIONAL([HAVE_WNCK], [test x"$WNCK_FOUND" = x"yes"]) XDT_CHECK_OPTIONAL_PACKAGE([GKSU], [libgksu2], [2.0], [gksu], [building with libgksu to run as root], [yes]) AM_CONDITIONAL([HAVE_GKSU], [test x"$GKSU_FOUND" = x"yes"]) +XDT_CHECK_OPTIONAL_PACKAGE([GTK3], + [gtk+-3.0], [3.2.0], [gtk3], + [GTK+ 3 support], [no]) +AM_CONDITIONAL([USE_GTK3], [test "x$GTK3_FOUND" = "xyes"]) dnl *********************************** dnl ********** Check for skel ********* @@ -151,7 +155,11 @@ echo echo "* Gksu: ${GKSU_VERSION:-no}" echo "* Wnck: ${WNCK_VERSION:-no}" echo "* Cairo: ${CAIRO_VERSION}" +if test "x$GTK3_FOUND" = "xyes" ; then +echo "* GTK+: ${GTK3_VERSION}" +else echo "* GTK+: ${GTK_VERSION}" +fi echo "* Target OS: $target_os ($ac_os_implementation)" echo "* Debug: $enable_debug" echo From 15863295cb1b2082418d1345aa1e7e240f1f6bb6 Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Mon, 8 Dec 2014 22:36:25 +0100 Subject: [PATCH 02/34] also check for libwnck3, will have to be dependent on gtk3 anyway --- configure.ac.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configure.ac.in b/configure.ac.in index 7e732ac..b8e548d 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -79,6 +79,8 @@ XDT_CHECK_OPTIONAL_PACKAGE([GTK3], [gtk+-3.0], [3.2.0], [gtk3], [GTK+ 3 support], [no]) AM_CONDITIONAL([USE_GTK3], [test "x$GTK3_FOUND" = "xyes"]) +XDT_CHECK_OPTIONAL_PACKAGE([WNCK3], [libwnck-3.0], [3.2], [wnck3], [building with libwnck3 for window icons/names], [no]) +AM_CONDITIONAL([USE_WNCK3], [test x"$WNCK3_FOUND" = x"yes"]) dnl *********************************** dnl ********** Check for skel ********* @@ -153,7 +155,11 @@ echo echo "Build Configuration:" echo echo "* Gksu: ${GKSU_VERSION:-no}" +if test "x$WNCK3_FOUND" = "xyes" ; then +echo "* Wnck: ${WNCK3_VERSION:-no}" +else echo "* Wnck: ${WNCK_VERSION:-no}" +fi echo "* Cairo: ${CAIRO_VERSION}" if test "x$GTK3_FOUND" = "xyes" ; then echo "* GTK+: ${GTK3_VERSION}" From e91f9040d1c4aa116c74b5a75fea52b951ac357b Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Mon, 8 Dec 2014 22:37:00 +0100 Subject: [PATCH 03/34] set GTK2/GTK3/WNCK/WNCK3 LIBS/CFLAGS depending on USE_GTK3 --- src/Makefile.am | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 952b8e5..7b457ce 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -9,16 +9,12 @@ bin_PROGRAMS = \ xfce4-taskmanager xfce4_taskmanager_CFLAGS = \ - $(GTK_CFLAGS) \ $(CAIRO_CFLAGS) \ - $(WNCK_CFLAGS) \ $(GKSU_CFLAGS) \ $(NULL) xfce4_taskmanager_LDADD = \ - $(GTK_LIBS) \ $(CAIRO_LIBS) \ - $(WNCK_LIBS) \ $(GKSU_LIBS) \ $(NULL) @@ -38,6 +34,14 @@ xfce4_taskmanager_SOURCES = \ task-manager.c task-manager.h \ $(NULL) +if USE_GTK3 +xfce4_taskmanager_LDADD += $(GTK3_LIBS) $(WNCK3_LIBS) +xfce4_taskmanager_CFLAGS += $(GTK3_CFLAGS) $(WNCK3_CFLAGS) +else +xfce4_taskmanager_LDADD += $(GTK_LIBS) $(WNCK_LIBS) +xfce4_taskmanager_CFLAGS += $(GTK_CFLAGS) $(WNCK_CFLAGS) +endif + if HAVE_WNCK xfce4_taskmanager_SOURCES += app-manager.c app-manager.h endif From 28c6cea9729fa07dcfc1a234671b64070f2ae32f Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Mon, 8 Dec 2014 22:37:29 +0100 Subject: [PATCH 04/34] use gtk_widget_is_visible instead of GTK_WIDGET_VISIBLE() --- src/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.c b/src/main.c index 10fbe9b..48dfa76 100644 --- a/src/main.c +++ b/src/main.c @@ -31,7 +31,11 @@ static gboolean timeout = 0; static void status_icon_activated (void) { +#ifdef HAVE_GTK3 + if (!(gtk_widget_is_visible (window))) +#else if (!(GTK_WIDGET_VISIBLE (window))) +#endif gtk_widget_show (window); else gtk_widget_hide (window); From 2cf4aef9f7ae7d6ea3b156e547a45ddef0882f2d Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Mon, 8 Dec 2014 22:38:20 +0100 Subject: [PATCH 05/34] include gdk/gdkkeysyms-compat.h to get GDK_Menu #define --- src/process-tree-view.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/process-tree-view.c b/src/process-tree-view.c index f7fc68e..e6f6ffd 100644 --- a/src/process-tree-view.c +++ b/src/process-tree-view.c @@ -15,7 +15,9 @@ #include #include #include - +#ifdef HAVE_GTK3 +#include +#endif #include "process-tree-model.h" #include "process-tree-view.h" #include "task-manager.h" From dab45b288a3c3f022c364c38b4a049d3dde0c54e Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Mon, 8 Dec 2014 22:38:41 +0100 Subject: [PATCH 06/34] GTK_WIDGET_SET_FLAGS seems to be gtk2 only --- src/process-window.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/process-window.c b/src/process-window.c index 98c74d1..f349329 100644 --- a/src/process-window.c +++ b/src/process-window.c @@ -383,7 +383,9 @@ xtm_process_window_show (GtkWidget *widget) g_return_if_fail (GTK_IS_WIDGET (XTM_PROCESS_WINDOW (widget)->window)); gtk_widget_show (XTM_PROCESS_WINDOW (widget)->window); gtk_window_present (GTK_WINDOW (XTM_PROCESS_WINDOW (widget)->window)); +#ifndef HAVE_GTK3 GTK_WIDGET_SET_FLAGS (widget, GTK_VISIBLE); +#endif } static void @@ -396,7 +398,9 @@ xtm_process_window_hide (GtkWidget *widget) gtk_window_get_position (GTK_WINDOW (XTM_PROCESS_WINDOW (widget)->window), &winx, &winy); gtk_widget_hide (XTM_PROCESS_WINDOW (widget)->window); gtk_window_move (GTK_WINDOW (XTM_PROCESS_WINDOW (widget)->window), winx, winy); +#ifndef HAVE_GTK3 GTK_WIDGET_UNSET_FLAGS (widget, GTK_VISIBLE); +#endif } GtkTreeModel * From af176e4f878f730d19a511ae886524b71e827778 Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Mon, 8 Dec 2014 22:39:09 +0100 Subject: [PATCH 07/34] gdk_spawn_command_line_on_screen() was removed, try to use g_app_info_launch() --- src/exec-tool-button.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/exec-tool-button.c b/src/exec-tool-button.c index fbb4d16..1ef6dfb 100644 --- a/src/exec-tool-button.c +++ b/src/exec-tool-button.c @@ -79,8 +79,24 @@ static void execute_command (const gchar *command) { GError *error = NULL; - +#ifdef HAVE_GTK3 + GdkScreen *screen; + GdkDisplay *display; + GdkAppLaunchContext *launch_context; + GAppInfo *app_info; + app_info = g_app_info_create_from_commandline (command, NULL, G_APP_INFO_CREATE_NONE, &error); + if (!error) { + display = gdk_screen_get_display (screen); + launch_context = gdk_display_get_app_launch_context (display); + gdk_app_launch_context_set_screen (launch_context, screen); + g_app_info_launch (app_info, NULL, G_APP_LAUNCH_CONTEXT + (launch_context), &error); + g_object_unref (launch_context); + } + g_object_unref (app_info); +#else gdk_spawn_command_line_on_screen (gdk_screen_get_default (), command, &error); +#endif if (error != NULL) { GtkWidget *dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, From 008bfd62a6cecd8a72884582b95a8719b73270cf Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Mon, 8 Dec 2014 22:46:47 +0100 Subject: [PATCH 08/34] GtkComboBoxText appeared in gtk 2.24.1, use it if available --- src/settings-dialog.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/settings-dialog.c b/src/settings-dialog.c index 800881d..213c014 100644 --- a/src/settings-dialog.c +++ b/src/settings-dialog.c @@ -119,13 +119,21 @@ xtm_settings_dialog_init (XtmSettingsDialog *dialog) XtmToolbarStyle toolbar_style; box = GTK_WIDGET (gtk_builder_get_object (builder, "hbox-toolbar-style")); +#if HAVE_GTK3 || GTK_CHECK_VERSION(2, 24, 1) + combobox = gtk_combo_box_text_new (); +#else combobox = gtk_combo_box_new_text (); +#endif gtk_box_pack_start (GTK_BOX (box), combobox, FALSE, FALSE, 0); gtk_widget_show (combobox); klass = g_type_class_ref (XTM_TYPE_TOOLBAR_STYLE); for (n = 0; n < klass->n_values; ++n) +#if HAVE_GTK3 || GTK_CHECK_VERSION(2, 24, 1) + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox), _(klass->values[n].value_nick)); +#else gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _(klass->values[n].value_nick)); +#endif g_type_class_unref (klass); g_object_get (dialog->settings, "toolbar-style", &toolbar_style, NULL); From 55591b17ca570d3fe87f34f797533b28150736a7 Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Mon, 8 Dec 2014 22:47:27 +0100 Subject: [PATCH 09/34] GTK_WIDGET_SET_FLAGS seems to be gtk2 only --- src/settings-dialog.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/settings-dialog.c b/src/settings-dialog.c index 213c014..cd1ca76 100644 --- a/src/settings-dialog.c +++ b/src/settings-dialog.c @@ -170,7 +170,9 @@ xtm_settings_dialog_show (GtkWidget *widget) g_return_if_fail (GTK_IS_WIDGET (XTM_SETTINGS_DIALOG (widget)->window)); gtk_widget_show (XTM_SETTINGS_DIALOG (widget)->window); gtk_window_present (GTK_WINDOW (XTM_SETTINGS_DIALOG (widget)->window)); +#ifndef HAVE_GTK3 GTK_WIDGET_SET_FLAGS (widget, GTK_VISIBLE); +#endif } static void @@ -183,7 +185,9 @@ xtm_settings_dialog_hide (GtkWidget *widget) gtk_window_get_position (GTK_WINDOW (XTM_SETTINGS_DIALOG (widget)->window), &winx, &winy); gtk_widget_hide (XTM_SETTINGS_DIALOG (widget)->window); gtk_window_move (GTK_WINDOW (XTM_SETTINGS_DIALOG (widget)->window), winx, winy); +#ifndef HAVE_GTK3 GTK_WIDGET_UNSET_FLAGS (widget, GTK_VISIBLE); +#endif } void From f76b9973bd8a219fb0bfc4bc80e8c720b731a1a9 Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Mon, 8 Dec 2014 22:47:41 +0100 Subject: [PATCH 10/34] Use gtk_check_menu_item_get_active() instead of poking directly at the active member --- src/settings-tool-button.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/settings-tool-button.c b/src/settings-tool-button.c index 468185f..9bdfd6e 100644 --- a/src/settings-tool-button.c +++ b/src/settings-tool-button.c @@ -73,7 +73,7 @@ show_settings_dialog (XtmSettingsToolButton *button) static void refresh_rate_toggled (GtkCheckMenuItem *mi, XtmSettings *settings) { - if(mi->active) + if(gtk_check_menu_item_get_active(mi)) { guint refresh_rate = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (mi), "refresh-rate")); g_object_set (settings, "refresh-rate", refresh_rate, NULL); From 41a9d833f0faac3869fef231072709097dcaa0fc Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Mon, 8 Dec 2014 22:53:59 +0100 Subject: [PATCH 11/34] Use gtk_widget_get_window() (appeared in Gtk 2.14) instead of poking at window struct member --- src/process-monitor.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/process-monitor.c b/src/process-monitor.c index 5ad24e2..904c758 100644 --- a/src/process-monitor.c +++ b/src/process-monitor.c @@ -308,8 +308,8 @@ xtm_process_monitor_add_peak (XtmProcessMonitor *monitor, gfloat peak) if (monitor->history->len > 1) g_array_remove_index (monitor->history, monitor->history->len - 1); - if (GDK_IS_WINDOW (GTK_WIDGET (monitor)->window)) - gdk_window_invalidate_rect (GTK_WIDGET (monitor)->window, NULL, FALSE); + if (GDK_IS_WINDOW (gtk_widget_get_window (GTK_WIDGET(monitor)))) + gdk_window_invalidate_rect (gtk_widget_get_window (GTK_WIDGET(monitor)), NULL, FALSE); } void @@ -317,8 +317,8 @@ xtm_process_monitor_set_step_size (XtmProcessMonitor *monitor, gfloat step_size) { g_return_if_fail (XTM_IS_PROCESS_MONITOR (monitor)); g_object_set (monitor, "step_size", step_size, NULL); - if (GDK_IS_WINDOW (GTK_WIDGET (monitor)->window)) - gdk_window_invalidate_rect (GTK_WIDGET (monitor)->window, NULL, FALSE); + if (GDK_IS_WINDOW (gtk_widget_get_window (GTK_WIDGET(monitor)))) + gdk_window_invalidate_rect (gtk_widget_get_window (GTK_WIDGET(monitor)), NULL, FALSE); } void @@ -326,8 +326,8 @@ xtm_process_monitor_clear (XtmProcessMonitor *monitor) { g_return_if_fail (XTM_IS_PROCESS_MONITOR (monitor)); g_array_set_size (monitor->history, 0); - if (GDK_IS_WINDOW (GTK_WIDGET (monitor)->window)) - gdk_window_invalidate_rect (GTK_WIDGET (monitor)->window, NULL, FALSE); + if (GDK_IS_WINDOW (gtk_widget_get_window (GTK_WIDGET(monitor)))) + gdk_window_invalidate_rect (gtk_widget_get_window (GTK_WIDGET(monitor)), NULL, FALSE); } void @@ -336,8 +336,8 @@ xtm_process_monitor_set_source_color (XtmProcessMonitor *monitor, gdouble red, g g_return_if_fail (XTM_IS_PROCESS_MONITOR (monitor)); g_signal_handlers_disconnect_by_func (GTK_WIDGET (monitor), init_source_color, NULL); g_object_set (monitor, "color-red", red, "color-green", green, "color-blue", blue, NULL); - if (GDK_IS_WINDOW (GTK_WIDGET (monitor)->window)) - gdk_window_invalidate_rect (GTK_WIDGET (monitor)->window, NULL, FALSE); + if (GDK_IS_WINDOW (gtk_widget_get_window (GTK_WIDGET(monitor)))) + gdk_window_invalidate_rect (gtk_widget_get_window (GTK_WIDGET(monitor)), NULL, FALSE); } void @@ -345,6 +345,6 @@ xtm_process_monitor_set_paint_box (XtmProcessMonitor *monitor, gboolean paint_bo { g_return_if_fail (XTM_IS_PROCESS_MONITOR (monitor)); g_object_set (monitor, "paint-box", paint_box, NULL); - if (GDK_IS_WINDOW (GTK_WIDGET (monitor)->window)) - gdk_window_invalidate_rect (GTK_WIDGET (monitor)->window, NULL, FALSE); + if (GDK_IS_WINDOW (gtk_widget_get_window (GTK_WIDGET(monitor)))) + gdk_window_invalidate_rect (gtk_widget_get_window (GTK_WIDGET(monitor)), NULL, FALSE); } From fc67cde22a8f9c083cd61e3a20bc88e601ca9c85 Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Mon, 8 Dec 2014 22:55:01 +0100 Subject: [PATCH 12/34] Depend on Gtk 2.14, released ages ago... --- configure.ac.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac.in b/configure.ac.in index b8e548d..d259d01 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -65,7 +65,7 @@ XDT_I18N([@LINGUAS@]) dnl *********************************** dnl *** Check for required packages *** dnl *********************************** -XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.12.0]) +XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.14.0]) XDT_CHECK_PACKAGE([CAIRO], [cairo], [1.5.0]) dnl *********************************** From 78330dbc19ff0ebfb3512b7cce804f576adff72b Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Mon, 8 Dec 2014 22:55:43 +0100 Subject: [PATCH 13/34] expose-event was replaced by draw, assign the same callback for now (probably wrong) --- src/process-monitor.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/process-monitor.c b/src/process-monitor.c index 904c758..921992b 100644 --- a/src/process-monitor.c +++ b/src/process-monitor.c @@ -59,7 +59,11 @@ xtm_process_monitor_class_init (XtmProcessMonitorClass *klass) xtm_process_monitor_parent_class = g_type_class_peek_parent (klass); class->get_property = xtm_process_monitor_get_property; class->set_property = xtm_process_monitor_set_property; +#if HAVE_GTK3 + widget_class->draw = xtm_process_monitor_expose; +#else widget_class->expose_event = xtm_process_monitor_expose; +#endif g_object_class_install_property (class, PROP_STEP_SIZE, g_param_spec_float ("step-size", "StepSize", "Step size", 0.1, G_MAXFLOAT, 1, G_PARAM_CONSTRUCT|G_PARAM_READWRITE)); g_object_class_install_property (class, PROP_COLOR_RED, From eaa3886a5d9d41e80b8fba7719372c61909dc5f4 Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Mon, 8 Dec 2014 22:56:39 +0100 Subject: [PATCH 14/34] [wip] directly pass a hardcoded red GdkColor where gtk2 code pokes at GtkStyle internals --- src/process-monitor.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/process-monitor.c b/src/process-monitor.c index 921992b..0b7cc6d 100644 --- a/src/process-monitor.c +++ b/src/process-monitor.c @@ -79,10 +79,15 @@ xtm_process_monitor_class_init (XtmProcessMonitorClass *klass) static void init_source_color (GtkWidget *widget, GtkStyle *prev_style, gpointer user_data) { +#ifdef HAVE_GTK3 + GdkColor *color; + gdk_color_parse("red", color); +#else GdkColor *color = &widget->style->base[GTK_STATE_SELECTED]; XTM_PROCESS_MONITOR (widget)->color_red = color->red / 65535.0; XTM_PROCESS_MONITOR (widget)->color_green = color->green / 65535.0; XTM_PROCESS_MONITOR (widget)->color_blue = color->blue / 65535.0; +#endif } static void @@ -276,7 +281,13 @@ xtm_process_monitor_paint (XtmProcessMonitor *monitor) } cairo_stroke (cr); +#ifdef HAVE_GTK3 + GdkColor *color; + gdk_color_parse("red", color); + gdk_cairo_set_source_color (cr, color); +#else gdk_cairo_set_source_color (cr, >K_WIDGET (monitor)->style->fg[GTK_STATE_NORMAL]); +#endif cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE); cairo_set_line_width (cr, 1.0); for (i = 25; i <= 75; i += 25) From 3b11350b6a771529283b2f65220232c81bcaf6bc Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Mon, 8 Dec 2014 22:57:15 +0100 Subject: [PATCH 15/34] [wip] gets taskmanager to build with Gtk3 - use gtk_widget_get_allocated_width/gtk_widget_get_allocated_height instead of poking at GtkAllocation internals - use gtk_widget_get_window() instead of poking at window struct member - correct args for gtk_paint_box/gtk_paint_shadow, probably wrong too but builds for now --- src/process-monitor.c | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/src/process-monitor.c b/src/process-monitor.c index 0b7cc6d..82cc3e6 100644 --- a/src/process-monitor.c +++ b/src/process-monitor.c @@ -167,7 +167,11 @@ xtm_process_monitor_expose (GtkWidget *widget, GdkEventExpose *event) XtmProcessMonitor *monitor = XTM_PROCESS_MONITOR (widget); guint minimum_history_length; +#ifdef HAVE_GTK3 + minimum_history_length = gtk_widget_get_allocated_width(widget) / monitor->step_size; +#else minimum_history_length = widget->allocation.width / monitor->step_size; +#endif if (monitor->history->len < minimum_history_length) g_array_set_size (monitor->history, minimum_history_length + 1); @@ -192,8 +196,13 @@ xtm_process_monitor_graph_surface_create (XtmProcessMonitor *monitor) return NULL; } +#ifdef HAVE_GTK3 + width = gtk_widget_get_allocated_width(GTK_WIDGET(monitor)); + height = gtk_widget_get_allocated_height(GTK_WIDGET(monitor)); +#else width = GTK_WIDGET (monitor)->allocation.width; height = GTK_WIDGET (monitor)->allocation.height; +#endif step_size = monitor->step_size; graph_surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height); @@ -250,16 +259,24 @@ xtm_process_monitor_paint (XtmProcessMonitor *monitor) cairo_surface_t *graph_surface; gint width, height; gint i; - - cr = gdk_cairo_create (GTK_WIDGET (monitor)->window); + cr = gdk_cairo_create (gtk_widget_get_window(GTK_WIDGET(monitor))); +#ifdef HAVE_GTK3 + width = gtk_widget_get_allocated_width(GTK_WIDGET(monitor)); + height = gtk_widget_get_allocated_height(GTK_WIDGET(monitor)); +#else width = GTK_WIDGET (monitor)->allocation.width; height = GTK_WIDGET (monitor)->allocation.height; +#endif /* Paint a box */ if (monitor->paint_box) - gtk_paint_box (GTK_WIDGET (monitor)->style, GTK_WIDGET (monitor)->window, GTK_STATE_PRELIGHT, GTK_SHADOW_IN, +#ifdef HAVE_GTK3 + gtk_paint_box (gtk_widget_get_style(GTK_WIDGET(monitor)), cr, GTK_STATE_PRELIGHT, GTK_SHADOW_IN, + GTK_WIDGET (monitor), "trough", 0, 0, width, height); +#else + gtk_paint_box (gtk_widget_get_style(GTK_WIDGET(monitor)), gtk_widget_get_window(GTK_WIDGET(monitor)), GTK_STATE_PRELIGHT, GTK_SHADOW_IN, NULL, GTK_WIDGET (monitor), "trough", 0, 0, width, height); - +#endif /* Paint the graph */ graph_surface = xtm_process_monitor_graph_surface_create (monitor); if (graph_surface != NULL) @@ -301,8 +318,13 @@ xtm_process_monitor_paint (XtmProcessMonitor *monitor) /* Repaint a shadow on top of everything to clear corners */ if (monitor->paint_box) - gtk_paint_shadow (GTK_WIDGET (monitor)->style, GTK_WIDGET (monitor)->window, GTK_STATE_PRELIGHT, GTK_SHADOW_IN, +#ifdef HAVE_GTK3 + gtk_paint_shadow (gtk_widget_get_style(GTK_WIDGET(monitor)), cr, GTK_STATE_PRELIGHT, GTK_SHADOW_IN, + GTK_WIDGET (monitor), "trough", 0, 0, width, height); +#else + gtk_paint_shadow (gtk_widget_get_style(GTK_WIDGET(monitor)), gtk_widget_get_window(GTK_WIDGET(monitor)), GTK_STATE_PRELIGHT, GTK_SHADOW_IN, NULL, GTK_WIDGET (monitor), "trough", 0, 0, width, height); +#endif cairo_destroy (cr); } From 23c43d14ec8dc4a53f4e3f51d94dc772662e12be Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Thu, 11 Dec 2014 18:15:12 +0100 Subject: [PATCH 16/34] comment out gdk_color_parse() calls, allows taskmanager built with gtk3 to run.. --- src/process-monitor.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/process-monitor.c b/src/process-monitor.c index 82cc3e6..0dd6568 100644 --- a/src/process-monitor.c +++ b/src/process-monitor.c @@ -81,7 +81,9 @@ init_source_color (GtkWidget *widget, GtkStyle *prev_style, gpointer user_data) { #ifdef HAVE_GTK3 GdkColor *color; +/* gdk_color_parse("red", color); +*/ #else GdkColor *color = &widget->style->base[GTK_STATE_SELECTED]; XTM_PROCESS_MONITOR (widget)->color_red = color->red / 65535.0; @@ -300,8 +302,10 @@ xtm_process_monitor_paint (XtmProcessMonitor *monitor) #ifdef HAVE_GTK3 GdkColor *color; +/* gdk_color_parse("red", color); gdk_cairo_set_source_color (cr, color); +*/ #else gdk_cairo_set_source_color (cr, >K_WIDGET (monitor)->style->fg[GTK_STATE_NORMAL]); #endif From 16722479ab9ba6b22d57923fa28311bc15f56a9a Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Thu, 11 Dec 2014 18:19:29 +0100 Subject: [PATCH 17/34] no need for HAVE_GTK3 when you already check for GTK_CHECK_VERSION(2, 24, 1) --- src/settings-dialog.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/settings-dialog.c b/src/settings-dialog.c index cd1ca76..ae56f36 100644 --- a/src/settings-dialog.c +++ b/src/settings-dialog.c @@ -119,7 +119,7 @@ xtm_settings_dialog_init (XtmSettingsDialog *dialog) XtmToolbarStyle toolbar_style; box = GTK_WIDGET (gtk_builder_get_object (builder, "hbox-toolbar-style")); -#if HAVE_GTK3 || GTK_CHECK_VERSION(2, 24, 1) +#if GTK_CHECK_VERSION(2, 24, 1) combobox = gtk_combo_box_text_new (); #else combobox = gtk_combo_box_new_text (); @@ -129,7 +129,7 @@ xtm_settings_dialog_init (XtmSettingsDialog *dialog) klass = g_type_class_ref (XTM_TYPE_TOOLBAR_STYLE); for (n = 0; n < klass->n_values; ++n) -#if HAVE_GTK3 || GTK_CHECK_VERSION(2, 24, 1) +#if GTK_CHECK_VERSION(2, 24, 1) gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox), _(klass->values[n].value_nick)); #else gtk_combo_box_append_text (GTK_COMBO_BOX (combobox), _(klass->values[n].value_nick)); From c90a0ac966a5f1c2bc61cd5312f74ce5e0c4ec7a Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Thu, 11 Dec 2014 18:52:50 +0100 Subject: [PATCH 18/34] use GDK_KEY_Menu instead of the deprecated GDK_Menu via gdkkeysyms-compat.h --- src/process-tree-view.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/process-tree-view.c b/src/process-tree-view.c index e6f6ffd..01be48b 100644 --- a/src/process-tree-view.c +++ b/src/process-tree-view.c @@ -15,9 +15,6 @@ #include #include #include -#ifdef HAVE_GTK3 -#include -#endif #include "process-tree-model.h" #include "process-tree-view.h" #include "task-manager.h" @@ -559,7 +556,7 @@ treeview_key_pressed (XtmProcessTreeView *treeview, GdkEventKey *event) { guint pid; - if (event->keyval != GDK_Menu) + if (event->keyval != GDK_KEY_Menu) return FALSE; { From 177914f858afe97793dc19d81356207ee9c714df Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Thu, 11 Dec 2014 19:07:02 +0100 Subject: [PATCH 19/34] Convert GtkBuilder files to gtk3 - replace GtkHBox/VBox by plain GtkBox - replace GtkHSeparator/VSeparator by plain GtkSeparator - replace GtkHButtonBox by GtkButtonBox --- src/process-window.ui | 11 +++++++---- src/settings-dialog.ui | 22 +++++++++++----------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/process-window.ui b/src/process-window.ui index 173211c..c20861e 100644 --- a/src/process-window.ui +++ b/src/process-window.ui @@ -9,8 +9,9 @@ 465 utilities-system-monitor - + True + vertical False @@ -66,8 +67,9 @@ - + False + vertical True @@ -89,7 +91,7 @@ - + True False @@ -126,8 +128,9 @@ - + True + vertical False 6 diff --git a/src/settings-dialog.ui b/src/settings-dialog.ui index 9fd836d..2223930 100644 --- a/src/settings-dialog.ui +++ b/src/settings-dialog.ui @@ -12,7 +12,7 @@ normal False - + True vertical 2 @@ -22,11 +22,11 @@ True False - + True 6 - + True vertical 6 @@ -41,7 +41,7 @@ 6 12 - + True vertical 6 @@ -129,7 +129,7 @@ - + True 6 @@ -182,7 +182,7 @@ 6 12 - + True vertical 6 @@ -238,7 +238,7 @@ - + vertical @@ -248,7 +248,7 @@ - + vertical 6 @@ -263,12 +263,12 @@ 6 12 - + True vertical 6 - + True 6 @@ -385,7 +385,7 @@ - + True end From cc3013455b4cb786e04dbbf6fb6c871322d83b4b Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Thu, 11 Dec 2014 19:09:09 +0100 Subject: [PATCH 20/34] Save GtkBuilder file with glade 3, allows to display the settings dialog without crashing. --- src/settings-dialog.ui | 108 ++++++++++++++++++++++++++++++----------- 1 file changed, 79 insertions(+), 29 deletions(-) diff --git a/src/settings-dialog.ui b/src/settings-dialog.ui index 2223930..43c509c 100644 --- a/src/settings-dialog.ui +++ b/src/settings-dialog.ui @@ -1,8 +1,9 @@ - + + - - + + False 5 Settings for Task Manager False @@ -10,12 +11,39 @@ True gtk-preferences normal - False True + False vertical 2 + + + True + False + end + + + gtk-close + True + True + True + True + + + False + False + 0 + + + + + False + False + end + 0 + + True @@ -24,25 +52,30 @@ True + False 6 True + False vertical 6 True + False 0 none True + False 6 12 True + False vertical 6 @@ -51,9 +84,12 @@ True True False + 0.5 True + False + True 0 @@ -63,6 +99,7 @@ True True False + 0.5 True @@ -77,6 +114,7 @@ True True False + 0.5 True @@ -106,6 +144,7 @@ True True False + 0.5 True @@ -120,6 +159,7 @@ True True False + 0.5 True @@ -131,10 +171,12 @@ True + False 6 True + False Toolbar style: @@ -160,6 +202,7 @@ True + False <b>Interface style</b> True @@ -174,16 +217,19 @@ True + False 0 none True + False 6 12 True + False vertical 6 @@ -192,6 +238,7 @@ True True False + 0.5 True @@ -206,6 +253,7 @@ True True False + 0.5 True @@ -221,6 +269,7 @@ True + False <b>Miscellaneous</b> True @@ -234,46 +283,56 @@ + False + True 0 + False vertical False + True 6 1 + False vertical 6 True False + False 0 none True + False 6 12 True + False vertical 6 True + False 6 True + False Refresh rate: @@ -285,6 +344,7 @@ True + False False @@ -302,6 +362,7 @@ True + False 0 Columns: @@ -314,6 +375,7 @@ True + False 12 @@ -326,12 +388,17 @@ True True + + + + False + True 2 @@ -342,17 +409,22 @@ True + False <b>Information</b> True + False + True 0 + False + True 2 @@ -361,6 +433,7 @@ True + False Settings @@ -380,33 +453,10 @@ - - 1 - - - - - True - end - - - gtk-close - True - True - True - True - - - False - False - 0 - - - False - end - 0 + True + 1 From 9e0dde7a476694fc27c546a15be1df5a8df8194e Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Thu, 11 Dec 2014 19:10:47 +0100 Subject: [PATCH 21/34] save process-window.ui with glade 3 --- src/process-window.ui | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/process-window.ui b/src/process-window.ui index c20861e..5bd62d8 100644 --- a/src/process-window.ui +++ b/src/process-window.ui @@ -1,7 +1,7 @@ + - - + False Task Manager @@ -11,8 +11,8 @@ True - vertical False + vertical True @@ -116,8 +116,6 @@ gtk-find gtk-clear False - True - True False @@ -130,15 +128,13 @@ True - vertical False + vertical 6 True True - automatic - automatic From 5310bb20d5c7b58fc783f75d7d574164bd5640c2 Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Thu, 11 Dec 2014 22:18:50 +0100 Subject: [PATCH 22/34] Only check for wnck3 if --enable-gtk3 was passed, and enable it by default then. Only check for wnck/gksu in the other case. This way one only needs --enable-gtk3 to switch. --- configure.ac.in | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/configure.ac.in b/configure.ac.in index d259d01..ff4ab12 100644 --- a/configure.ac.in +++ b/configure.ac.in @@ -71,17 +71,19 @@ XDT_CHECK_PACKAGE([CAIRO], [cairo], [1.5.0]) dnl *********************************** dnl *** Check for optional packages *** dnl *********************************** -XDT_CHECK_OPTIONAL_PACKAGE([WNCK], [libwnck-1.0], [2.0], [wnck], [building with libwnck for window icons/names], [yes]) -AM_CONDITIONAL([HAVE_WNCK], [test x"$WNCK_FOUND" = x"yes"]) -XDT_CHECK_OPTIONAL_PACKAGE([GKSU], [libgksu2], [2.0], [gksu], [building with libgksu to run as root], [yes]) -AM_CONDITIONAL([HAVE_GKSU], [test x"$GKSU_FOUND" = x"yes"]) XDT_CHECK_OPTIONAL_PACKAGE([GTK3], [gtk+-3.0], [3.2.0], [gtk3], [GTK+ 3 support], [no]) AM_CONDITIONAL([USE_GTK3], [test "x$GTK3_FOUND" = "xyes"]) -XDT_CHECK_OPTIONAL_PACKAGE([WNCK3], [libwnck-3.0], [3.2], [wnck3], [building with libwnck3 for window icons/names], [no]) -AM_CONDITIONAL([USE_WNCK3], [test x"$WNCK3_FOUND" = x"yes"]) - +if test "x$GTK3_FOUND" = "xyes"; then + XDT_CHECK_OPTIONAL_PACKAGE([WNCK3], [libwnck-3.0], [3.2], [wnck3], [building with libwnck3 for window icons/names], [yes]) +else + XDT_CHECK_OPTIONAL_PACKAGE([WNCK], [libwnck-1.0], [2.0], [wnck], [building with libwnck for window icons/names], [yes]) + XDT_CHECK_OPTIONAL_PACKAGE([GKSU], [libgksu2], [2.0], [gksu], [building with libgksu to run as root], [yes]) +fi +AM_CONDITIONAL([HAVE_WNCK3], [test x"$WNCK3_FOUND" = x"yes"]) +AM_CONDITIONAL([HAVE_WNCK], [test x"$WNCK_FOUND" = x"yes"]) +AM_CONDITIONAL([HAVE_GKSU], [test x"$GKSU_FOUND" = x"yes"]) dnl *********************************** dnl ********** Check for skel ********* dnl *********************************** @@ -155,7 +157,7 @@ echo echo "Build Configuration:" echo echo "* Gksu: ${GKSU_VERSION:-no}" -if test "x$WNCK3_FOUND" = "xyes" ; then +if test "x$GTK3_FOUND" = "xyes" ; then echo "* Wnck: ${WNCK3_VERSION:-no}" else echo "* Wnck: ${WNCK_VERSION:-no}" From f33f64410fde767053bf3e28a93189fd1f22aa8b Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Thu, 11 Dec 2014 22:43:40 +0100 Subject: [PATCH 23/34] use gtk_tool_button_set_icon_name() instead of gtk_tool_button_set_stock_id() --- src/settings-tool-button.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/settings-tool-button.c b/src/settings-tool-button.c index 9bdfd6e..d625458 100644 --- a/src/settings-tool-button.c +++ b/src/settings-tool-button.c @@ -49,7 +49,7 @@ xtm_settings_tool_button_init (XtmSettingsToolButton *button) { GtkWidget *menu; - gtk_tool_button_set_stock_id (GTK_TOOL_BUTTON (button), "gtk-preferences"); + gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON (button), "gtk-preferences"); gtk_tool_button_set_use_underline (GTK_TOOL_BUTTON (button), TRUE); menu = construct_menu (); From f7dc12a375ded72039ecc079e52b56823920267a Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Thu, 11 Dec 2014 22:44:12 +0100 Subject: [PATCH 24/34] use a plain GtkBox for the statusbar --- src/process-statusbar.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/process-statusbar.c b/src/process-statusbar.c index 23cb022..376e408 100644 --- a/src/process-statusbar.c +++ b/src/process-statusbar.c @@ -100,7 +100,11 @@ xtm_process_statusbar_init (XtmProcessStatusbar *statusbar) } #endif +#if HAVE_GTK3 + hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 16); +#else hbox = gtk_hbox_new (FALSE, 16); +#endif gtk_box_pack_start (GTK_BOX (area), hbox, TRUE, TRUE, 6); statusbar->label_num_processes = gtk_label_new (NULL); From f721131703bda9ec48585a9d65b95c8ef5dd655a Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Thu, 11 Dec 2014 22:52:35 +0100 Subject: [PATCH 25/34] use gtk_tool_button_set_icon_name() instead of gtk_tool_button_set_stock_id() --- src/exec-tool-button.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/exec-tool-button.c b/src/exec-tool-button.c index 1ef6dfb..d9d6a9f 100644 --- a/src/exec-tool-button.c +++ b/src/exec-tool-button.c @@ -51,7 +51,7 @@ xtm_exec_tool_button_init (XtmExecToolButton *button) { GtkWidget *menu; - gtk_tool_button_set_stock_id (GTK_TOOL_BUTTON (button), "gtk-execute"); + gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (button), "gtk-execute"); gtk_tool_button_set_use_underline (GTK_TOOL_BUTTON (button), TRUE); menu = construct_menu (); From 1e1ee4c0f9565d02e1cd245c50fec1764003ce81 Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Thu, 11 Dec 2014 22:57:07 +0100 Subject: [PATCH 26/34] icon-name property was deprecated in gtk3 --- src/process-window.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/process-window.c b/src/process-window.c index f349329..4be696d 100644 --- a/src/process-window.c +++ b/src/process-window.c @@ -354,7 +354,9 @@ show_about_dialog (XtmProcessWindow *window) "version", PACKAGE_VERSION, "copyright", "Copyright \302\251 2005-2010 The Xfce development team", "logo-icon-name", "utilities-system-monitor", +#ifndef HAVE_GTK3 "icon-name", GTK_STOCK_ABOUT, +#endif "comments", _("Easy to use task manager"), "license", license, "authors", authors, From d8404b3021ad1eb3ee57ed1d9e00226409ddde1a Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Thu, 11 Dec 2014 23:27:19 +0100 Subject: [PATCH 27/34] Rename gtkbuilder files with a -gtk3 suffix for clarity --- src/{process-window.ui => process-window-gtk3.ui} | 0 src/{settings-dialog.ui => settings-dialog-gtk3.ui} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename src/{process-window.ui => process-window-gtk3.ui} (100%) rename src/{settings-dialog.ui => settings-dialog-gtk3.ui} (100%) diff --git a/src/process-window.ui b/src/process-window-gtk3.ui similarity index 100% rename from src/process-window.ui rename to src/process-window-gtk3.ui diff --git a/src/settings-dialog.ui b/src/settings-dialog-gtk3.ui similarity index 100% rename from src/settings-dialog.ui rename to src/settings-dialog-gtk3.ui From 3f02cc46d7c100427ef0be3835dc2efdf52bf996 Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Thu, 11 Dec 2014 23:27:53 +0100 Subject: [PATCH 28/34] Restore gtk2 versions of the gtkbuilder ui files --- src/process-window.ui | 162 ++++++++++++++++ src/settings-dialog.ui | 418 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 580 insertions(+) create mode 100644 src/process-window.ui create mode 100644 src/settings-dialog.ui diff --git a/src/process-window.ui b/src/process-window.ui new file mode 100644 index 0000000..173211c --- /dev/null +++ b/src/process-window.ui @@ -0,0 +1,162 @@ + + + + + + False + Task Manager + 490 + 465 + utilities-system-monitor + + + True + False + + + True + False + False + 1 + + + True + False + 2 + + + + + + True + True + + + + + True + False + 2 + + + + + + True + True + + + + + True + False + True + gtk-about + + + False + True + + + + + False + True + 0 + + + + + False + + + True + False + + + True + False + 6 + 3 + Warning, you are using the root account, you may harm your system. + + + + + False + False + 0 + + + + + True + False + + + False + True + 1 + + + + + False + False + 1 + + + + + True + True + + gtk-find + gtk-clear + False + True + True + False + + + False + False + 2 + 2 + + + + + True + False + 6 + + + True + True + automatic + automatic + + + + + + True + True + 0 + + + + + True + True + 3 + + + + + + + + + diff --git a/src/settings-dialog.ui b/src/settings-dialog.ui new file mode 100644 index 0000000..2223930 --- /dev/null +++ b/src/settings-dialog.ui @@ -0,0 +1,418 @@ + + + + + + 5 + Settings for Task Manager + False + True + True + gtk-preferences + normal + False + + + True + vertical + 2 + + + True + True + False + + + True + 6 + + + True + vertical + 6 + + + True + 0 + none + + + True + 6 + 12 + + + True + vertical + 6 + + + Show application icons + True + True + False + True + + + 0 + + + + + Show full command lines + True + True + False + True + + + False + False + 1 + + + + + Show values with more precision + True + True + False + True + + + False + False + 2 + + + + + Draw borders around monitors + True + True + False + 0.49000000953674316 + True + + + False + False + 3 + + + + + Show processes as tree + True + True + False + True + + + False + False + 4 + + + + + Show memory usage in bytes + True + True + False + True + + + False + False + 5 + + + + + True + 6 + + + True + Toolbar style: + + + False + False + 0 + + + + + + + + False + False + 6 + + + + + + + + + True + <b>Interface style</b> + True + + + + + False + False + 0 + + + + + True + 0 + none + + + True + 6 + 12 + + + True + vertical + 6 + + + Prompt for terminating tasks + True + True + False + True + + + False + False + 0 + + + + + Hide into the notification area + True + True + False + True + + + False + False + 1 + + + + + + + + + True + <b>Miscellaneous</b> + True + + + + + False + False + 1 + + + + + 0 + + + + + vertical + + + False + 6 + 1 + + + + + vertical + 6 + + + True + False + 0 + none + + + True + 6 + 12 + + + True + vertical + 6 + + + True + 6 + + + True + Refresh rate: + + + False + False + 0 + + + + + True + + + False + False + 1 + + + + + False + False + 0 + + + + + True + 0 + Columns: + + + False + False + 1 + + + + + True + 12 + + + True + True + never + never + in + + + True + True + + + + + + + 2 + + + + + + + + + True + <b>Information</b> + True + + + + + 0 + + + + + 2 + + + + + + + True + Settings + + + False + + + + + + + + + + + + + + + + + 1 + + + + + True + end + + + gtk-close + True + True + True + True + + + False + False + 0 + + + + + False + end + 0 + + + + + + button-close + + + From 4d6fb822be83a659a258068a22f048a7e6000b91 Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Thu, 11 Dec 2014 23:28:19 +0100 Subject: [PATCH 29/34] Add automake plumbing to generate both gtk2 and gtk3 ui files in maintainer mode. - add the resulting files to BUILT_SOURCES & xfce4_taskmanager_SOURCES - add the gtk3 ui files to EXTRA_DIST --- src/Makefile.am | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am index 7b457ce..c43e390 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -20,7 +20,7 @@ xfce4_taskmanager_LDADD = \ xfce4_taskmanager_SOURCES = \ main.c \ - process-window_ui.h \ + process-window_ui.h process-window-gtk3_ui.h \ process-window.c process-window.h \ process-monitor.c process-monitor.h \ process-tree-model.c process-tree-model.h \ @@ -28,7 +28,7 @@ xfce4_taskmanager_SOURCES = \ process-statusbar.c process-statusbar.h \ exec-tool-button.c exec-tool-button.h \ settings-tool-button.c settings-tool-button.h \ - settings-dialog_ui.h \ + settings-dialog_ui.h settings-dialog-gtk3_ui.h \ settings-dialog.c settings-dialog.h \ settings.c settings.h \ task-manager.c task-manager.h \ @@ -63,12 +63,16 @@ xfce4_taskmanager_SOURCES += task-manager-skel.c endif if MAINTAINER_MODE -BUILT_SOURCES = process-window_ui.h settings-dialog_ui.h +BUILT_SOURCES = process-window_ui.h settings-dialog_ui.h process-window-gtk3_ui.h settings-dialog-gtk3_ui.h process-window_ui.h: process-window.ui $(AM_V_GEN) exo-csource --static --strip-comments --strip-content --name=process_window_ui $< >$@ settings-dialog_ui.h: settings-dialog.ui $(AM_V_GEN) exo-csource --static --strip-comments --strip-content --name=settings_dialog_ui $< >$@ +process-window-gtk3_ui.h: process-window-gtk3.ui + $(AM_V_GEN) exo-csource --static --strip-comments --strip-content --name=process_window_ui $< >$@ +settings-dialog-gtk3_ui.h: settings-dialog-gtk3.ui + $(AM_V_GEN) exo-csource --static --strip-comments --strip-content --name=settings_dialog_ui $< >$@ endif -EXTRA_DIST = process-window.ui settings-dialog.ui +EXTRA_DIST = process-window.ui settings-dialog.ui process-window-gtk3.ui settings-dialog-gtk3.ui From 21bf64ee9249c72aaa88fd5c32fa9866fba2e337 Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Thu, 11 Dec 2014 23:29:57 +0100 Subject: [PATCH 30/34] use #ifdef instead of #if to avoid warnings with gtk2 --- src/process-monitor.c | 2 +- src/process-statusbar.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/process-monitor.c b/src/process-monitor.c index 0dd6568..0ef954b 100644 --- a/src/process-monitor.c +++ b/src/process-monitor.c @@ -59,7 +59,7 @@ xtm_process_monitor_class_init (XtmProcessMonitorClass *klass) xtm_process_monitor_parent_class = g_type_class_peek_parent (klass); class->get_property = xtm_process_monitor_get_property; class->set_property = xtm_process_monitor_set_property; -#if HAVE_GTK3 +#ifdef HAVE_GTK3 widget_class->draw = xtm_process_monitor_expose; #else widget_class->expose_event = xtm_process_monitor_expose; diff --git a/src/process-statusbar.c b/src/process-statusbar.c index 376e408..01a46e1 100644 --- a/src/process-statusbar.c +++ b/src/process-statusbar.c @@ -100,7 +100,7 @@ xtm_process_statusbar_init (XtmProcessStatusbar *statusbar) } #endif -#if HAVE_GTK3 +#ifdef HAVE_GTK3 hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 16); #else hbox = gtk_hbox_new (FALSE, 16); From f3149fa2c12027dc866309c270ba329fd73603e3 Mon Sep 17 00:00:00 2001 From: Landry Breuil Date: Thu, 11 Dec 2014 23:30:29 +0100 Subject: [PATCH 31/34] include the gtk3 generated ui file when building against gtk3. This way both flavors build --- src/process-window.c | 4 ++++ src/settings-dialog.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/process-window.c b/src/process-window.c index 4be696d..1621b34 100644 --- a/src/process-window.c +++ b/src/process-window.c @@ -22,7 +22,11 @@ #include "settings.h" #include "process-window.h" +#ifdef HAVE_GTK3 +#include "process-window-gtk3_ui.h" +#else #include "process-window_ui.h" +#endif #include "process-monitor.h" #include "process-tree-view.h" #include "process-statusbar.h" diff --git a/src/settings-dialog.c b/src/settings-dialog.c index ae56f36..203cbc6 100644 --- a/src/settings-dialog.c +++ b/src/settings-dialog.c @@ -17,7 +17,11 @@ #include "settings.h" #include "settings-dialog.h" +#ifdef HAVE_GTK3 +#include "settings-dialog-gtk3_ui.h" +#else #include "settings-dialog_ui.h" +#endif From aadc7908e62a9491d4e9078c1f6ff2eb95122165 Mon Sep 17 00:00:00 2001 From: Simon Steinbeiss Date: Wed, 17 Dec 2014 10:25:59 +0100 Subject: [PATCH 32/34] Fix gtk2 settings dialog --- src/settings-dialog.ui | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/settings-dialog.ui b/src/settings-dialog.ui index 2223930..781bc0f 100644 --- a/src/settings-dialog.ui +++ b/src/settings-dialog.ui @@ -12,7 +12,7 @@ normal False - + True vertical 2 @@ -22,11 +22,11 @@ True False - + True 6 - + True vertical 6 @@ -41,7 +41,7 @@ 6 12 - + True vertical 6 @@ -129,7 +129,7 @@ - + True 6 @@ -182,7 +182,7 @@ 6 12 - + True vertical 6 @@ -238,7 +238,7 @@ - + vertical @@ -248,7 +248,7 @@ - + vertical 6 @@ -263,12 +263,12 @@ 6 12 - + True vertical 6 - + True 6 From abb5f97740f4490e5455d9ad587f1550e0533ef4 Mon Sep 17 00:00:00 2001 From: Simon Steinbeiss Date: Wed, 17 Dec 2014 10:38:32 +0100 Subject: [PATCH 33/34] Hardcode the graph colors and simplify the drawing routines --- src/process-monitor.c | 162 +++++++----------------------------------- src/process-monitor.h | 2 - 2 files changed, 26 insertions(+), 138 deletions(-) diff --git a/src/process-monitor.c b/src/process-monitor.c index 0ef954b..3bea77d 100644 --- a/src/process-monitor.c +++ b/src/process-monitor.c @@ -21,9 +21,6 @@ enum { PROP_STEP_SIZE = 1, - PROP_COLOR_RED, - PROP_COLOR_GREEN, - PROP_COLOR_BLUE, PROP_PAINT_BOX, }; typedef struct _XtmProcessMonitorClass XtmProcessMonitorClass; @@ -37,9 +34,6 @@ struct _XtmProcessMonitor /**/ gfloat step_size; GArray * history; - gfloat color_red; - gfloat color_green; - gfloat color_blue; gboolean paint_box; }; G_DEFINE_TYPE (XtmProcessMonitor, xtm_process_monitor, GTK_TYPE_DRAWING_AREA) @@ -66,37 +60,14 @@ xtm_process_monitor_class_init (XtmProcessMonitorClass *klass) #endif g_object_class_install_property (class, PROP_STEP_SIZE, g_param_spec_float ("step-size", "StepSize", "Step size", 0.1, G_MAXFLOAT, 1, G_PARAM_CONSTRUCT|G_PARAM_READWRITE)); - g_object_class_install_property (class, PROP_COLOR_RED, - g_param_spec_float ("color-red", "ColorRed", "Color red", 0, 1, 0, G_PARAM_READWRITE)); - g_object_class_install_property (class, PROP_COLOR_GREEN, - g_param_spec_float ("color-green", "ColorGreen", "Color green", 0, 1, 0, G_PARAM_READWRITE)); - g_object_class_install_property (class, PROP_COLOR_BLUE, - g_param_spec_float ("color-blue", "ColorBlue", "Color blue", 0, 1, 0, G_PARAM_READWRITE)); g_object_class_install_property (class, PROP_PAINT_BOX, g_param_spec_boolean ("paint-box", "PaintBox", "Paint box around monitor", TRUE, G_PARAM_CONSTRUCT|G_PARAM_READWRITE)); } -static void -init_source_color (GtkWidget *widget, GtkStyle *prev_style, gpointer user_data) -{ -#ifdef HAVE_GTK3 - GdkColor *color; -/* - gdk_color_parse("red", color); -*/ -#else - GdkColor *color = &widget->style->base[GTK_STATE_SELECTED]; - XTM_PROCESS_MONITOR (widget)->color_red = color->red / 65535.0; - XTM_PROCESS_MONITOR (widget)->color_green = color->green / 65535.0; - XTM_PROCESS_MONITOR (widget)->color_blue = color->blue / 65535.0; -#endif -} - static void xtm_process_monitor_init (XtmProcessMonitor *monitor) { monitor->history = g_array_new (FALSE, TRUE, sizeof (gfloat)); - g_signal_connect (monitor, "style-set", G_CALLBACK (init_source_color), NULL); } static void @@ -109,18 +80,6 @@ xtm_process_monitor_get_property (GObject *object, guint property_id, GValue *va g_value_set_float (value, monitor->step_size); break; - case PROP_COLOR_RED: - g_value_set_float (value, monitor->color_red); - break; - - case PROP_COLOR_GREEN: - g_value_set_float (value, monitor->color_green); - break; - - case PROP_COLOR_BLUE: - g_value_set_float (value, monitor->color_blue); - break; - case PROP_PAINT_BOX: g_value_set_boolean (value, monitor->paint_box); break; @@ -141,18 +100,6 @@ xtm_process_monitor_set_property (GObject *object, guint property_id, const GVal monitor->step_size = g_value_get_float (value); break; - case PROP_COLOR_RED: - monitor->color_red = g_value_get_float (value); - break; - - case PROP_COLOR_GREEN: - monitor->color_green = g_value_get_float (value); - break; - - case PROP_COLOR_BLUE: - monitor->color_blue = g_value_get_float (value); - break; - case PROP_PAINT_BOX: monitor->paint_box = g_value_get_boolean (value); break; @@ -182,14 +129,12 @@ xtm_process_monitor_expose (GtkWidget *widget, GdkEventExpose *event) } static cairo_surface_t * -xtm_process_monitor_graph_surface_create (XtmProcessMonitor *monitor) +xtm_process_monitor_graph_surface_create (XtmProcessMonitor *monitor, gint width, gint height) { cairo_t *cr; cairo_surface_t *graph_surface; - cairo_pattern_t *linpat; gfloat *peak; gfloat step_size; - gint width, height; gint i; if (monitor->history->len <= 1) @@ -197,25 +142,13 @@ xtm_process_monitor_graph_surface_create (XtmProcessMonitor *monitor) g_warning ("Cannot paint graph with n_peak <= 1"); return NULL; } - -#ifdef HAVE_GTK3 - width = gtk_widget_get_allocated_width(GTK_WIDGET(monitor)); - height = gtk_widget_get_allocated_height(GTK_WIDGET(monitor)); -#else - width = GTK_WIDGET (monitor)->allocation.width; - height = GTK_WIDGET (monitor)->allocation.height; -#endif step_size = monitor->step_size; graph_surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height); cr = cairo_create (graph_surface); - /* Draw area */ - linpat = cairo_pattern_create_linear (0, 0, 0, height); - cairo_pattern_add_color_stop_rgba (linpat, 0.4, monitor->color_red, monitor->color_green, monitor->color_blue, 0.3); - cairo_pattern_add_color_stop_rgba (linpat, 0.9, monitor->color_red, monitor->color_green, monitor->color_blue, 0.5); - cairo_pattern_add_color_stop_rgba (linpat, 1, monitor->color_red, monitor->color_green, monitor->color_blue, 0.6); - cairo_set_source (cr, linpat); + /* Draw area below the line */ + cairo_set_source_rgba (cr, 1.0, 0.43, 0.0, 0.3); cairo_set_line_width (cr, 0.0); cairo_set_antialias (cr, CAIRO_ANTIALIAS_DEFAULT); @@ -230,12 +163,10 @@ xtm_process_monitor_graph_surface_create (XtmProcessMonitor *monitor) cairo_line_to (cr, width, height); cairo_fill (cr); - cairo_pattern_destroy (linpat); - /* Draw line */ cairo_translate (cr, step_size * i, 0); - cairo_set_source_rgb (cr, monitor->color_red, monitor->color_green, monitor->color_blue); + cairo_set_source_rgba (cr, 1.0, 0.43, 0.0, 1.0); cairo_set_line_width (cr, 0.85); cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND); cairo_set_line_join (cr, CAIRO_LINE_JOIN_ROUND); @@ -260,6 +191,7 @@ xtm_process_monitor_paint (XtmProcessMonitor *monitor) cairo_t *cr; cairo_surface_t *graph_surface; gint width, height; + static const double dashed[] = {1.5}; gint i; cr = gdk_cairo_create (gtk_widget_get_window(GTK_WIDGET(monitor))); #ifdef HAVE_GTK3 @@ -270,17 +202,27 @@ xtm_process_monitor_paint (XtmProcessMonitor *monitor) height = GTK_WIDGET (monitor)->allocation.height; #endif - /* Paint a box */ - if (monitor->paint_box) -#ifdef HAVE_GTK3 - gtk_paint_box (gtk_widget_get_style(GTK_WIDGET(monitor)), cr, GTK_STATE_PRELIGHT, GTK_SHADOW_IN, - GTK_WIDGET (monitor), "trough", 0, 0, width, height); -#else - gtk_paint_box (gtk_widget_get_style(GTK_WIDGET(monitor)), gtk_widget_get_window(GTK_WIDGET(monitor)), GTK_STATE_PRELIGHT, GTK_SHADOW_IN, - NULL, GTK_WIDGET (monitor), "trough", 0, 0, width, height); -#endif - /* Paint the graph */ - graph_surface = xtm_process_monitor_graph_surface_create (monitor); + /* Paint the graph's background box */ + cairo_rectangle (cr, 0.0, 0.0, width, height); + cairo_set_source_rgb (cr, 0.96, 0.96, 0.96); + cairo_fill_preserve (cr); + cairo_set_source_rgb (cr, 0.0, 0.0, 0.0); + cairo_set_line_width (cr, 0.75); + cairo_stroke (cr); + + /* Paint dashed lines at 25%, 50% and 75% */ + cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 0.3); + cairo_set_line_width (cr, 1.0); + cairo_set_dash(cr, dashed, 1.0, 0); + for (i = 25; i <= 75; i += 25) + { + cairo_move_to (cr, 1.5, i * height / 100 + 0.5); + cairo_line_to (cr, width - 0.5, i * height / 100 + 0.5); + cairo_stroke (cr); + } + + /* Paint the graph on a slightly smaller surface not to overlap with the background box */ + graph_surface = xtm_process_monitor_graph_surface_create (monitor, width - 1, height - 1); if (graph_surface != NULL) { cairo_set_source_surface (cr, graph_surface, 0.0, 0.0); @@ -288,48 +230,6 @@ xtm_process_monitor_paint (XtmProcessMonitor *monitor) cairo_surface_destroy (graph_surface); } - /* Trace some marks */ - cairo_set_line_width (cr, 0.75); - cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE); - cairo_set_line_join (cr, CAIRO_LINE_JOIN_MITER); - cairo_set_antialias (cr, CAIRO_ANTIALIAS_DEFAULT); - for (i = 10; i < 100; i += 10) - { - cairo_move_to (cr, 0.0, i * height / 100); - cairo_line_to (cr, width, i * height / 100); - } - cairo_stroke (cr); - -#ifdef HAVE_GTK3 - GdkColor *color; -/* - gdk_color_parse("red", color); - gdk_cairo_set_source_color (cr, color); -*/ -#else - gdk_cairo_set_source_color (cr, >K_WIDGET (monitor)->style->fg[GTK_STATE_NORMAL]); -#endif - cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE); - cairo_set_line_width (cr, 1.0); - for (i = 25; i <= 75; i += 25) - { - cairo_move_to (cr, 0.0, i * height / 100); - cairo_line_to (cr, 4.0, i * height / 100); - cairo_move_to (cr, width, i * height / 100); - cairo_line_to (cr, width - 4.0, i * height / 100); - } - cairo_stroke (cr); - - /* Repaint a shadow on top of everything to clear corners */ - if (monitor->paint_box) -#ifdef HAVE_GTK3 - gtk_paint_shadow (gtk_widget_get_style(GTK_WIDGET(monitor)), cr, GTK_STATE_PRELIGHT, GTK_SHADOW_IN, - GTK_WIDGET (monitor), "trough", 0, 0, width, height); -#else - gtk_paint_shadow (gtk_widget_get_style(GTK_WIDGET(monitor)), gtk_widget_get_window(GTK_WIDGET(monitor)), GTK_STATE_PRELIGHT, GTK_SHADOW_IN, - NULL, GTK_WIDGET (monitor), "trough", 0, 0, width, height); -#endif - cairo_destroy (cr); } @@ -371,16 +271,6 @@ xtm_process_monitor_clear (XtmProcessMonitor *monitor) gdk_window_invalidate_rect (gtk_widget_get_window (GTK_WIDGET(monitor)), NULL, FALSE); } -void -xtm_process_monitor_set_source_color (XtmProcessMonitor *monitor, gdouble red, gdouble green, gdouble blue) -{ - g_return_if_fail (XTM_IS_PROCESS_MONITOR (monitor)); - g_signal_handlers_disconnect_by_func (GTK_WIDGET (monitor), init_source_color, NULL); - g_object_set (monitor, "color-red", red, "color-green", green, "color-blue", blue, NULL); - if (GDK_IS_WINDOW (gtk_widget_get_window (GTK_WIDGET(monitor)))) - gdk_window_invalidate_rect (gtk_widget_get_window (GTK_WIDGET(monitor)), NULL, FALSE); -} - void xtm_process_monitor_set_paint_box (XtmProcessMonitor *monitor, gboolean paint_box) { diff --git a/src/process-monitor.h b/src/process-monitor.h index aa90f98..7d84bbd 100644 --- a/src/process-monitor.h +++ b/src/process-monitor.h @@ -30,7 +30,5 @@ GtkWidget * xtm_process_monitor_new (void); void xtm_process_monitor_add_peak (XtmProcessMonitor *monitor, gfloat peak); void xtm_process_monitor_set_step_size (XtmProcessMonitor *monitor, gfloat step_size); void xtm_process_monitor_clear (XtmProcessMonitor *monitor); -void xtm_process_monitor_set_source_color (XtmProcessMonitor *monitor, gdouble red, gdouble green, gdouble blue); -void xtm_process_monitor_set_paint_box (XtmProcessMonitor *monitor, gboolean paint_box); #endif /* !PROCESS_MONITOR_H */ From e8c8dff357141ea8be0661965ab2ce7d3d0fc0d9 Mon Sep 17 00:00:00 2001 From: Simon Steinbeiss Date: Wed, 17 Dec 2014 10:43:56 +0100 Subject: [PATCH 34/34] Drop paint-box option --- src/process-monitor.c | 23 +---------------------- src/process-window.c | 12 ------------ src/settings-dialog-gtk3.ui | 15 --------------- src/settings-dialog.c | 1 - src/settings-dialog.ui | 15 --------------- 5 files changed, 1 insertion(+), 65 deletions(-) diff --git a/src/process-monitor.c b/src/process-monitor.c index 3bea77d..94ec6a7 100644 --- a/src/process-monitor.c +++ b/src/process-monitor.c @@ -21,7 +21,6 @@ enum { PROP_STEP_SIZE = 1, - PROP_PAINT_BOX, }; typedef struct _XtmProcessMonitorClass XtmProcessMonitorClass; struct _XtmProcessMonitorClass @@ -34,7 +33,6 @@ struct _XtmProcessMonitor /**/ gfloat step_size; GArray * history; - gboolean paint_box; }; G_DEFINE_TYPE (XtmProcessMonitor, xtm_process_monitor, GTK_TYPE_DRAWING_AREA) @@ -60,8 +58,6 @@ xtm_process_monitor_class_init (XtmProcessMonitorClass *klass) #endif g_object_class_install_property (class, PROP_STEP_SIZE, g_param_spec_float ("step-size", "StepSize", "Step size", 0.1, G_MAXFLOAT, 1, G_PARAM_CONSTRUCT|G_PARAM_READWRITE)); - g_object_class_install_property (class, PROP_PAINT_BOX, - g_param_spec_boolean ("paint-box", "PaintBox", "Paint box around monitor", TRUE, G_PARAM_CONSTRUCT|G_PARAM_READWRITE)); } static void @@ -80,10 +76,6 @@ xtm_process_monitor_get_property (GObject *object, guint property_id, GValue *va g_value_set_float (value, monitor->step_size); break; - case PROP_PAINT_BOX: - g_value_set_boolean (value, monitor->paint_box); - break; - default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -100,10 +92,6 @@ xtm_process_monitor_set_property (GObject *object, guint property_id, const GVal monitor->step_size = g_value_get_float (value); break; - case PROP_PAINT_BOX: - monitor->paint_box = g_value_get_boolean (value); - break; - default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; @@ -269,13 +257,4 @@ xtm_process_monitor_clear (XtmProcessMonitor *monitor) g_array_set_size (monitor->history, 0); if (GDK_IS_WINDOW (gtk_widget_get_window (GTK_WIDGET(monitor)))) gdk_window_invalidate_rect (gtk_widget_get_window (GTK_WIDGET(monitor)), NULL, FALSE); -} - -void -xtm_process_monitor_set_paint_box (XtmProcessMonitor *monitor, gboolean paint_box) -{ - g_return_if_fail (XTM_IS_PROCESS_MONITOR (monitor)); - g_object_set (monitor, "paint-box", paint_box, NULL); - if (GDK_IS_WINDOW (gtk_widget_get_window (GTK_WIDGET(monitor)))) - gdk_window_invalidate_rect (gtk_widget_get_window (GTK_WIDGET(monitor)), NULL, FALSE); -} +} \ No newline at end of file diff --git a/src/process-window.c b/src/process-window.c index 1621b34..b463c23 100644 --- a/src/process-window.c +++ b/src/process-window.c @@ -66,7 +66,6 @@ static gboolean emit_delete_event_signal (XtmProcessWindow *window, GdkEvent * static gboolean xtm_process_window_key_pressed (XtmProcessWindow *window, GdkEventKey *event); static void toolbar_update_style (XtmProcessWindow *window); static void monitor_update_step_size (XtmProcessWindow *window); -static void monitor_update_paint_box (XtmProcessWindow *window); static void show_about_dialog (XtmProcessWindow *window); @@ -159,8 +158,6 @@ xtm_process_window_init (XtmProcessWindow *window) gtk_widget_show (window->mem_monitor); gtk_container_add (GTK_CONTAINER (toolitem), window->mem_monitor); - monitor_update_paint_box (window); - g_signal_connect_swapped (window->settings, "notify::monitor-paint-box", G_CALLBACK (monitor_update_paint_box), window); g_signal_connect_swapped (window->settings, "notify::refresh-rate", G_CALLBACK (monitor_update_step_size), window); } @@ -289,15 +286,6 @@ toolbar_update_style (XtmProcessWindow *window) } } -static void -monitor_update_paint_box (XtmProcessWindow *window) -{ - gboolean paint_box; - g_object_get (window->settings, "monitor-paint-box", &paint_box, NULL); - xtm_process_monitor_set_paint_box (XTM_PROCESS_MONITOR (window->cpu_monitor), paint_box); - xtm_process_monitor_set_paint_box (XTM_PROCESS_MONITOR (window->mem_monitor), paint_box); -} - static void monitor_update_step_size (XtmProcessWindow *window) { diff --git a/src/settings-dialog-gtk3.ui b/src/settings-dialog-gtk3.ui index 43c509c..f54cf5c 100644 --- a/src/settings-dialog-gtk3.ui +++ b/src/settings-dialog-gtk3.ui @@ -123,21 +123,6 @@ 2 - - - Draw borders around monitors - True - True - False - 0.49000000953674316 - True - - - False - False - 3 - - Show processes as tree diff --git a/src/settings-dialog.c b/src/settings-dialog.c index 203cbc6..2309533 100644 --- a/src/settings-dialog.c +++ b/src/settings-dialog.c @@ -109,7 +109,6 @@ xtm_settings_dialog_init (XtmSettingsDialog *dialog) builder_bind_toggle_button (builder, "button-show-application-icons", dialog->settings, "show-application-icons"); builder_bind_toggle_button (builder, "button-full-command-line", dialog->settings, "full-command-line"); builder_bind_toggle_button (builder, "button-more-precision", dialog->settings, "more-precision"); - builder_bind_toggle_button (builder, "button-monitor-paint-box", dialog->settings, "monitor-paint-box"); builder_bind_toggle_button (builder, "button-prompt-terminate-task", dialog->settings, "prompt-terminate-task"); builder_bind_toggle_button (builder, "button-show-status-icon", dialog->settings, "show-status-icon"); builder_bind_toggle_button (builder, "button-show-memory-in-xbytes", dialog->settings, "show-memory-in-xbytes"); diff --git a/src/settings-dialog.ui b/src/settings-dialog.ui index 781bc0f..23694ab 100644 --- a/src/settings-dialog.ui +++ b/src/settings-dialog.ui @@ -85,21 +85,6 @@ 2 - - - Draw borders around monitors - True - True - False - 0.49000000953674316 - True - - - False - False - 3 - - Show processes as tree