[gimp] app: keep the statusbar progress from drawing over the right docks



commit 88ff45eb05483c2bd7be2f385fe5915b9b33cbea
Author: Michael Natterer <mitch gimp org>
Date:   Wed Sep 28 00:44:14 2016 +0200

    app: keep the statusbar progress from drawing over the right docks
    
    In a blocking operation we don't give the main loop time to lay out
    the statusbar correctly after showing the progress bar. Force a size
    on the progress bar using gtk_widget_size_allocate(). This sucks.

 app/display/gimpstatusbar.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/app/display/gimpstatusbar.c b/app/display/gimpstatusbar.c
index 8a62497..efcb114 100644
--- a/app/display/gimpstatusbar.c
+++ b/app/display/gimpstatusbar.c
@@ -414,7 +414,8 @@ gimp_statusbar_progress_start (GimpProgress *progress,
 
   if (! statusbar->progress_active)
     {
-      GtkWidget *bar = statusbar->progressbar;
+      GtkWidget     *bar = statusbar->progressbar;
+      GtkAllocation  allocation;
 
       statusbar->progress_active = TRUE;
       statusbar->progress_value  = 0.0;
@@ -437,13 +438,18 @@ gimp_statusbar_progress_start (GimpProgress *progress,
           gtk_widget_show (statusbar->cancel_button);
         }
 
+      gtk_widget_get_allocation (statusbar->label, &allocation);
+
       gtk_widget_show (statusbar->progressbar);
       gtk_widget_hide (statusbar->label);
 
-      /*  This call is needed so that the progress bar is drawn in the
-       *  correct place. Probably due a bug in GTK+.
+      /*  This shit is needed so that the progress bar is drawn in the
+       *  correct place in the cases where we suck completely and run
+       *  an operation that blocks the GUI and doesn't let the main
+       *  loop run.
        */
       gtk_container_resize_children (GTK_CONTAINER (statusbar));
+      gtk_widget_size_allocate (statusbar->progressbar, &allocation);
 
       if (! gtk_widget_get_visible (GTK_WIDGET (statusbar)))
         {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]