[gnome-boxes] display-page: avoid critical if display is not set yet
- From: Marc-Andre Lureau <malureau src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes] display-page: avoid critical if display is not set yet
- Date: Mon, 3 Sep 2012 16:09:49 +0000 (UTC)
commit 3c25121fc754301b2f7f7166766396dbf7d8e849
Author: Marc-Andrà Lureau <marcandre lureau gmail com>
Date: Mon Sep 3 16:06:56 2012 +0200
display-page: avoid critical if display is not set yet
Boxes may want to update toolbar title before the display is set,
don't spit criticals in this case, and act appropriately.
If DisplayPage.show_display() isn't called yet, but the
App.app.window.window_state_event handler is triggered (when
maximized/fullscreen), we get the following backtrace:
(gnome-boxes:27519): Boxes-CRITICAL **: boxes_display_get_can_grab_mouse: assertion `self != NULL' failed
Program received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffff466574c in g_logv (log_domain=0x47b254 "Boxes",
log_level=G_LOG_LEVEL_CRITICAL, format=0x7ffff46e9d2c "%s: assertion `%s' failed",
args=0x7fffffffcdc8) at gmessages.c:967
967 G_BREAKPOINT ();
(gdb) bt
log_level=G_LOG_LEVEL_CRITICAL, format=0x7ffff46e9d2c "%s: assertion `%s' failed",
args=0x7fffffffcdc8) at gmessages.c:967
log_level=G_LOG_LEVEL_CRITICAL, format=0x7ffff46e9d2c "%s: assertion `%s' failed")
at gmessages.c:1003
pretty_function=0x47cec0 "boxes_display_get_can_grab_mouse",
expression=0x47ae49 "self != NULL") at gmessages.c:1012
at display.c:236
at display-page.c:1193
at display-page.c:659
event=<optimized out>, self=self entry=0x15a0ee0) at display-page.c:667
return_value=0x7fffffffd030, n_param_values=<optimized out>,
param_values=0x7fffffffd130, invocation_hint=<optimized out>,
marshal_data=<optimized out>) at gtkmarshalers.c:85
https://bugzilla.gnome.org/show_bug.cgi?id=683273
src/display-page.vala | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/src/display-page.vala b/src/display-page.vala
index 27b734b..f99142c 100644
--- a/src/display-page.vala
+++ b/src/display-page.vala
@@ -29,9 +29,17 @@ private class Boxes.DisplayPage: GLib.Object {
private uint toolbar_show_id;
private ulong cursor_id;
- private Boxes.Display display;
- private bool can_grab_mouse { get { return display.can_grab_mouse; } }
- private bool grabbed { get { return display.mouse_grabbed; } }
+ private Boxes.Display? display;
+ private bool can_grab_mouse {
+ get {
+ return display != null ? display.can_grab_mouse : false;
+ }
+ }
+ private bool grabbed {
+ get {
+ return display != null ? display.mouse_grabbed : false;
+ }
+ }
private ulong display_can_grab_id;
private ulong display_grabbed_id;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]