Modify hacks associated with initial sizing of port matrices to try and make things work with both fluxbox and metacity.

git-svn-id: svn://localhost/ardour2/branches/3.0@5604 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2009-08-29 20:48:11 +00:00
parent 94c5a98e02
commit 7c49119be0
10 changed files with 36 additions and 28 deletions

View file

@ -923,3 +923,16 @@ convert_bgra_to_rgba (guint8 const* src,
src_pixel += 4;
}
}
void
resize_window_to_proportion_of_monitor (Gtk::Window* window, int max_width, int max_height)
{
Glib::RefPtr<Gdk::Screen> screen = window->get_screen ();
Gdk::Rectangle monitor_rect;
screen->get_monitor_geometry (0, monitor_rect);
int const w = std::min (monitor_rect.get_width(), max_width) * 0.8;
int const h = std::min (monitor_rect.get_height(), max_height) * 0.8;
window->resize (w, h);
}