[gnome-boxes] display-page: Don't show widgets from size-allocate signal



commit 01d5add2f687c5348ad968c283229c4275f48ad2
Author: Zeeshan Ali <zeenix gmail com>
Date:   Wed Oct 5 12:42:56 2016 +0200

    display-page: Don't show widgets from size-allocate signal
    
    Don't show widgets from size-allocate signal handler cause that causes
    Gtk+ to show warnings:
    
    (gnome-boxes:1480): Gtk-WARNING **: GtkGrid 0xa73cc0 is drawn without a current allocation. This should 
not happen.
    
    and also with latest Gtk+ the showing of display size was not working. I
    also suspect some of the glitches I saw, to be coming from this check in
    Gtk+.

 src/display-page.vala |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/display-page.vala b/src/display-page.vala
index 9741ab8..38a45a9 100644
--- a/src/display-page.vala
+++ b/src/display-page.vala
@@ -254,6 +254,17 @@ private class Boxes.DisplayPage: Gtk.Box {
 
         // Translators: Showing size of widget as WIDTHxHEIGHT here.
         size_label.label = _("%dx%d").printf (allocation.width, allocation.height);
+
+        Idle.add (() => {
+            // Reason to do this in Idle is that Gtk+ doesn't like us showing
+            // widgets from this signal handler.
+            show_size_allocation ();
+
+            return false;
+        });
+    }
+
+    private void show_size_allocation () {
         size_label.visible = true;
 
         if (size_label_timeout != 0) {


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