diff options
author | Julien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr> | 2017-09-20 08:56:44 +0200 |
---|---|---|
committer | Julien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr> | 2017-09-20 08:56:44 +0200 |
commit | 9fbcecf2f5576c4742787a47adbfde500d765c62 (patch) | |
tree | 76843d137516ec9fbcc0f761a09b21d9c8dedde4 | |
parent | 7d559de3d0f1c4af0270d4f63efc9f772b5f042e (diff) |
Bail out early if a screen isn't found
-rw-r--r-- | gtk2_ardour/generic_pluginui.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/gtk2_ardour/generic_pluginui.cc b/gtk2_ardour/generic_pluginui.cc index 979cd4405a..6fe5e8b7fd 100644 --- a/gtk2_ardour/generic_pluginui.cc +++ b/gtk2_ardour/generic_pluginui.cc @@ -231,17 +231,17 @@ GenericPluginUI::scroller_size_request (Gtk::Requisition* a) screen = get_screen(); } - int maximum_width = -1; + if (!screen) { + return; + } - if (screen) { - Gdk::Rectangle monitor; - const int monitor_num = screen->get_monitor_at_window (get_window ()); - screen->get_monitor_geometry ( - (monitor_num < 0) ? 0 : monitor_num, - monitor); + Gdk::Rectangle monitor; + const int monitor_num = screen->get_monitor_at_window (window); + screen->get_monitor_geometry ( + (monitor_num < 0) ? 0 : monitor_num, + monitor); - maximum_width = monitor.get_width() * 0.9; - } + const int maximum_width = monitor.get_width() * 0.9; GtkRequisition request = hpacker.size_request(); |