diff options
author | Sean Davis <smd.seandavis@gmail.com> | 2019-06-29 14:41:25 -0400 |
---|---|---|
committer | Sean Davis <smd.seandavis@gmail.com> | 2019-06-29 14:41:25 -0400 |
commit | e1b546a6eaf92f21fc8bb290b285c84dfdf09ae2 (patch) | |
tree | 2a98cf1af46f085489702bf8eaaf86a123525287 /xfce4-settings-manager | |
parent | 308f75daa725ae0a5cfc4c7cf9af37a5c8f8fc7b (diff) | |
download | xfce4-settings-e1b546a6eaf92f21fc8bb290b285c84dfdf09ae2.tar.gz |
Implement improved redrawing. Fixes missing icons (bug #15428, #15613)
Diffstat (limited to 'xfce4-settings-manager')
-rw-r--r-- | xfce4-settings-manager/xfce-settings-manager-dialog.c | 78 |
1 files changed, 61 insertions, 17 deletions
diff --git a/xfce4-settings-manager/xfce-settings-manager-dialog.c b/xfce4-settings-manager/xfce-settings-manager-dialog.c index 643e385e..ed1eddf7 100644 --- a/xfce4-settings-manager/xfce-settings-manager-dialog.c +++ b/xfce4-settings-manager/xfce-settings-manager-dialog.c @@ -158,6 +158,63 @@ xfce_settings_manager_dialog_class_init (XfceSettingsManagerDialogClass *klass) +static gboolean +xfce_settings_manager_queue_resize (XfceSettingsManagerDialog *dialog) +{ + GList *li; + DialogCategory *category; + GdkWindow *window = gtk_widget_get_window (GTK_WIDGET (dialog)); + + for (li = dialog->categories; li != NULL; li = li->next) + { + category = li->data; + gtk_widget_queue_resize (GTK_WIDGET (category->iconview)); + } + + if (window == NULL) + return FALSE; + + gdk_window_invalidate_rect (window, NULL, TRUE); + +G_GNUC_BEGIN_IGNORE_DEPRECATIONS + gdk_window_process_updates (window, TRUE); +G_GNUC_END_IGNORE_DEPRECATIONS + + return FALSE; +} + + + +/* FIXME: This is a hacky patch to ensure the embedded icon views resize on change. */ +static gboolean +xfce_settings_manager_queue_redraw (XfceSettingsManagerDialog *dialog) +{ + GdkWindow *window = gtk_widget_get_window (GTK_WIDGET (dialog)); + gint h, w; + + if (window == NULL) + return FALSE; + + h = gdk_window_get_height (window); + w = gdk_window_get_width (window); + + gdk_window_resize (window, w, h+1); + gdk_window_resize (window, w, h); + + return FALSE; +} + + + +static void +xfce_settings_manager_dialog_size_allocate (GtkWidget *widget, GdkRectangle *allocation, gpointer *user_data) +{ + XfceSettingsManagerDialog *dialog = XFCE_SETTINGS_MANAGER_DIALOG (user_data); + xfce_settings_manager_queue_resize (dialog); +} + + + static void xfce_settings_manager_dialog_init (XfceSettingsManagerDialog *dialog) { @@ -287,6 +344,8 @@ xfce_settings_manager_dialog_init (XfceSettingsManagerDialog *dialog) g_signal_connect_swapped (G_OBJECT (dialog->menu), "reload-required", G_CALLBACK (xfce_settings_manager_dialog_menu_reload), dialog); + + g_signal_connect (G_OBJECT (dialog), "size-allocate", G_CALLBACK (xfce_settings_manager_dialog_size_allocate), dialog); } @@ -676,23 +735,6 @@ xfce_settings_manager_dialog_go_back (XfceSettingsManagerDialog *dialog) -static gboolean -xfce_settings_manager_queue_redraw (XfceSettingsManagerDialog *dialog) -{ - GList *li; - DialogCategory *category; - - for (li = dialog->categories; li != NULL; li = li->next) - { - category = li->data; - gtk_widget_queue_resize (GTK_WIDGET (category->iconview)); - } - - return FALSE; -} - - - static void xfce_settings_manager_dialog_entry_changed (GtkWidget *entry, XfceSettingsManagerDialog *dialog) @@ -1330,6 +1372,8 @@ xfce_settings_manager_dialog_menu_reload (XfceSettingsManagerDialog *dialog) g_critical ("Failed to load menu: %s", error->message); g_error_free (error); } + + g_idle_add ((GSourceFunc) xfce_settings_manager_queue_redraw, dialog); } |