[gnome-boxes/gnome-3-22] display-page: Don't show widgets from size-allocate signal
- From: Zeeshan Ali <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes/gnome-3-22] display-page: Don't show widgets from size-allocate signal
- Date: Fri, 7 Oct 2016 12:12:39 +0000 (UTC)
commit 8384691d22a9d1df830e44f5bf8ada9a346c365d
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]