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 void
GenericPluginUI::scroller_size_request (Gtk::Requisition* a) GenericPluginUI::scroller_size_request (Gtk::Requisition* a)
{ {
Glib::RefPtr<Gdk::Screen> screen = get_screen(); Glib::RefPtr<Gdk::Window> window (get_window());
if (!screen) Glib::RefPtr<Gdk::Screen> screen;
screen = Gdk::Screen::get_default();
int maximum_width; if (window) {
{ screen = get_screen();
}
int maximum_width = -1;
if (screen) {
Gdk::Rectangle monitor; Gdk::Rectangle monitor;
const int monitor_num = screen->get_monitor_at_window (get_window ()); const int monitor_num = screen->get_monitor_at_window (get_window ());
screen->get_monitor_geometry ( screen->get_monitor_geometry (