13
0

fix GTK+ warnings when trying to determine maximum screen size without a Gdk::Window

This commit is contained in:
Paul Davis 2017-09-19 18:38:40 -04:00
parent 5de24ac02c
commit cb71d49dc6

View File

@ -224,12 +224,16 @@ GenericPluginUI::~GenericPluginUI ()
void
GenericPluginUI::scroller_size_request (Gtk::Requisition* a)
{
Glib::RefPtr<Gdk::Screen> screen = get_screen();
if (!screen)
screen = Gdk::Screen::get_default();
Glib::RefPtr<Gdk::Window> window (get_window());
Glib::RefPtr<Gdk::Screen> screen;
int maximum_width;
{
if (window) {
screen = get_screen();
}
int maximum_width = -1;
if (screen) {
Gdk::Rectangle monitor;
const int monitor_num = screen->get_monitor_at_window (get_window ());
screen->get_monitor_geometry (